Most of the services provided with the Phenoscape Knowledgebase web API return data in JSON format, plain text (usually tab-delimited), and NeXML. This package facilitates interfacing with the Phenoscape Knowledgebase for searching ontology terms, retrieving term info, and querying data matrices.

Installation

The development version of RPhenoscape is available on Github. It has not yet been released to [CRAN]. To install RPhenoscape from Github, use the install_github() function in the remotes package (which can be installed from CRAN using install.packages()). See the package README for details.

Once installed, the package can be loaded (“attached”) as any other R package:

Character Matrix via OntoTrace

Use OntoTrace to obtain a character matrix for a taxonomic clade and anatomical region of interest.

The Phenoscape Knowledgebase web API returns the evolutionary character matrix in NeXML format. The first step is to get the NeXML object using pk_get_ontotrace_xml method.

nex <- pk_get_ontotrace_xml(taxon = c("Ictalurus", "Ameiurus"), entity = "fin spine")

The result is an object of class nexml defined in the RNeXML package. The object mirrors the structure of a NeXML file, and can be inspected accordingly. Note that although generically NeXML files can contain multiple OTUs blocks and multiple characters blocks, NeXML files generated by the KB’s OntoTrace API contain only one. This means we can, for example, inspect the number of taxa and characters as follows:

# number of taxa in the first (and only) OTUs block
length(nex@otus[[1]]@otu)
[1] 15
# number of characters in the first (and only) characters block
length(nex@characters[[1]]@format@char)
[1] 2

More details on the nexml object can be found in the RNeXML documentation.

Then retrieve wanted information from the NeXML object.
Get character matrix:

(m <- pk_get_ontotrace(nex))
                     taxa         otu                                  otus
1       Ameiurus brunneus VTO_0036273 t7b654510-76d9-4b80-9e8c-00f72d1358b8
2          Ameiurus catus VTO_0036275 t7b654510-76d9-4b80-9e8c-00f72d1358b8
3          Ameiurus melas VTO_0036272 t7b654510-76d9-4b80-9e8c-00f72d1358b8
4        Ameiurus natalis VTO_0036274 t7b654510-76d9-4b80-9e8c-00f72d1358b8
5      Ameiurus nebulosus VTO_0036278 t7b654510-76d9-4b80-9e8c-00f72d1358b8
6  Ameiurus platycephalus VTO_0036276 t7b654510-76d9-4b80-9e8c-00f72d1358b8
7   Ameiurus serracanthus VTO_0036277 t7b654510-76d9-4b80-9e8c-00f72d1358b8
8     Ictalurus australis VTO_0061495 t7b654510-76d9-4b80-9e8c-00f72d1358b8
9      Ictalurus balsanus VTO_0036221 t7b654510-76d9-4b80-9e8c-00f72d1358b8
10      Ictalurus dugesii VTO_0061497 t7b654510-76d9-4b80-9e8c-00f72d1358b8
11     Ictalurus furcatus VTO_0036223 t7b654510-76d9-4b80-9e8c-00f72d1358b8
12        Ictalurus lupus VTO_0036220 t7b654510-76d9-4b80-9e8c-00f72d1358b8
13    Ictalurus mexicanus VTO_0061498 t7b654510-76d9-4b80-9e8c-00f72d1358b8
14       Ictalurus pricei VTO_0036218 t7b654510-76d9-4b80-9e8c-00f72d1358b8
15    Ictalurus punctatus VTO_0036225 t7b654510-76d9-4b80-9e8c-00f72d1358b8
   anterior dentation of pectoral fin spine
1                                         1
2                                         1
3                                        NA
4                                        NA
5                                         1
6                                         1
7                                         1
8                                         1
9                                         0
10                                       NA
11                                        0
12                                        1
13                                       NA
14                                        1
15                                        1
   anterior distal serration of pectoral fin spine
1                                                1
2                                                1
3                                          1 and 0
4                                                1
5                                                1
6                                                1
7                                                1
8                                                1
9                                          1 and 0
10                                               1
11                                               1
12                                               1
13                                               1
14                                               1
15                                               1

The character matrix can be integrated with other data, such as meta data which include taxon identifiers, character identifiers, etc. Get meta data:

(meta <- pk_get_ontotrace_meta(nex))
$id_taxa
                    label                                       href
1     Ictalurus mexicanus http://purl.obolibrary.org/obo/VTO_0061498
2         Ictalurus lupus http://purl.obolibrary.org/obo/VTO_0036220
3          Ameiurus catus http://purl.obolibrary.org/obo/VTO_0036275
4  Ameiurus platycephalus http://purl.obolibrary.org/obo/VTO_0036276
5      Ameiurus nebulosus http://purl.obolibrary.org/obo/VTO_0036278
6     Ictalurus australis http://purl.obolibrary.org/obo/VTO_0061495
7        Ictalurus pricei http://purl.obolibrary.org/obo/VTO_0036218
8     Ictalurus punctatus http://purl.obolibrary.org/obo/VTO_0036225
9   Ameiurus serracanthus http://purl.obolibrary.org/obo/VTO_0036277
10         Ameiurus melas http://purl.obolibrary.org/obo/VTO_0036272
11       Ameiurus natalis http://purl.obolibrary.org/obo/VTO_0036274
12     Ictalurus furcatus http://purl.obolibrary.org/obo/VTO_0036223
13      Ameiurus brunneus http://purl.obolibrary.org/obo/VTO_0036273
14     Ictalurus balsanus http://purl.obolibrary.org/obo/VTO_0036221
15      Ictalurus dugesii http://purl.obolibrary.org/obo/VTO_0061497
           otu                                  otus
1  VTO_0061498 t7b654510-76d9-4b80-9e8c-00f72d1358b8
2  VTO_0036220 t7b654510-76d9-4b80-9e8c-00f72d1358b8
3  VTO_0036275 t7b654510-76d9-4b80-9e8c-00f72d1358b8
4  VTO_0036276 t7b654510-76d9-4b80-9e8c-00f72d1358b8
5  VTO_0036278 t7b654510-76d9-4b80-9e8c-00f72d1358b8
6  VTO_0061495 t7b654510-76d9-4b80-9e8c-00f72d1358b8
7  VTO_0036218 t7b654510-76d9-4b80-9e8c-00f72d1358b8
8  VTO_0036225 t7b654510-76d9-4b80-9e8c-00f72d1358b8
9  VTO_0036277 t7b654510-76d9-4b80-9e8c-00f72d1358b8
10 VTO_0036272 t7b654510-76d9-4b80-9e8c-00f72d1358b8
11 VTO_0036274 t7b654510-76d9-4b80-9e8c-00f72d1358b8
12 VTO_0036223 t7b654510-76d9-4b80-9e8c-00f72d1358b8
13 VTO_0036273 t7b654510-76d9-4b80-9e8c-00f72d1358b8
14 VTO_0036221 t7b654510-76d9-4b80-9e8c-00f72d1358b8
15 VTO_0061497 t7b654510-76d9-4b80-9e8c-00f72d1358b8

$id_entities
                                            label
1 anterior distal serration of pectoral fin spine
2        anterior dentation of pectoral fin spine
                                           href           char
1 http://purl.obolibrary.org/obo/UBERON_2002002 UBERON_2002002
2 http://purl.obolibrary.org/obo/UBERON_2002001 UBERON_2002001

Character Matrices for Studies

To obtain the character matrices for studies published for a taxonomic clade and anatomical region of interest.

First step is to retrieve the list of studies given a taxonomic clade and anatomical structures (returned as data.frame).

(slist <- pk_get_study_list(taxon = "Ictalurus australis", entity = "fin"))
                                                                                                                                 id
1 https://scholar.google.com/scholar?q=The+Phylogeny+of+Ictalurid+Catfishes%3A+A+Synthesis+of+Recent+Work&btnG=&hl=en&as_sdt=0%2C42
            label
1 Lundberg (1992)

Based off the study ids retained from previous step, get the evolutionary character matrix for each study id (in NeXML-format) using pk_get_study_xml.

(nex_list <- pk_get_study_xml(slist$id))
$`https://scholar.google.com/scholar?q=The+Phylogeny+of+Ictalurid+Catfishes%3A+A+Synthesis+of+Recent+Work&btnG=&hl=en&as_sdt=0%2C42`
A nexml object representing:
     0 phylogenetic tree block(s),  
     1 character block(s), where:
       block 1 defines 115 standard/discrete character(s), with 2 to 7 states 
        and  0 polymorphic or uncertain state(s) defined 
       matrix 1 has 22 row(s) 
     22 taxonomic units in 1 block(s) 
  Taxa:  Ictalurus pricei, Ictalurus lupus, Ameiurus natalis, Ameiurus nebulosus, Noturus insignis, Ictalurus australis ...
  Metadata annotations: 
    3 at top level 
    22 in block 1 at otu level 
    115 in block 1 at char level 
    734 in block 1 at state level

NeXML generated by RNeXML using schema version: 0.9 
Size: 7.3 Mb 

From the list of NeXML objects, retrieve the character matrices.

study_matrix <- pk_get_study(nex_list)
study_matrix[[1]][1:5, 1:5]
                taxa                                      otu
1  Ameiurus brunneus otu_905bdcf6-5e27-4f66-9961-a34e81b03140
2     Ameiurus catus otu_65e45284-e2fd-4867-a53e-36475b267e2f
3     Ameiurus melas otu_ca02c929-3632-49d9-8564-df319184a5a5
4   Ameiurus natalis otu_34dd3fce-8268-43b5-af73-df184afc8f4d
5 Ameiurus nebulosus otu_9916d34b-9b21-4292-95b2-ac550e495c3a
  Anal-fin rays, species mean count Anterior dentations of pectoral spine
1                           16.1-20                                 large
2                         20.1-25.5                              moderate
3                         20.1-25.5                                 small
4                           25.6-28                                 small
5                         20.1-25.5                              moderate
  Anterior distal serrae of pectoral spine
1               <3 moderately sharp serrae
2              3-6 moderately sharp serrae
3             absent or scarcely developed
4              3-6 moderately sharp serrae
5               <3 moderately sharp serrae

Each character matrix can be integrated with other data, such as meta data which include taxon identifiers, character identifiers, etc. Get meta data:

study_metas <- pk_get_study_meta(nex_list)
study_metas[[1]]
$id_taxa
                     label                                       href
1         Ictalurus pricei http://purl.obolibrary.org/obo/VTO_0036218
2          Ictalurus lupus http://purl.obolibrary.org/obo/VTO_0036220
3         Ameiurus natalis http://purl.obolibrary.org/obo/VTO_0036274
4       Ameiurus nebulosus http://purl.obolibrary.org/obo/VTO_0036278
5         Noturus insignis http://purl.obolibrary.org/obo/VTO_0036237
6      Ictalurus australis http://purl.obolibrary.org/obo/VTO_0061495
7      Ictalurus mexicanus http://purl.obolibrary.org/obo/VTO_0061498
8   Prietella phreatophila http://purl.obolibrary.org/obo/VTO_0036265
9           Ameiurus melas http://purl.obolibrary.org/obo/VTO_0036272
10     Pylodictis olivaris http://purl.obolibrary.org/obo/VTO_0036282
11      Ictalurus furcatus http://purl.obolibrary.org/obo/VTO_0036223
12       Ictalurus dugesii http://purl.obolibrary.org/obo/VTO_0061497
13        Satan eurystomus http://purl.obolibrary.org/obo/VTO_0061485
14  Ameiurus platycephalus http://purl.obolibrary.org/obo/VTO_0036276
15      Ictalurus balsanus http://purl.obolibrary.org/obo/VTO_0036221
16   Ameiurus serracanthus http://purl.obolibrary.org/obo/VTO_0036277
17          Noturus flavus http://purl.obolibrary.org/obo/VTO_0036263
18       Noturus stigmosus http://purl.obolibrary.org/obo/VTO_0036261
19     Ictalurus punctatus http://purl.obolibrary.org/obo/VTO_0036225
20          Ameiurus catus http://purl.obolibrary.org/obo/VTO_0036275
21       Ameiurus brunneus http://purl.obolibrary.org/obo/VTO_0036273
22 Trogloglanis pattersoni http://purl.obolibrary.org/obo/VTO_0061501
                                        otu
1  otu_ad5e6e49-2a9e-43e8-af87-3016bd16cd35
2  otu_e473e64d-055e-4364-8022-2158dc2a523e
3  otu_34dd3fce-8268-43b5-af73-df184afc8f4d
4  otu_9916d34b-9b21-4292-95b2-ac550e495c3a
5  otu_8b30cd95-359c-4a54-a2fd-72002b9ff0d4
6  otu_ce8050ad-493d-494b-ac73-508917b9207a
7  otu_3aebb08b-5385-476e-a2fd-dc356c0606dd
8  otu_c2e9a6a8-6582-4249-8836-7597ae6cc9e6
9  otu_ca02c929-3632-49d9-8564-df319184a5a5
10 otu_df074a9c-9fd4-433d-80a5-70211a534348
11 otu_2cf53956-e59a-4c22-a625-ebd0f5e1b7e5
12 otu_3a012267-3f5d-44e2-91b3-d5e0e10bbcbe
13 otu_2dbc0322-7fe9-4d13-9c14-64818e24cc24
14 otu_08b57892-301f-4c1b-91a5-1349949be25f
15 otu_7bad6a92-00b9-41e4-a357-6c29fb74dfc6
16 otu_bb9223d2-a342-464f-83e0-25fdbd76865c
17 otu_b54b9416-f054-4879-8f64-62d446c87c85
18 otu_e309e6a6-2c40-4271-9296-85b11a8dad2a
19 otu_ee040977-66bc-4b65-b3ea-a036131c096c
20 otu_65e45284-e2fd-4867-a53e-36475b267e2f
21 otu_905bdcf6-5e27-4f66-9961-a34e81b03140
22 otu_7b401d3e-4732-4c59-9e21-df0d9a5e406a
                                        otus
1  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
2  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
3  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
4  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
5  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
6  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
7  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
8  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
9  otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
10 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
11 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
12 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
13 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
14 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
15 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
16 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
17 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
18 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
19 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
20 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
21 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4
22 otus_26bc085e-8dc3-42c0-854d-afbc0aaa09d4

$id_entities
                                                              label
1                                     Posterior flap of adipose fin
2                                                    Gill membranes
3                                                       Orbital rim
4                                                        Caudal fin
5                                               Lateral line extent
6                                                 Mesethmoid cornua
7                           Width of snout across mesethmoid cornua
8                                          Width of mesethmoid neck
9        Cross-sectional form of skull (juveniles and young adults)
10                             Neurocranial width at epiphyseal bar
11                            Posterior cranial fontanelle (adults)
12                Supraoccipital process and associated supraneural
13                                    Sagittal crests on skull roof
14                                      Transverse occipital crests
15                               Muscle crests on margin of frontal
16                     Sculpturing pattern of supraoccipital crests
17                                     Anterior extent of sphenotic
18                                                Sphenotic process
19                                   Extrascapular bone composition
20                                              Pterotic wing shape
21                                                 Pterotic surface
22                                                      Nasal shape
23                                               Infraorbital bones
24                                             Lateral ethmoid wing
25                             Superficial ophthalmic nerve foramen
26                                                  Orbital foramen
27                                                Parasphenoid stem
28                                  Ascending wings of parasphenoid
29    Posterior end of adductor arcus palatini scar on parasphenoid
30                                         Vertical wing of frontal
31                                      Pterosphenoid-prootic joint
32                                           Orbitosphenoid shelves
33                                        Prootic-exoccipital joint
34                                      Prootic-basioccipital joint
35                                                    Optic foramen
36                                                  Mandible length
37                    Mandibular sensory canal pores, species modes
38                           First mandibular sensory pore and tube
39                            Mandibular symphyseal ventral process
40                                   Anteroventral crest of dentary
41                                                 Coronoid process
42                                   Posterior process of articular
43                                                 Premaxilla width
44                                     Mesial process of premaxilla
45                                    Lateral process of premaxilla
46                               Premaxillary teeth-size and number
47                               Jaw teeth-shape and size gradation
48                                Jaw adductor musculature-A3 layer
49                                                  Palatine length
50                          Hyomandibular (otic region joint) shape
51                                Anterior process of hyomandibular
52      Opercular facet position on posterior edge of hyomandibular
53                                Hyomandibular-metapterygoid joint
54                                     Hyomandibular-quadrate joint
55  Scar on hyomandibular for A3 bundle of jaw adductor musculature
56         Crest on hyomandibular for levator arcus palatini muscle
57      Crest on hyomandibular for A2 bundle of jaw adductor muscle
58               Crest on hyomandibular for levator operculi muscle
59     Process on hyomandibular for adductor hyomandibularis muscle
60     External foramen of facial nerve canal through hyomandibular
61                                                 Symplectic canal
62             Jaw adductor muscle attachment surface on preopercle
63                                         Upper limb of preopercle
64                                                  Suprapreopercle
65                              Quadrate-metapterygoid joint length
66                         Quadrate-metapterygoid joint composition
67                                               Metapterygoid form
68                                               Endopterygoid size
69                                         Epihyal-ceratohyal joint
70                                        Dorsal edge of ceratohyal
71                                                    Epihyal shape
72                                Ceratohyal-ventral hypohyal joint
73                                                  Dorsal hypohyal
74                                                    Urohyal shape
75                                                    Opercle shape
76                      Scar on opercle for levator operculi muscle
77                                               Interopercle shape
78                                     Dorsal pits on first centrum
79                                  Ventral ridges on first centrum
80                          Development of superficial ossification
81                       Anterior limb of fourth transverse process
82           Vertical lamina between third and fourth neural spines
83                                   Neural complex = supraneural 3
84                                        Depth of Weberian complex
85                                                      Gas bladder
86                         Precaudal vertebrae, species mean number
87                            Caudal vertebrae, species mean number
88                                                         Hypurals
89                                                   Hypurapophysis
90                                  Caudal-fin branched ray numbers
91            Middle Nuchal plate of first dorsal-fin pterygiophore
92           Spine base condyles on second dorsal-fin pterygiophore
93                                     Dorsal-fin spine development
94                                Anal-fin rays, species mean count
95                      Pectoral-fin soft rays, species modal count
96                                             Pectoral-fin radials
97             Ornamentation pattern on posterior cleithral process
98                            Length of posterior cleithral process
99                                    Length of cleithral symphysis
100                    Coracoid midline sutures, species mean count
101                                        Ventral keel of coracoid
102               Secondary keel on coracoid below scapular foramen
103                               Extensor muscle fossa on coracoid
104                                           Transcapular ligament
105                           Subpterotic process of supracleithrum
106                                              Pectoral spine tip
107                        Anterior distal serrae of pectoral spine
108                           Anterior dentations of pectoral spine
109                                Anterior ridge of pectoral spine
110                                       Posterior dentation shape
111                                       Posterior dentation bases
112                                    Pectoral spine late ontogeny
113                         Posterolateral process of basipterygium
114                                                   Pelvic splint
115                           Pelvic-fin rays, species modal counts
                                              char
1   character_545ff179-7751-4f3b-b9e9-d3fa0155f209
2   character_dd0306f5-231e-432f-8eed-a85dce575589
3   character_1f41bdfe-d17c-4aa6-a138-68a073c9622e
4   character_aa593948-b7c3-43a9-a54d-5e059f8a9a58
5   character_991c67c0-7921-4946-949f-fa3409bbf0af
6   character_604dc50b-128a-41d8-9d14-0ead2f590bd0
7   character_d937bba3-a2d4-492f-ad2f-f4e4b98e6e8b
8   character_674516ca-883c-4244-b41f-6a84c7e29273
9   character_f39fb87b-e83a-4be1-a47d-bd6c67d63581
10  character_69a07fa8-4909-46c7-a6e0-5ba99a467b01
11  character_0d1395be-ac1f-43b5-9d2e-bb2b56030bba
12  character_e7129b3d-b6d9-4988-82b2-63bbdef4d1de
13  character_eda6b122-4877-47a9-a392-5b55735d0d0e
14  character_c02831fd-8c80-40a9-9119-4eefdc422867
15  character_20f9e536-8247-41ed-81c2-c7bef8640ba5
16  character_0a359962-aa1d-4ba3-bba5-3fb28495f3a4
17  character_4fece5ef-a658-4688-b661-4367c30f4847
18  character_f938af0e-7b2a-4623-aaee-dcacdac2b2e2
19  character_a83460d2-7189-4d5f-a9ad-1d8c36036a9c
20  character_6f9c64ff-ff2d-426a-8b5a-a348400d50f6
21  character_b2495975-5d49-461a-8e3a-a21103f8a467
22  character_b4a1f760-049b-4bd9-b771-b800d7a21240
23  character_bc98cc56-6e59-4586-9376-3611feddd0f9
24  character_637bc1e7-6bce-4422-93cc-3d75fe8ff46e
25  character_7cade8b6-c291-46a4-bca8-cba58d42b6e8
26  character_59fbf7d5-dd39-41ba-85e5-f92522cd9cea
27  character_14d3c0d6-d04f-4477-971e-7455401f333f
28  character_46745de4-4b95-4248-b443-090caf010037
29  character_5440aa6c-860f-41b6-bff5-b4edb23fe71c
30  character_16ffa62a-03ba-4cc4-af7a-ead325664fbe
31  character_7a5fb1f8-0613-405d-80f0-65171b7a5ae1
32  character_0362e064-79eb-4726-9de1-538b80a5222a
33  character_5ca0eaeb-3ec3-4f57-a990-f699f45aa62f
34  character_96a05bb2-1e83-485b-a0ca-77622c3db9f7
35  character_3830700a-fe13-448b-bc9a-7b8ae27bb6eb
36  character_67d37538-46e3-4fc0-ac1e-67af25ee7260
37  character_fea2501d-fed1-46dd-b416-e30b41431d69
38  character_973f0454-2349-4789-8070-e47473174f0c
39  character_80a8e783-01fe-4495-95cc-4e4f4251935c
40  character_ca2f3d7f-4063-40f4-bd28-76e9e1dad20a
41  character_16b27047-073d-4e38-b740-d1992d420892
42  character_932df5cc-8fe5-41eb-9eff-9986cfdcbaf0
43  character_fe9463a8-7f6f-4d24-a2cb-2e7abbf24b07
44  character_ec22e364-288b-4538-8eb7-c9c287b2bb21
45  character_40ac0e29-72ee-4075-9e66-290cd0c9fc31
46  character_dc0839e7-d983-4078-82c6-ca1cfbef7d04
47  character_9d172273-98e3-45e4-86c9-42515b8046d1
48  character_50177de7-6de1-401e-bf3f-571080178ab3
49  character_720d1c43-20e1-4c06-9282-9698af40f3f5
50  character_70dd9ebd-d6b7-4a9f-90c6-481b147d881c
51  character_4bf94765-0ae8-4ed8-b049-b4e30d30d3f9
52  character_bea8a71a-f265-49bd-ba9e-5a7c4a186a46
53  character_993fd249-d9ac-41af-a2cc-820090c0e483
54  character_40b2b697-416b-420b-970c-09d8cf86a1cc
55  character_9af79554-acaf-4017-8bbf-aa8761b9cebb
56  character_7e4911a8-5c74-44dc-b0a0-b16c054995b5
57  character_b53b88c1-e207-4019-b68c-d0eb46f94362
58  character_db4c883a-df2c-4ee7-bc5e-deb2f708f3d6
59  character_949cc346-a0e9-45c1-82be-ebd6ab202cf5
60  character_d91504d4-bb2a-4a39-aad5-6eeb02e85d75
61  character_bd2f1f00-ac36-43bf-8efb-f3c748b4556b
62  character_db7516f3-c971-4091-bc5d-20fa5fbf9fd9
63  character_7576102e-736f-4de1-8dca-50443191c43f
64  character_b26f095c-a548-4601-9a94-73b3c912126c
65  character_98a0e343-630c-4704-a9c2-92349f8e4aed
66  character_30905456-231e-4b35-93a5-1a4d02a0d160
67  character_4d867aed-98b7-4810-a614-13a25d7f1abf
68  character_9d9e6971-31e0-46c9-a83e-1c8c6f20086f
69  character_b9f720da-cb48-4752-9244-e7c322b3a8c4
70  character_b737767a-0573-4c71-9470-e17372de3824
71  character_1a416a84-5d2b-4f3c-8105-fff680214a60
72  character_d9c73ccd-abf9-4060-9bc4-d0f5a4032770
73  character_d981d210-362c-49ca-9dc9-553beb81e378
74  character_4c33cff8-571a-409f-a49f-4efd100dc7a1
75  character_296bcaf7-7a26-4796-b3fe-655113e0d44c
76  character_f2995ba3-f004-4a36-a164-093850f5129c
77  character_f4d7e694-ed60-4905-afea-c4852aef2f80
78  character_242dc530-c906-4a71-adf4-fb7d40a19be9
79  character_4e7cc26a-9dab-4247-8771-1193a9f3dd32
80  character_a30610b4-ad6f-4645-8b42-b648ec365fad
81  character_b3c10e5b-65ee-4944-a998-78c6402eede7
82  character_72645c24-88ab-4263-99c2-93c7e6338ba4
83  character_80518fa9-e96f-4c1a-88f7-41b0ab50abf5
84  character_90cc567e-df14-40fc-9120-1470087f86e0
85  character_45734467-df6b-48e5-82e5-659aeb72ecae
86  character_5af443b6-55d1-4db0-89c4-2e9b504aa6ae
87  character_2d3fff46-1e36-427b-8523-d7c2f99be7be
88  character_b820c41b-d63a-4ba2-8a62-e7f148a94963
89  character_8b9c06d5-bb3f-43dc-bc39-efdad59c1ef2
90  character_b32935c4-622a-4fb7-b16b-369b4e326a7d
91  character_79249498-1cf3-4d89-822a-43213ab6bb73
92  character_3fba0cdb-6a82-4a82-a5ad-7a9796cd7a83
93  character_dae83bd5-1ab2-4d9e-8fb6-0b9f2319f4bf
94  character_f64fb043-0011-4123-b954-61ec30cdfab8
95  character_234f4665-20ee-43e6-8938-1da2e5c5a9ab
96  character_9d40a70e-3cdc-40f6-a2c9-9cfb5064adff
97  character_f33db9f1-1ae0-4e0b-bb56-6bc1642c3772
98  character_b50d5646-1ae8-42a9-88c4-11f0aacfe5af
99  character_6b088f13-2efd-4757-a51a-5b4851273432
100 character_4a6f5266-e4aa-4537-9a30-bb2f79225018
101 character_92a1f1f9-a6e0-41b7-86fd-d3d426ea55c0
102 character_a40cf987-fe21-4d33-8617-1daf43210649
103 character_2df39fe7-99f0-4d8c-a7f6-7e01f5ba60e3
104 character_611956a4-0533-4a82-bba5-1258f5b5bc25
105 character_a32f71ec-0bb1-46c1-bd20-07237bf0e2bf
106 character_91733b6c-3381-4ab5-8b0c-62bc85ae3f86
107 character_538ea3ca-6401-4086-84c2-54fdf47288d4
108 character_3d6c610f-25e6-4689-bb9e-5e59a017ac6f
109 character_baede3f1-f154-46b1-be5a-0c35e90c5a3e
110 character_bcda4da1-0738-4de9-be68-23db5d16e8a6
111 character_00c5b8d1-7dc2-454c-84e2-5ae44070c3c9
112 character_98af142a-4863-4384-bbe3-f77e0a8705b5
113 character_b11abedc-1302-458d-b44b-147e55e58f26
114 character_5f591638-fff4-409b-bfe3-74cb3396bece
115 character_bc73b575-e7fb-4d8f-8f8d-fc6dc6be2f21

Obtain Other Data

Subsetting a Matrix

A matrix obtained from Phenoscape can be subsetted (filtered) by taxonomic subgroup or anatomical part. For example, using pk_is_descendant and pk_is_ancestor methods, a matrix can be subsetted to a taxonomic subgroup that is the descendants/ancestors of a given taxon.

m # original character matrix
                     taxa         otu                                  otus
1       Ameiurus brunneus VTO_0036273 t7b654510-76d9-4b80-9e8c-00f72d1358b8
2          Ameiurus catus VTO_0036275 t7b654510-76d9-4b80-9e8c-00f72d1358b8
3          Ameiurus melas VTO_0036272 t7b654510-76d9-4b80-9e8c-00f72d1358b8
4        Ameiurus natalis VTO_0036274 t7b654510-76d9-4b80-9e8c-00f72d1358b8
5      Ameiurus nebulosus VTO_0036278 t7b654510-76d9-4b80-9e8c-00f72d1358b8
6  Ameiurus platycephalus VTO_0036276 t7b654510-76d9-4b80-9e8c-00f72d1358b8
7   Ameiurus serracanthus VTO_0036277 t7b654510-76d9-4b80-9e8c-00f72d1358b8
8     Ictalurus australis VTO_0061495 t7b654510-76d9-4b80-9e8c-00f72d1358b8
9      Ictalurus balsanus VTO_0036221 t7b654510-76d9-4b80-9e8c-00f72d1358b8
10      Ictalurus dugesii VTO_0061497 t7b654510-76d9-4b80-9e8c-00f72d1358b8
11     Ictalurus furcatus VTO_0036223 t7b654510-76d9-4b80-9e8c-00f72d1358b8
12        Ictalurus lupus VTO_0036220 t7b654510-76d9-4b80-9e8c-00f72d1358b8
13    Ictalurus mexicanus VTO_0061498 t7b654510-76d9-4b80-9e8c-00f72d1358b8
14       Ictalurus pricei VTO_0036218 t7b654510-76d9-4b80-9e8c-00f72d1358b8
15    Ictalurus punctatus VTO_0036225 t7b654510-76d9-4b80-9e8c-00f72d1358b8
   anterior dentation of pectoral fin spine
1                                         1
2                                         1
3                                        NA
4                                        NA
5                                         1
6                                         1
7                                         1
8                                         1
9                                         0
10                                       NA
11                                        0
12                                        1
13                                       NA
14                                        1
15                                        1
   anterior distal serration of pectoral fin spine
1                                                1
2                                                1
3                                          1 and 0
4                                                1
5                                                1
6                                                1
7                                                1
8                                                1
9                                          1 and 0
10                                               1
11                                               1
12                                               1
13                                               1
14                                               1
15                                               1
(is_desc <- pk_is_descendant('Ictalurus', m$taxa))
 [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE  TRUE
[13]  TRUE  TRUE  TRUE
m[is_desc, ] #subsetting to the descendants of Ictalurus
                  taxa         otu                                  otus
8  Ictalurus australis VTO_0061495 t7b654510-76d9-4b80-9e8c-00f72d1358b8
9   Ictalurus balsanus VTO_0036221 t7b654510-76d9-4b80-9e8c-00f72d1358b8
10   Ictalurus dugesii VTO_0061497 t7b654510-76d9-4b80-9e8c-00f72d1358b8
11  Ictalurus furcatus VTO_0036223 t7b654510-76d9-4b80-9e8c-00f72d1358b8
12     Ictalurus lupus VTO_0036220 t7b654510-76d9-4b80-9e8c-00f72d1358b8
13 Ictalurus mexicanus VTO_0061498 t7b654510-76d9-4b80-9e8c-00f72d1358b8
14    Ictalurus pricei VTO_0036218 t7b654510-76d9-4b80-9e8c-00f72d1358b8
15 Ictalurus punctatus VTO_0036225 t7b654510-76d9-4b80-9e8c-00f72d1358b8
   anterior dentation of pectoral fin spine
8                                         1
9                                         0
10                                       NA
11                                        0
12                                        1
13                                       NA
14                                        1
15                                        1
   anterior distal serration of pectoral fin spine
8                                                1
9                                          1 and 0
10                                               1
11                                               1
12                                               1
13                                               1
14                                               1
15                                               1