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()):

# the default build_opts will skip building the vignettes.
remotes::install_github("phenoscape/rphenoscape", build_opts=c("--no-manual"))

The custom build_opts parameter ensures that the vignette(s) (such as this document) will be built and installed as well. (The default for build_opts will skip building vignettes.) Building vignettes requires a recent version of the knitr and rmarkdown packages. You can install these beforehand, or include the parameter dependencies=TRUE in the above. Note that the latter will also result in packages being installed that otherwise are only needed for testing, and for generating the help pages. If you don’t develop packages yourself, this may be much more than you need, and therefore installing knitr and rmarkdown beforehand is then the better option.

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

library(rphenoscape)

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
1       Ameiurus brunneus VTO_0036273
2          Ameiurus catus VTO_0036275
3          Ameiurus melas VTO_0036272
4        Ameiurus natalis VTO_0036274
5      Ameiurus nebulosus VTO_0036278
6  Ameiurus platycephalus VTO_0036276
7   Ameiurus serracanthus VTO_0036277
8     Ictalurus australis VTO_0061495
9      Ictalurus balsanus VTO_0036221
10      Ictalurus dugesii VTO_0061497
11     Ictalurus furcatus VTO_0036223
12        Ictalurus lupus VTO_0036220
13    Ictalurus mexicanus VTO_0061498
14       Ictalurus pricei VTO_0036218
15    Ictalurus punctatus VTO_0036225
                                    otus
1  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
2  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
3  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
4  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
5  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
6  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
7  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
8  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
9  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
10 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
11 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
12 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
13 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
14 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
15 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
   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 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
2  VTO_0036220 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
3  VTO_0036275 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
4  VTO_0036276 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
5  VTO_0036278 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
6  VTO_0061495 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
7  VTO_0036218 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
8  VTO_0036225 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
9  VTO_0036277 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
10 VTO_0036272 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
11 VTO_0036274 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
12 VTO_0036223 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
13 VTO_0036273 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
14 VTO_0036221 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
15 VTO_0061497 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0

$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:  Pylodictis olivaris, Ictalurus dugesii, Ameiurus platycephalus, Ameiurus catus, Ictalurus punctatus, Ameiurus natalis ...
  Metadata annotations: 
    3 at top level 
    22 in block 1 at otu level 
    0 in block 1 at char level 
    367 in block 1 at state level

NeXML generated by RNeXML using schema version: 0.9 
Size: 6.6 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_ccd2f20f-5108-40bb-aaf4-e523a0cf5fa5
2     Ameiurus catus otu_15e92b3e-d3c6-4147-99fe-e39a8da3bcb0
3     Ameiurus melas otu_e4c68076-9cd7-4c51-96fc-f2326bd45ebf
4   Ameiurus natalis otu_0a683c9a-73c3-4940-93d0-57a69eab9139
5 Ameiurus nebulosus otu_5b58a539-5ade-4846-94e8-4a858b32b03b
  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      Pylodictis olivaris http://purl.obolibrary.org/obo/VTO_0036282
2        Ictalurus dugesii http://purl.obolibrary.org/obo/VTO_0061497
3   Ameiurus platycephalus http://purl.obolibrary.org/obo/VTO_0036276
4           Ameiurus catus http://purl.obolibrary.org/obo/VTO_0036275
5      Ictalurus punctatus http://purl.obolibrary.org/obo/VTO_0036225
6         Ameiurus natalis http://purl.obolibrary.org/obo/VTO_0036274
7           Ameiurus melas http://purl.obolibrary.org/obo/VTO_0036272
8         Satan eurystomus http://purl.obolibrary.org/obo/VTO_0061485
9      Ictalurus mexicanus http://purl.obolibrary.org/obo/VTO_0061498
10      Ictalurus furcatus http://purl.obolibrary.org/obo/VTO_0036223
11 Trogloglanis pattersoni http://purl.obolibrary.org/obo/VTO_0061501
12        Ictalurus pricei http://purl.obolibrary.org/obo/VTO_0036218
13        Noturus insignis http://purl.obolibrary.org/obo/VTO_0036237
14          Noturus flavus http://purl.obolibrary.org/obo/VTO_0036263
15      Ameiurus nebulosus http://purl.obolibrary.org/obo/VTO_0036278
16       Ameiurus brunneus http://purl.obolibrary.org/obo/VTO_0036273
17  Prietella phreatophila http://purl.obolibrary.org/obo/VTO_0036265
18         Ictalurus lupus http://purl.obolibrary.org/obo/VTO_0036220
19   Ameiurus serracanthus http://purl.obolibrary.org/obo/VTO_0036277
20      Ictalurus balsanus http://purl.obolibrary.org/obo/VTO_0036221
21     Ictalurus australis http://purl.obolibrary.org/obo/VTO_0061495
22       Noturus stigmosus http://purl.obolibrary.org/obo/VTO_0036261
                                        otu
1  otu_19a15fa2-c5bc-40fd-854b-1230bcdfd5a4
2  otu_2568e29b-ef24-499b-96cc-e3cd60bf0d21
3  otu_a50af56e-84b4-42a9-b329-4aea811a8ee8
4  otu_15e92b3e-d3c6-4147-99fe-e39a8da3bcb0
5  otu_31659126-7ddf-48dd-948a-f72c01ac89b0
6  otu_0a683c9a-73c3-4940-93d0-57a69eab9139
7  otu_e4c68076-9cd7-4c51-96fc-f2326bd45ebf
8  otu_ad904d33-83c0-4d9f-84cb-8a3835b2f900
9  otu_06983030-db76-46ad-8315-e3e33deb48f2
10 otu_8c4e47a1-dd22-4b21-b125-97f934337379
11 otu_235e5df9-978c-417e-a78a-5aa08c5064dc
12 otu_c1a6adc7-e6ca-4d5f-90d0-857fa9951c4e
13 otu_121fc667-894e-43dc-a246-1d2243d53192
14 otu_279cb098-d5f8-4971-ae34-76ff0ae4b82e
15 otu_5b58a539-5ade-4846-94e8-4a858b32b03b
16 otu_ccd2f20f-5108-40bb-aaf4-e523a0cf5fa5
17 otu_877e5098-cd19-4a41-b4b0-a2fc02cc216e
18 otu_c8d7efa6-33d2-4c31-a3de-b0eff10678bd
19 otu_592f5c66-3a98-4e1c-9f4a-48936729d7d5
20 otu_0a08f993-abc7-455a-8d7e-2ea22b76c90b
21 otu_b29defd6-f8b7-4b2a-a550-6b507c2a140e
22 otu_76b10b31-5017-4f68-b557-a4bf6b117087
                                        otus
1  otus_101b87e1-9d02-4a96-b182-6053c816b979
2  otus_101b87e1-9d02-4a96-b182-6053c816b979
3  otus_101b87e1-9d02-4a96-b182-6053c816b979
4  otus_101b87e1-9d02-4a96-b182-6053c816b979
5  otus_101b87e1-9d02-4a96-b182-6053c816b979
6  otus_101b87e1-9d02-4a96-b182-6053c816b979
7  otus_101b87e1-9d02-4a96-b182-6053c816b979
8  otus_101b87e1-9d02-4a96-b182-6053c816b979
9  otus_101b87e1-9d02-4a96-b182-6053c816b979
10 otus_101b87e1-9d02-4a96-b182-6053c816b979
11 otus_101b87e1-9d02-4a96-b182-6053c816b979
12 otus_101b87e1-9d02-4a96-b182-6053c816b979
13 otus_101b87e1-9d02-4a96-b182-6053c816b979
14 otus_101b87e1-9d02-4a96-b182-6053c816b979
15 otus_101b87e1-9d02-4a96-b182-6053c816b979
16 otus_101b87e1-9d02-4a96-b182-6053c816b979
17 otus_101b87e1-9d02-4a96-b182-6053c816b979
18 otus_101b87e1-9d02-4a96-b182-6053c816b979
19 otus_101b87e1-9d02-4a96-b182-6053c816b979
20 otus_101b87e1-9d02-4a96-b182-6053c816b979
21 otus_101b87e1-9d02-4a96-b182-6053c816b979
22 otus_101b87e1-9d02-4a96-b182-6053c816b979

$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_8abc3f2b-83a2-486f-aa75-b296246d02fd
2   character_c6066f6c-9fec-4b90-a662-d58dea33a6d1
3   character_470368b3-7d27-4236-bc3d-637d19156bd4
4   character_aa441f40-8e62-4a81-bd40-65d5e5c893a8
5   character_156f0aa7-fb68-4c30-a2da-028c9026c83f
6   character_605b9c2a-c7f2-41ba-b29d-a34f55519101
7   character_b67debab-54fb-48ec-8736-bfc5e221025c
8   character_41ae4a3c-73ed-4fd3-a7b5-94a5b522de23
9   character_b4917ecc-36c6-4719-ae75-ed50e95c02dd
10  character_b2e387ff-d438-4953-9634-70ea6161d6a0
11  character_40ab3b1f-ef1b-4c54-aeae-e32cf04b5c2d
12  character_de55c231-359a-4393-9e9e-07c6bc2eca20
13  character_b10b8bc5-40ee-4868-b4c3-8794f12def07
14  character_33f85797-364f-4d59-8e10-8e3879cb3f67
15  character_7d4dd383-9f82-42a4-8bda-75f970246fb9
16  character_e48ed4b7-fd6d-4c4d-aa17-120e783fe291
17  character_b6e858a6-e803-4d3a-8c0e-be575384916c
18  character_c52b2acc-5e3f-4ca3-9a28-0e96e82ae565
19  character_9baa4619-50e3-4cd4-abf3-0cd647ea881d
20  character_1e25e0bb-dab9-44f7-a8fd-dcb2b78a6483
21  character_b2ce7d85-7bc2-4217-8726-416f0f61e8be
22  character_0c6bfd39-d577-4e82-b470-697cda0d63d5
23  character_af90b99f-7135-47ad-ac93-71da88e6789f
24  character_f57433a9-4d75-4a54-a1d9-35e9f3e702b0
25  character_648e430d-347e-43a8-a305-72fa08b25887
26  character_155650f7-53d3-4f02-803d-30771a85fab1
27  character_82ba2d3d-cb94-494a-a1fb-7ad01ab97103
28  character_13346d94-f475-4211-9fe5-af54b3af8074
29  character_cc15d590-814f-40b6-b635-9543f702d73e
30  character_1706224a-1643-4337-a9e2-4d98954a3ac0
31  character_428f38b6-8530-4d43-9915-10e34995e57e
32  character_e466230d-0f76-4c52-88c8-89d45cf63bfd
33  character_4dd52535-17b3-4227-a7d5-262c6887714d
34  character_98253662-afbd-4117-b6c4-beb19e2c62c5
35  character_8f9dc7f7-87e7-4f8d-8dad-09cc192b3085
36  character_5ee48254-49ea-4f41-b54e-2a4388c4e9fb
37  character_93dfe118-9336-48ac-8652-cdaa8fda8805
38  character_8cd37acf-9ebf-454c-87f9-f6373cfc2272
39  character_0cb7e80b-e886-4505-8242-8e834517635f
40  character_3b9ebf96-be37-4e81-b6e3-28fa7ff82294
41  character_cf941b15-f554-45e8-a5a0-d6963e6e69d9
42  character_91fea616-d623-413b-9522-35e344ddbb1f
43  character_7b4ddd37-bd90-4477-9a26-3f332e3e703e
44  character_7209e965-3474-4dcf-8dd5-5282288c79a7
45  character_5cf00431-dbcd-4fa2-97c8-9b9aa1393795
46  character_d71a89f9-c46e-472b-89d8-3ee5d6ee0064
47  character_8da6b504-76f5-472c-b55a-7dc9c4efbe58
48  character_eba2640e-22e0-4806-88cd-b82e3cdc16cf
49  character_94ee3880-e2b5-4ecc-9d74-c0b21c6a08c7
50  character_3e418dad-e0ec-40e2-b120-efbd83477c0b
51  character_08393f73-2f46-4edb-a79d-e09c5830d096
52  character_90254ac9-fb91-46dd-a5d0-6043a9b670c8
53  character_575472b1-170b-4ace-8bdf-03772d03f7bc
54  character_35a9a141-a3ff-4d54-9168-52a2b262966d
55  character_d8128057-991f-43a5-bf28-72f7bc56c09f
56  character_3322a3a8-185e-478d-ae69-89a66c6eb49f
57  character_3fcd3a5e-0b45-48ee-9c97-811ef74717fb
58  character_99ba81a7-6c4c-414e-86cf-394a285831a5
59  character_fed72a8f-ccc5-4550-981a-b761eb8ed6a7
60  character_ce397fd7-2ac5-489f-998a-bc1188e315e7
61  character_0f53db03-dc2e-4517-94ca-e2f160602488
62  character_e0bc79a3-2eed-4a93-9bfb-bfe97ff835b3
63  character_58c43aec-0f31-4dab-ba90-e774f648bdda
64  character_5e6a08fb-6893-4b97-b747-452ee333bfa2
65  character_80037f33-814c-4b00-bc4d-883ed3354f1e
66  character_3b81d5b4-b3f6-4fe0-8a43-e93d630dc314
67  character_083c88a8-789e-4abb-bc64-129d9d6089e7
68  character_c24d6058-78d6-4bf2-8c77-403ef16fe07c
69  character_33948036-789c-4bb3-a8d7-251138f601f0
70  character_6fd7a0a6-73ff-40d3-bf73-fa6c1dcea6aa
71  character_6b4d1014-9cc3-4311-b8de-62d9150d1b7d
72  character_95d12787-da89-4d47-9148-1514c7dc8a2e
73  character_8aa867fd-20d3-4fe7-ab6d-4cb195c4a99c
74  character_1c9b5698-9452-4ed1-a379-9a6462dc1751
75  character_8f42dd63-67b3-4cd5-b6f0-0929be140b2c
76  character_66bd6a35-0299-4176-96b9-ed8e5a436fcf
77  character_fbe07794-ddb7-4628-9120-967e9a5c9ebc
78  character_46e7dbbd-b92c-45fc-bc58-122eac22f16b
79  character_456f847b-6a7f-42cc-ae06-0b4caebc1662
80  character_83e9687c-ec08-4b13-b9b2-a23d69c8e4d9
81  character_e6d1519f-f3fa-4064-9f8f-fd8d892e032a
82  character_f928b9f2-94c0-4a12-9f89-8c2f1394d211
83  character_88f59ec4-40e2-4aee-940b-29c55a020b73
84  character_da563edf-8ce3-4bc0-9fd8-273922c2c37b
85  character_3cba12ae-845d-4e12-9431-00ec345f795b
86  character_cb902e45-d1d4-43ee-9a52-202a6c6ac433
87  character_a4fa0a7e-ce7a-4b77-a536-5c4c95162799
88  character_215f538b-fed6-441f-b05b-e4d8171e6cae
89  character_82c0b4af-1990-4732-b3ec-c95031fad723
90  character_698f501c-24aa-4efc-be97-14b2dd189235
91  character_e5455037-802b-4596-b2fd-9f63471b372f
92  character_7c76e859-e4d2-4c5f-bd83-c10f01d569de
93  character_d2ec5983-16ee-4636-aa8e-e9f337fe9562
94  character_2edd728a-89ec-4777-97e3-c35431946276
95  character_a6baa99f-596f-4dfb-87da-3b3670d1cdc1
96  character_4071039e-dca0-4ada-ae9f-68e389187bcc
97  character_ae2bb157-151c-46c9-90f4-f65f0b1ffd9a
98  character_51eb02b1-ec3e-4ac2-ae49-521403189992
99  character_b955426e-a081-4f64-8a37-66723f33f1f2
100 character_636eb2c3-d56a-45da-b277-98fd753834dd
101 character_f5853183-6b57-461c-85a3-5e73d2a2199e
102 character_c0c475cd-5ecd-4350-adfb-054695732a0a
103 character_01a55487-24cb-4b0d-81bd-004fba3e0f32
104 character_f032a1fa-2016-4f4c-82e4-0a400ff974d4
105 character_3ef454ec-8480-48cd-bd9d-e317c1f8ad16
106 character_ded2eac3-030d-425c-a74b-508ab00a9a00
107 character_f4af4e04-eccb-4988-8f61-cf2e30ab5e5b
108 character_33185764-72bc-4fdb-8e95-1173d95a1b36
109 character_7c180515-3106-4659-9a09-0b9dd9875039
110 character_9bf091cd-df04-4e8d-a76d-f6a599c8e160
111 character_279a05b4-9ce6-453f-bac0-fee7b0cb0b95
112 character_5071775d-5c7c-4b67-bed5-ad519c0bfbe2
113 character_6dded58a-1686-4297-8471-9e7213b18bf9
114 character_88aad1d9-d246-4e8c-9e3f-d1fd857fb331
115 character_07e5b9da-66f3-4aa7-8303-fbdc66f8376d

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
1       Ameiurus brunneus VTO_0036273
2          Ameiurus catus VTO_0036275
3          Ameiurus melas VTO_0036272
4        Ameiurus natalis VTO_0036274
5      Ameiurus nebulosus VTO_0036278
6  Ameiurus platycephalus VTO_0036276
7   Ameiurus serracanthus VTO_0036277
8     Ictalurus australis VTO_0061495
9      Ictalurus balsanus VTO_0036221
10      Ictalurus dugesii VTO_0061497
11     Ictalurus furcatus VTO_0036223
12        Ictalurus lupus VTO_0036220
13    Ictalurus mexicanus VTO_0061498
14       Ictalurus pricei VTO_0036218
15    Ictalurus punctatus VTO_0036225
                                    otus
1  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
2  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
3  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
4  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
5  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
6  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
7  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
8  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
9  t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
10 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
11 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
12 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
13 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
14 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
15 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
   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
[12]  TRUE  TRUE  TRUE  TRUE
m[is_desc, ] #subsetting to the descendants of Ictalurus
                  taxa         otu                                  otus
8  Ictalurus australis VTO_0061495 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
9   Ictalurus balsanus VTO_0036221 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
10   Ictalurus dugesii VTO_0061497 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
11  Ictalurus furcatus VTO_0036223 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
12     Ictalurus lupus VTO_0036220 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
13 Ictalurus mexicanus VTO_0061498 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
14    Ictalurus pricei VTO_0036218 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
15 Ictalurus punctatus VTO_0036225 t0b40ca14-cbe5-4ed2-bebc-56530c55b3e0
   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