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

Getting Started

The development version of rphenoscape is available on Github. With the devtools package installed on your system, rphenoscape can be installed using:

devtools::install_github("phenoscape/rphenoscape", build_opts=c("--no-manual"))
library(rphenoscape)

The option build_opts ensures that the vignettes will be built and installed as well. This will require a recent version of the knitr and rmarkdown packages. You can install these beforehand, or include the option dependencies=TRUE. The latter will also install packages otherwise only needed for testing and for generating the help pages, which, if you don’t develop packages yourself, may be much more than you need.

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")

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

(m <- pk_get_ontotrace(nex))
# A tibble: 15 x 5
   taxa      otu     otus       `anterior dentation… `anterior distal serr…
   <chr>     <chr>   <chr>                     <int> <chr>                 
 1 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 2 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 3 Ameiurus… VTO_00… t7b0e90eb…                   NA 1 and 0               
 4 Ameiurus… VTO_00… t7b0e90eb…                   NA 1                     
 5 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 6 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 7 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 8 Ictaluru… VTO_00… t7b0e90eb…                    1 1                     
 9 Ictaluru… VTO_00… t7b0e90eb…                    0 1 and 0               
10 Ictaluru… VTO_00… t7b0e90eb…                   NA 1                     
11 Ictaluru… VTO_00… t7b0e90eb…                    0 1                     
12 Ictaluru… VTO_00… t7b0e90eb…                    1 1                     
13 Ictaluru… VTO_00… t7b0e90eb…                   NA 1                     
14 Ictaluru… VTO_00… t7b0e90eb…                    1 1                     
15 Ictaluru… VTO_00… t7b0e90eb…                    1 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 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
2  VTO_0036220 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
3  VTO_0036275 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
4  VTO_0036276 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
5  VTO_0036278 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
6  VTO_0061495 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
7  VTO_0036218 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
8  VTO_0036225 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
9  VTO_0036277 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
10 VTO_0036272 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
11 VTO_0036274 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
12 VTO_0036223 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
13 VTO_0036273 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
14 VTO_0036221 t7b0e90eb-b87e-457a-bf40-475fa2d3c748
15 VTO_0061497 t7b0e90eb-b87e-457a-bf40-475fa2d3c748

$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"))
# A tibble: 1 x 2
  id                                                           label       
  <chr>                                                        <chr>       
1 https://scholar.google.com/scholar?q=The+Phylogeny+of+Ictal… Lundberg (1…

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 blocks, where: 
     block 1 contains NULL phylogenetic trees
     block 0 contains  phylogenetic trees 
     395 meta elements 
     1 character matrices 
     22 taxonomic units 
 Taxa:   Pylodictis olivaris, Ictalurus dugesii, Ameiurus platycephalus, Ameiurus catus, Ictalurus punctatus, Ameiurus natalis ... 

 NeXML generated by RNeXML using schema version: 0.9 
 size: 6.6 Mb 

From the list of ReXML 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_1cfc1481-fc6b-4e13-91d1-e62e446706b6
2     Ameiurus catus otu_f776d056-bce2-4787-992f-22179b01b62c
3     Ameiurus melas otu_2a650f46-51a8-403e-af68-4bc89343aae1
4   Ameiurus natalis otu_7b240e39-09d8-49c8-bff3-7640fe2f762a
5 Ameiurus nebulosus otu_4756f1c5-e393-4d90-8fc9-c4bdb01d479c
  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_a8add20f-a3e1-44c5-bd8d-11187fdc35bc
2  otu_1fd9ac90-3104-4bdd-8a42-5ab89363eb84
3  otu_16a8caa1-db78-41bf-be7a-0c5c073d9483
4  otu_f776d056-bce2-4787-992f-22179b01b62c
5  otu_02c5a900-d347-438e-b27f-55234fe4653a
6  otu_7b240e39-09d8-49c8-bff3-7640fe2f762a
7  otu_2a650f46-51a8-403e-af68-4bc89343aae1
8  otu_87ce4308-4423-4591-a512-16a2fd215b89
9  otu_11668cef-8639-4020-b0dc-e6171bbdb8f0
10 otu_8b2e5b65-d100-4414-b034-d1153f581579
11 otu_db1a518f-6d04-4490-b2e3-a2c53afaec10
12 otu_7cacf400-deaa-4226-b14a-09759a4cbcac
13 otu_fd8d2767-6042-4ef1-8aa6-3086fcb0273a
14 otu_271d952c-4b75-4efb-b518-13b10ff783ba
15 otu_4756f1c5-e393-4d90-8fc9-c4bdb01d479c
16 otu_1cfc1481-fc6b-4e13-91d1-e62e446706b6
17 otu_a3f63017-5112-481b-944f-653b40299418
18 otu_51157631-dddd-4579-b403-31689846dea6
19 otu_78eebaff-9877-405f-be5b-43d79d864910
20 otu_b177299e-71c8-4ad1-9795-c146b6fdc66e
21 otu_58f4bbf7-3665-43a3-bc14-8981930d9856
22 otu_6155d164-426a-4316-ab59-94ee6c29c9cd
                                        otus
1  otus_cb805c57-7141-490c-b434-3e9e7fed0301
2  otus_cb805c57-7141-490c-b434-3e9e7fed0301
3  otus_cb805c57-7141-490c-b434-3e9e7fed0301
4  otus_cb805c57-7141-490c-b434-3e9e7fed0301
5  otus_cb805c57-7141-490c-b434-3e9e7fed0301
6  otus_cb805c57-7141-490c-b434-3e9e7fed0301
7  otus_cb805c57-7141-490c-b434-3e9e7fed0301
8  otus_cb805c57-7141-490c-b434-3e9e7fed0301
9  otus_cb805c57-7141-490c-b434-3e9e7fed0301
10 otus_cb805c57-7141-490c-b434-3e9e7fed0301
11 otus_cb805c57-7141-490c-b434-3e9e7fed0301
12 otus_cb805c57-7141-490c-b434-3e9e7fed0301
13 otus_cb805c57-7141-490c-b434-3e9e7fed0301
14 otus_cb805c57-7141-490c-b434-3e9e7fed0301
15 otus_cb805c57-7141-490c-b434-3e9e7fed0301
16 otus_cb805c57-7141-490c-b434-3e9e7fed0301
17 otus_cb805c57-7141-490c-b434-3e9e7fed0301
18 otus_cb805c57-7141-490c-b434-3e9e7fed0301
19 otus_cb805c57-7141-490c-b434-3e9e7fed0301
20 otus_cb805c57-7141-490c-b434-3e9e7fed0301
21 otus_cb805c57-7141-490c-b434-3e9e7fed0301
22 otus_cb805c57-7141-490c-b434-3e9e7fed0301

$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_283db437-8d56-44b8-a596-42b99239c32e
2   character_b91b5d5f-eed7-43ad-8d8b-96ac5a6b7144
3   character_9f9f4904-dfcc-400c-99a0-8a48f20371f4
4   character_6069b983-c546-49e0-84af-ec461e3da6ee
5   character_8073bff7-05e6-4f36-acfc-1a33e02ac82e
6   character_43622a4a-5ace-4f58-b4c0-85cfc7b8baff
7   character_9b42dfeb-e197-4a1f-84b5-c5cf050d2a11
8   character_3a3446f0-bf7b-4be7-832e-b16ab086a8f8
9   character_eab56ecd-3a8a-4abe-b885-5b22efd14d2a
10  character_9af83515-86cc-4a6d-a0f8-3424cdecc700
11  character_02c93f97-cdb5-4c88-816a-b03cc664e7ca
12  character_af276a23-d4b1-4346-97ab-356256106f8b
13  character_a0306e74-befb-4ad1-9a7a-172a535bc8ae
14  character_3ef3ea8d-7c5f-4d7e-85f0-b77b7b610571
15  character_df13f192-3362-404c-aefc-ec5fbefea85a
16  character_4f268d0d-f123-4a95-8402-cb887686feb7
17  character_e1324ef3-dc4b-4aa7-982b-4635e4eadf50
18  character_fc47e3ea-949d-4cf7-81cd-bf7d77bdae28
19  character_41d879af-9e6f-4939-8069-a8f2f30b098b
20  character_b279b9c9-13a6-4136-bb91-f1e1a9cd740c
21  character_6ce8f2f0-ffc4-4009-9898-d0b5875b4acd
22  character_d2ae8381-a0ed-4b8b-bea3-f0852bce9d89
23  character_5e75c0b2-a5d2-44fd-95ad-4b4f3fc59a95
24  character_35f60780-40f7-4945-b550-50a62c8b9469
25  character_922ae1fc-0697-427c-81fc-cccf92ed9f57
26  character_536c5431-c1bc-432a-badf-7541ef55f8d8
27  character_9675ed29-9e55-4a53-ae54-6ea9f515cece
28  character_0e16d5c6-98a7-4723-bb2f-c6ebdb8cee91
29  character_0933ef05-bcac-4367-83dc-458931bbcac6
30  character_9ba8c437-4adc-4139-bf92-b8ddf87a43da
31  character_dd1c6f7f-15d0-4587-b6b7-df14713a56fa
32  character_b69e8688-19e0-44d3-8456-1c14721e0c79
33  character_5b6b9aba-58c1-405b-abc6-d50741a16e50
34  character_46198d03-887d-46e5-95fa-68951513a174
35  character_baef9ead-381f-4174-891c-74353c95553f
36  character_c07b462a-d547-403c-a334-eb8438593b4c
37  character_97786771-9cd4-4407-8df3-c1bcecbc30fc
38  character_5b4bc6db-f7cf-4b29-9b73-223defe7a190
39  character_cce5e400-cb0f-4cf9-bccc-7f2d79fc608e
40  character_96746579-60ec-4f08-86dc-6f728e87921a
41  character_2c3c2160-83b4-4af1-a9cc-20178422f66e
42  character_ecdd1160-208e-4cab-9bfa-fb89ca4bbb33
43  character_28b07d91-5bb7-4862-8838-d06750e524b7
44  character_2c1372b5-879f-4c60-b074-a3fef64d4fc4
45  character_562f9d2b-d43a-4da3-8fb1-54542f8d5471
46  character_01c96c88-4f7b-4dfc-9470-6221dc5aac87
47  character_f73f6436-2e21-4330-94c8-bc4258a200e3
48  character_a5dfc1e9-5215-4c53-ad57-5b152909bcef
49  character_ad89340b-4446-4d25-a3f5-d495926ec900
50  character_28812ce0-44e6-466b-a364-e81561e1f5dd
51  character_4baa5bc4-97d8-4f79-8d82-56de97bf83e5
52  character_db2bfdf4-69fc-4c42-a3b0-31fc9d3ef027
53  character_0723ab03-3eac-4544-a6a1-844b04aea5cc
54  character_d8543441-0c60-4f0c-99e9-af8569b8e6be
55  character_f9b9dfae-dd6c-43cb-887f-974de2e11cb3
56  character_c71bce3a-a5a9-4ff9-bd57-bc4c68751822
57  character_83c9b858-d656-430a-b83b-14026640c2a9
58  character_f85cb795-a975-4b80-953a-ca272493ad95
59  character_31cf273d-7cf4-4b9e-ae07-7259dec2ffe3
60  character_402e1033-51aa-48e4-a6be-1a5f7eb58985
61  character_ead19015-6ef0-4ac3-8c24-b92aba4d9cbf
62  character_e9320cf3-f5fb-4291-943d-4a8b0af5dc74
63  character_98cf6fb2-38c6-42b0-8290-59b5ab0c2572
64  character_e92ae675-6326-43e4-8fac-b73085264b7d
65  character_323f4b00-69bc-48e1-b1db-0a308b2b1ff7
66  character_93ed607b-afe8-4010-8c62-8ee19249d7fc
67  character_fe24fd93-017d-4960-9677-04a9ac4437bd
68  character_d1ad4664-3feb-4229-b261-5332b109b7d3
69  character_edc80aa2-7229-4339-b555-4d5e655cb363
70  character_01789030-85a8-420b-b5ee-db1329b7d5ff
71  character_0dbaf93d-0d83-4318-9fa0-133938ab7f35
72  character_cf1a1f73-fa05-463e-a21b-6019304978d6
73  character_24739ee7-8f93-479b-ad5f-45d440c769d6
74  character_1915acfb-a284-4ed5-9769-630195d0e43b
75  character_886ed683-773d-410c-a618-d935e91a6711
76  character_7c7da27c-a71f-4b39-ae0e-69733f3fbf53
77  character_f9e659de-b58a-4d24-8ef1-9f20cc472c42
78  character_3ef1f90a-a5ad-484d-b273-6c5d6f049780
79  character_8dd836d1-31be-4289-a1b0-4c096578293d
80  character_284aa414-5096-4d44-a76e-c38b83adfa53
81  character_bf0859d6-9e4f-4f23-bce4-7aa20352555f
82  character_0cd0a11e-8f5e-4cd7-80ba-10b7ba5cbbfa
83  character_464b7382-465e-4b05-b8a9-865b7b92fae1
84  character_7e9e06d3-df02-4d30-909b-757c89308c65
85  character_f86197af-5ff6-4a34-9561-f1279dd36c05
86  character_e90f32d5-55e1-4687-b3f7-115ced8b083d
87  character_66cd1f93-57e8-4358-91d0-05a1b89ec92f
88  character_7f7a7e1f-16c9-4e41-96ed-b2ca4e63b420
89  character_3eac12ed-143a-4fa9-9979-01b19d7233af
90  character_e7159705-2373-4c23-a576-eb3682da33ee
91  character_c14d14f4-4ac7-4c17-b4e2-130fd088cf6a
92  character_4c39f249-6128-487c-b0ba-f6f9a3f9b80d
93  character_35fa060a-a491-4064-8af7-dbd246cd56bc
94  character_defe8f2d-9f60-41e9-86d5-9a5cf405bc06
95  character_3f3b8d8a-ddc5-47ac-b0af-c8b41cfcbae9
96  character_071743bf-0430-46d3-bc83-bc50ab392952
97  character_a23a271b-c059-4024-a3de-cac0e167c14f
98  character_6eb2534f-e4c1-432e-b401-98c9d120aeab
99  character_90852c89-9473-41ca-b9d4-22a9a756b6e8
100 character_64348d8b-d185-46c1-96e5-c1306d14f8a7
101 character_5126d2be-51bc-4682-8285-ab9619c8961f
102 character_a5fba793-6323-42ce-b7a2-8ea4d3babdfe
103 character_3d21c870-3b53-401c-b1b1-da599d6b428f
104 character_6603a42f-1860-4c5a-8693-92fa7aa818f1
105 character_a2659d07-0fc2-46b5-95c1-efa71cae7aec
106 character_02a1743e-3486-44fd-825d-a3b1cff7385d
107 character_4d47ad57-b66f-47e4-ad07-1259ac1d2d06
108 character_c47cf090-7160-4695-b4c3-f5e9da64d602
109 character_41f116b7-3c97-4eed-b709-974945088679
110 character_779c5d66-6793-4edb-a1e4-49290fbf3b06
111 character_0991e0e5-a495-4b13-ab08-efa3f7366e9b
112 character_9c684d77-dea0-4d6c-9ada-9605aff315a8
113 character_3b54569b-cf5a-495f-9ff4-1c8ba00aaf12
114 character_72138bb3-1444-4330-ae4b-9a858d09626f
115 character_3c94600b-e6ed-4553-b499-76dcae82a8af

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
# A tibble: 15 x 5
   taxa      otu     otus       `anterior dentation… `anterior distal serr…
   <chr>     <chr>   <chr>                     <int> <chr>                 
 1 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 2 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 3 Ameiurus… VTO_00… t7b0e90eb…                   NA 1 and 0               
 4 Ameiurus… VTO_00… t7b0e90eb…                   NA 1                     
 5 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 6 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 7 Ameiurus… VTO_00… t7b0e90eb…                    1 1                     
 8 Ictaluru… VTO_00… t7b0e90eb…                    1 1                     
 9 Ictaluru… VTO_00… t7b0e90eb…                    0 1 and 0               
10 Ictaluru… VTO_00… t7b0e90eb…                   NA 1                     
11 Ictaluru… VTO_00… t7b0e90eb…                    0 1                     
12 Ictaluru… VTO_00… t7b0e90eb…                    1 1                     
13 Ictaluru… VTO_00… t7b0e90eb…                   NA 1                     
14 Ictaluru… VTO_00… t7b0e90eb…                    1 1                     
15 Ictaluru… VTO_00… t7b0e90eb…                    1 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
# A tibble: 8 x 5
  taxa     otu     otus        `anterior dentation … `anterior distal serr…
  <chr>    <chr>   <chr>                       <int> <chr>                 
1 Ictalur… VTO_00… t7b0e90eb-…                     1 1                     
2 Ictalur… VTO_00… t7b0e90eb-…                     0 1 and 0               
3 Ictalur… VTO_00… t7b0e90eb-…                    NA 1                     
4 Ictalur… VTO_00… t7b0e90eb-…                     0 1                     
5 Ictalur… VTO_00… t7b0e90eb-…                     1 1                     
6 Ictalur… VTO_00… t7b0e90eb-…                    NA 1                     
7 Ictalur… VTO_00… t7b0e90eb-…                     1 1                     
8 Ictalur… VTO_00… t7b0e90eb-…                     1 1