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  tb955e453-1928-4fe1-92a4-14afc9cbd039
2  tb955e453-1928-4fe1-92a4-14afc9cbd039
3  tb955e453-1928-4fe1-92a4-14afc9cbd039
4  tb955e453-1928-4fe1-92a4-14afc9cbd039
5  tb955e453-1928-4fe1-92a4-14afc9cbd039
6  tb955e453-1928-4fe1-92a4-14afc9cbd039
7  tb955e453-1928-4fe1-92a4-14afc9cbd039
8  tb955e453-1928-4fe1-92a4-14afc9cbd039
9  tb955e453-1928-4fe1-92a4-14afc9cbd039
10 tb955e453-1928-4fe1-92a4-14afc9cbd039
11 tb955e453-1928-4fe1-92a4-14afc9cbd039
12 tb955e453-1928-4fe1-92a4-14afc9cbd039
13 tb955e453-1928-4fe1-92a4-14afc9cbd039
14 tb955e453-1928-4fe1-92a4-14afc9cbd039
15 tb955e453-1928-4fe1-92a4-14afc9cbd039
   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 tb955e453-1928-4fe1-92a4-14afc9cbd039
2  VTO_0036220 tb955e453-1928-4fe1-92a4-14afc9cbd039
3  VTO_0036275 tb955e453-1928-4fe1-92a4-14afc9cbd039
4  VTO_0036276 tb955e453-1928-4fe1-92a4-14afc9cbd039
5  VTO_0036278 tb955e453-1928-4fe1-92a4-14afc9cbd039
6  VTO_0061495 tb955e453-1928-4fe1-92a4-14afc9cbd039
7  VTO_0036218 tb955e453-1928-4fe1-92a4-14afc9cbd039
8  VTO_0036225 tb955e453-1928-4fe1-92a4-14afc9cbd039
9  VTO_0036277 tb955e453-1928-4fe1-92a4-14afc9cbd039
10 VTO_0036272 tb955e453-1928-4fe1-92a4-14afc9cbd039
11 VTO_0036274 tb955e453-1928-4fe1-92a4-14afc9cbd039
12 VTO_0036223 tb955e453-1928-4fe1-92a4-14afc9cbd039
13 VTO_0036273 tb955e453-1928-4fe1-92a4-14afc9cbd039
14 VTO_0036221 tb955e453-1928-4fe1-92a4-14afc9cbd039
15 VTO_0061497 tb955e453-1928-4fe1-92a4-14afc9cbd039

$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_84e7fa13-6c3f-4f51-8448-9fe7c4310c19
2     Ameiurus catus otu_1b65aadf-15b3-4949-a6f2-3d0f3ad148d9
3     Ameiurus melas otu_a1ae820b-afe8-4356-9eac-56d3d3da2cde
4   Ameiurus natalis otu_65987953-4897-4a76-b789-506a3c56010c
5 Ameiurus nebulosus otu_e95287c2-2f9d-4d6f-8145-f0c35dfe524e
  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_3e231427-90fd-45e2-8135-a5f8466b1122
2  otu_dc804578-ca4e-405d-a145-a993d3c47145
3  otu_27ce6b12-ac7f-4fca-9ab8-f9babb9933a4
4  otu_1b65aadf-15b3-4949-a6f2-3d0f3ad148d9
5  otu_87617afd-876c-4753-ae72-96c64242f640
6  otu_65987953-4897-4a76-b789-506a3c56010c
7  otu_a1ae820b-afe8-4356-9eac-56d3d3da2cde
8  otu_2aaee75d-3544-4216-bf07-713783c93419
9  otu_4f2ab68b-6227-447b-b77f-304eb3be2a98
10 otu_8cf80e0b-8086-4702-b8a4-f47d6ac778bc
11 otu_b9a4a3ff-d33e-4fea-b6b1-a8b1057f731d
12 otu_9e998429-c1f0-4c37-9431-474822978b54
13 otu_bcfcc848-266a-4a17-926f-e55ff9360cb1
14 otu_4b785a99-4227-4fe3-85f4-e26b180aa11b
15 otu_e95287c2-2f9d-4d6f-8145-f0c35dfe524e
16 otu_84e7fa13-6c3f-4f51-8448-9fe7c4310c19
17 otu_331c69d9-d057-407e-b1c0-9c7079bc1e18
18 otu_c7abb44a-8821-4a19-8efa-69aa5ad17696
19 otu_cb1069e4-c494-4918-8cb8-0d33ace0a9db
20 otu_dcbe2610-298d-4860-9cce-1f5e2c804e30
21 otu_e0e14c19-23dc-4fd2-aee2-688c1bdcf5e4
22 otu_b4406c53-750b-4b77-bb10-a50510c7eb76
                                        otus
1  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
2  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
3  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
4  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
5  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
6  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
7  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
8  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
9  otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
10 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
11 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
12 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
13 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
14 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
15 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
16 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
17 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
18 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
19 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
20 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
21 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1
22 otus_7a46a152-b2dc-43da-8ede-7c00717aa8d1

$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_d920cdae-9f32-48a8-a1b2-3292c347bdea
2   character_8c60b04d-3599-45b8-ac2d-6213ffd1eea6
3   character_4632922c-3b64-4c83-bbba-3860cb87225a
4   character_f72e505b-b1fc-4c2c-ae06-d8426a1530f1
5   character_5fe0cc3d-9743-42a3-b569-4fddac4e06a5
6   character_c27f84bc-3fb7-410c-a589-ef9939784580
7   character_0a9557e7-f8b2-4cd2-959e-b4e1abaa3658
8   character_c8951305-49c2-4b5f-a426-c90f885a7081
9   character_84ab1ab4-c3b7-427f-9385-325c3295a726
10  character_dcc6f0b8-793e-4f6b-93bc-6e95279d58ed
11  character_1a1b4eba-b89e-4ea7-89e2-374898acbcf8
12  character_efe9a8b0-c423-4eb1-9623-65b1dc10960c
13  character_7b8e9c30-1850-4c77-970a-5321ea5603a4
14  character_a25ebe1a-f0f2-4e58-9a5c-09d8d2c3267e
15  character_a3cd64cc-a606-4a89-9cd8-f7db36240225
16  character_93cc2f82-4c3b-426a-99c0-8946bb0a0b6b
17  character_ed4d9fc4-9c56-4884-b81f-8fa6cae769cc
18  character_b72cbf0e-5898-4106-9103-3849a6263589
19  character_597d8b07-1d06-4220-898a-ffc2c9b989de
20  character_92ba0661-709a-48fe-bee3-2097ecb3ecbc
21  character_adb29181-594e-4f19-882c-c78f6eea81c1
22  character_ba2f3f36-03df-440a-8202-ba297c33a5f4
23  character_19a6f759-ceeb-4ae8-8c9c-7da8c0004335
24  character_45678e5b-f657-42f1-a48a-6a05b3f4df59
25  character_8f4296cd-46e0-41ee-9a06-3b4bd1761890
26  character_63e02c84-9af0-452a-9e93-ca93eef2d253
27  character_8dcfca80-36f6-4a6a-bd0b-2433c632a106
28  character_ef500015-ccd1-4f1e-b078-03bcddb1a533
29  character_e92ec46e-692a-4049-bee9-f631064a1a5d
30  character_914b7301-3a42-466e-8dc7-1863abbde4db
31  character_4be390fd-222f-44bd-b021-862f5b8d28c0
32  character_700ed6ee-0766-47e1-baea-7995b8b77e71
33  character_615e61af-2c64-4b3c-a736-388394c2858d
34  character_d0cfd515-c0fc-4369-a4c5-5b39b3c92b1f
35  character_08dd8d85-ab7c-48f7-9158-a71a14ba5ca9
36  character_ea423458-7032-4374-9cc4-a2f68877ff10
37  character_3568d38a-eeb0-4a83-9db2-691dda792656
38  character_030dba88-2a50-4acc-a751-8a6115cf9e9b
39  character_8cb08cd0-08eb-4d08-b4f5-f86bdb243bee
40  character_c26dab86-b61c-4c71-b570-429a83bef523
41  character_fc39fca5-780e-4263-8726-871ee4286bd4
42  character_88e2b0e6-ff51-4ffd-91c8-66d56ec7322b
43  character_69d4cb39-1cf5-4235-9d3d-7d7cc3e3dd97
44  character_88fd92ac-c532-4791-858c-6d9955c97869
45  character_7d0fd671-5a35-464a-a01f-cdb161d0f787
46  character_4c04ca68-f1b2-4619-a944-08bef3f544cd
47  character_898b6b89-c9f0-4da6-bf24-66a3813e074d
48  character_94e89b09-06ee-4755-8e74-ffe101a2ba0a
49  character_1545bf79-a455-47e5-8205-e322507e2b3a
50  character_887e9342-ee35-4b5d-9bc1-3159c5c0b8f1
51  character_eb67c3b1-813d-454d-9428-804adf7d9a1f
52  character_c5d98ea0-df13-4380-9c38-278fa2300876
53  character_d3e364d4-ae34-4c75-b44c-aca7bf7a4b3a
54  character_587012e5-d6c9-47e4-be1b-270499ec76d3
55  character_81c12aa0-7f60-4d8e-9c78-ef7427c2f574
56  character_2fdd29fd-1cf9-4cf4-96d7-eb63ddbd7a5a
57  character_b2490afc-fff2-438f-88f3-dbce5a1e744e
58  character_bb028cd8-13d1-4377-9b55-debb3b7c386e
59  character_f12fe462-3ac1-4d0b-bc3b-9c20476bd332
60  character_22def188-deff-4c89-b3fb-76a99a227494
61  character_134ef394-c5de-42da-8883-5e65d41de8c0
62  character_7d4df2e0-ea1d-47d7-98c9-63fd639a2213
63  character_412202d7-f098-4870-9cd1-06b099b5b5c1
64  character_e12c7aa1-1a60-46b5-af23-509cd9440306
65  character_952c40b1-ccbf-4b80-91b8-94b536f6a1ac
66  character_7b5e86e2-160a-4ce1-87df-a376bbcfffbc
67  character_090eb7d1-ff3a-472c-a89f-956ecda1ae07
68  character_960a07a7-2eb2-4daf-bb60-e0d1363bd72b
69  character_046c1c2f-9efc-43e6-871e-95ae2a3bb7e0
70  character_52ddd25e-b7f5-4424-9ad7-10477e722d44
71  character_29be7915-ff04-4639-9059-61f72011376c
72  character_e25b3e03-bbd5-4457-af83-d23dfd0856ae
73  character_394bbd65-d74e-40cc-ab12-931463cdb311
74  character_93254627-eb48-4200-8f28-dfc08eee67ad
75  character_18bae804-becc-4b84-a576-1dbcf7036e96
76  character_81b5dcff-d025-429b-be6c-ef748678f61e
77  character_cbbd137e-028d-4fad-94b5-de7673536c8b
78  character_fa42a596-dcc8-4213-bad5-900ae5e6d11b
79  character_772fadc1-3dd4-41d5-a0b2-d67cafd88948
80  character_8577eb73-7bf7-446b-8bba-cd66e5b6e780
81  character_287f16e0-cdec-412b-b94c-d3051963732b
82  character_c298bdec-766e-44c6-8217-c821e10d3894
83  character_ad3f191c-a25d-4a48-8cde-35fd5165c792
84  character_aa1cc9d9-ad10-46cb-bbfd-1d06e15c926a
85  character_965c3260-6a7a-45f9-9447-5f76bfd2ac10
86  character_5638d41c-f9e9-4287-a823-973662605106
87  character_a42c67f0-903c-4398-892d-8a130aa76bbd
88  character_1c92cf7c-5596-42dd-8e85-a82bf2fd5917
89  character_c55cc66b-004e-42f8-ac9a-5de177507277
90  character_0143ffbd-3fb0-4feb-8f3d-84db8f4acafd
91  character_4e36f566-8eda-446d-a90a-5814fa3ab7d3
92  character_ecee7173-354c-4e1c-aacb-6bff01ab457d
93  character_cc2443b4-a9fc-40f0-a1a7-fd3de0fbf5ce
94  character_8c8b74d5-3ba4-4253-89bf-069c49555d0b
95  character_3c6e6774-d98e-4579-8d75-5310560517c5
96  character_5557ee5e-37de-486d-b388-7f627d29a2f0
97  character_daec5f36-a8c1-4b28-ad3c-835c860848d9
98  character_9fcb28b1-b9c3-4add-ae0e-a8f06de50264
99  character_49490611-0956-4786-b0dd-c7c7b4b9cc36
100 character_390682eb-6ef8-48df-8802-e638c522002e
101 character_f6ef3617-9af8-472a-bca7-792c6eb62904
102 character_a2dbf028-8bd8-4d16-9d04-99d810aaaa56
103 character_f88ae99f-57df-4b38-a7ba-1a207557e54f
104 character_32ba2598-90d3-4775-986b-a2012b08c7ba
105 character_4d3bf3bb-e5c5-40ee-b651-72a9aeff944a
106 character_11058269-417b-4e96-8b0f-b358508819cd
107 character_594d033e-6e10-4e96-9d08-5ac3702cc00c
108 character_f229df82-efa2-4b54-ba57-4c4babafa2b9
109 character_e4da4e13-69b6-4199-981f-e2bce510dc5d
110 character_6ea0d62f-8c0c-472f-a7a5-49690817a00b
111 character_67fc9729-21a7-4cbb-8f21-93bf99aaf0bc
112 character_dbdc461f-d173-4925-9aba-8f431bd01653
113 character_572d8ac8-79bc-4ee8-aead-74af4e5cf355
114 character_9ac4c029-0a3f-43a8-b554-d097081d5790
115 character_7aa93966-965c-4f2e-acbd-d71fb693598b

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  tb955e453-1928-4fe1-92a4-14afc9cbd039
2  tb955e453-1928-4fe1-92a4-14afc9cbd039
3  tb955e453-1928-4fe1-92a4-14afc9cbd039
4  tb955e453-1928-4fe1-92a4-14afc9cbd039
5  tb955e453-1928-4fe1-92a4-14afc9cbd039
6  tb955e453-1928-4fe1-92a4-14afc9cbd039
7  tb955e453-1928-4fe1-92a4-14afc9cbd039
8  tb955e453-1928-4fe1-92a4-14afc9cbd039
9  tb955e453-1928-4fe1-92a4-14afc9cbd039
10 tb955e453-1928-4fe1-92a4-14afc9cbd039
11 tb955e453-1928-4fe1-92a4-14afc9cbd039
12 tb955e453-1928-4fe1-92a4-14afc9cbd039
13 tb955e453-1928-4fe1-92a4-14afc9cbd039
14 tb955e453-1928-4fe1-92a4-14afc9cbd039
15 tb955e453-1928-4fe1-92a4-14afc9cbd039
   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 tb955e453-1928-4fe1-92a4-14afc9cbd039
9   Ictalurus balsanus VTO_0036221 tb955e453-1928-4fe1-92a4-14afc9cbd039
10   Ictalurus dugesii VTO_0061497 tb955e453-1928-4fe1-92a4-14afc9cbd039
11  Ictalurus furcatus VTO_0036223 tb955e453-1928-4fe1-92a4-14afc9cbd039
12     Ictalurus lupus VTO_0036220 tb955e453-1928-4fe1-92a4-14afc9cbd039
13 Ictalurus mexicanus VTO_0061498 tb955e453-1928-4fe1-92a4-14afc9cbd039
14    Ictalurus pricei VTO_0036218 tb955e453-1928-4fe1-92a4-14afc9cbd039
15 Ictalurus punctatus VTO_0036225 tb955e453-1928-4fe1-92a4-14afc9cbd039
   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