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… t28b77afb…                    1 1                     
 2 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 3 Ameiurus… VTO_00… t28b77afb…                   NA 1 and 0               
 4 Ameiurus… VTO_00… t28b77afb…                   NA 1                     
 5 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 6 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 7 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 8 Ictaluru… VTO_00… t28b77afb…                    1 1                     
 9 Ictaluru… VTO_00… t28b77afb…                    0 1 and 0               
10 Ictaluru… VTO_00… t28b77afb…                   NA 1                     
11 Ictaluru… VTO_00… t28b77afb…                    0 1                     
12 Ictaluru… VTO_00… t28b77afb…                    1 1                     
13 Ictaluru… VTO_00… t28b77afb…                   NA 1                     
14 Ictaluru… VTO_00… t28b77afb…                    1 1                     
15 Ictaluru… VTO_00… t28b77afb…                    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 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
2  VTO_0036220 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
3  VTO_0036275 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
4  VTO_0036276 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
5  VTO_0036278 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
6  VTO_0061495 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
7  VTO_0036218 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
8  VTO_0036225 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
9  VTO_0036277 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
10 VTO_0036272 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
11 VTO_0036274 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
12 VTO_0036223 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
13 VTO_0036273 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
14 VTO_0036221 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703
15 VTO_0061497 t28b77afb-81ce-4c6f-8650-bd3fa9fbc703

$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 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_29f2fd86-874a-458c-80ca-9d0e04955d58
2     Ameiurus catus otu_e096580b-7378-411d-9b9d-a49b68f67593
3     Ameiurus melas otu_91ff28b2-856f-4933-9ba0-74620aa4afdb
4   Ameiurus natalis otu_c74af1b7-bf68-4196-a588-7f48f828a433
5 Ameiurus nebulosus otu_23bb26df-ab1e-4d45-b661-afc6fc9b8acd
  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_527afbc4-1c4d-4b16-a477-8dd1475bef81
2  otu_d276b076-0aef-4edd-b077-50acd0d0341e
3  otu_f8bf30ca-c603-4d2d-8fc9-1f1e9f1550fd
4  otu_e096580b-7378-411d-9b9d-a49b68f67593
5  otu_f68fb3d2-b473-4483-99b7-9f0172c05657
6  otu_c74af1b7-bf68-4196-a588-7f48f828a433
7  otu_91ff28b2-856f-4933-9ba0-74620aa4afdb
8  otu_b4dae523-ef5b-4acc-a9a3-227e519a0410
9  otu_2822a683-52c6-4319-9fce-b6664b3762a4
10 otu_e024e99b-f6ba-496e-8395-d2b77c5b10d0
11 otu_182ba9d2-21fb-4997-af35-3d976fea3fd4
12 otu_7ea5a183-6479-4af4-9ce4-85a8c00f5e9e
13 otu_63bbd778-f006-4dde-bd39-23454052fca1
14 otu_7b0d3894-dd69-4861-b42f-55c9e13f6c00
15 otu_23bb26df-ab1e-4d45-b661-afc6fc9b8acd
16 otu_29f2fd86-874a-458c-80ca-9d0e04955d58
17 otu_ed6cba28-6e9c-4172-b1e6-a26cf396eb90
18 otu_bd6e27f4-8c22-49b0-892b-8159a6b81e92
19 otu_60219dc9-ca5a-4c85-8fe9-5066bb2bb1f6
20 otu_f50fbadc-a0c5-4f56-b2a5-85af0dda98f4
21 otu_f2bc1a27-c134-4ccd-8571-157224fd506c
22 otu_f6af7876-e19f-4cbf-8cdb-6e4549296186
                                        otus
1  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
2  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
3  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
4  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
5  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
6  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
7  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
8  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
9  otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
10 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
11 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
12 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
13 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
14 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
15 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
16 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
17 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
18 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
19 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
20 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
21 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc
22 otus_7c4b4f69-4ee0-4631-9d4d-7142ccc7bafc

$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_995a79be-6502-4658-bb92-4d77ded46d6a
2   character_6ef6910f-36a2-49d7-b81b-311ff62aa9b9
3   character_7b439821-74a3-4678-8984-7bd8b75a5782
4   character_26777152-d1df-4111-9008-de2329596c2e
5   character_7389839f-c75e-4109-bfbf-3050ed88ab1f
6   character_02908cfd-a4da-447c-80e8-8ee7f4975bde
7   character_e5059868-5b09-4ec8-a104-c09523febf2a
8   character_e07a2187-f4ce-4a6b-ab64-14ad58c32297
9   character_eadbfaa4-0a22-46bd-a0e8-a8829a0d4847
10  character_5e0debdf-5b29-4c31-8fe9-6e36404509ae
11  character_6daa540a-61f2-4160-8417-e582a316400e
12  character_168f5c5e-dbfa-4ebb-9169-0364b5250459
13  character_32fd6238-826c-4e63-971e-f39ad77bea2b
14  character_538f9bc2-2ac9-4548-b32a-d99262b757c8
15  character_0c5f959f-5e72-4b1b-8fec-b3765a80a7f2
16  character_516dea49-fa3e-4ff6-af46-a25fc403588b
17  character_fa883c57-357a-4230-81d5-fc990b102bbe
18  character_8fe4370d-f734-4b6a-ae19-d34dcf660bff
19  character_fecfef00-2c1c-4074-afee-133933de2504
20  character_faab1185-9fe3-47ea-9ef0-410c2b855aea
21  character_9c690014-0108-4830-8cbd-9fe24c423546
22  character_318ae77c-a72a-474a-9c79-f1b26dcbfda9
23  character_1b3c1cfd-fc11-4c19-b62f-473f8bd7a71f
24  character_85068387-87e6-45fd-b76b-e76cb901a53d
25  character_392ae656-1c2d-464a-b766-43a8853abff2
26  character_5e76b80c-4c50-4392-bd05-277888daa1c2
27  character_60fb6cdc-01fc-4d8b-9b1d-b81820e9f477
28  character_7bec138b-648f-40b4-9d46-0b8909c71fcc
29  character_d54c65ba-00d7-431b-bf41-bd591c1184a2
30  character_6fa024f5-7072-43f8-ad5c-4af1fda02938
31  character_e9202cb8-bcfc-4523-ad38-7e4d491c165b
32  character_f7a122b7-e426-4e62-a35f-ef7606a19ae7
33  character_9d8bd815-0298-4422-8954-ba704db4a580
34  character_e99b7961-a8e6-43ed-9c95-6e7dd52ab18f
35  character_d9aa5d5f-e6cf-4283-b910-620b7993fb2f
36  character_0b113861-a42a-4aae-beda-606b8fb943cc
37  character_0a08d7ec-3b3c-4f3e-a35c-35ac896fa62e
38  character_52a6943b-fa67-4c4e-a1b8-185d6ef5a9f2
39  character_534b0d2b-eabc-4751-8b5a-4273c706b826
40  character_f186c9d8-9cb2-4c89-92c9-15f2ab858ab4
41  character_02cfb910-3880-41d6-bf1d-884a8f36b5e2
42  character_3ee51d2f-2066-465c-8391-b4c0136e4d02
43  character_8dac9fbe-2d67-453b-9662-4b91a7ee4ac0
44  character_0062be98-b5ad-418c-bc82-313ba4835e2c
45  character_b5593681-aec4-45b6-a899-1e3a5d72ee8f
46  character_33f2f519-a8c3-4d34-9bae-3c9613b49a8d
47  character_c77ffc38-b570-413c-b2b4-ae99255d8652
48  character_5119c3f6-7e96-4071-8106-962aaeb56928
49  character_8f59a4d0-8a11-4114-ba52-e6815c0ec015
50  character_1fd94c7e-e164-4eef-b4e1-be2db502a4be
51  character_48ba03b9-ce0f-4986-b41d-f62f634e58fa
52  character_4ff6a74a-3922-41f1-82e8-f105a128492e
53  character_4c078366-65b2-4f8f-bc6a-de4f038efd46
54  character_af2de19e-a877-462e-8a4a-aae7ad09ea5c
55  character_aa760ef6-aaa5-4280-9c0f-2e5fc74a9a42
56  character_b618df8f-a2bb-4f90-9784-eb7f6903921e
57  character_7793e9a0-eb6c-441c-99b0-be4873bd7f82
58  character_31ac84e3-cf6f-440b-a37a-660080fd1546
59  character_9d91191e-650c-48e9-beaf-5c719beb2d35
60  character_b1533ae8-b684-40bd-bab9-035bd9d61036
61  character_5657923f-97e6-46df-ab33-22cecd99f39a
62  character_97fe145e-40e6-4db0-b00f-dedcdb749025
63  character_295eba3c-1d57-47e5-99c2-b0427b7a2e25
64  character_c3e0aa3b-a1d8-400c-a7ed-aefc1da5fc6c
65  character_f65cccf2-f3db-4e05-997f-6ea9d4457ea4
66  character_96daedff-d0d3-4aef-a183-af50a1de8f76
67  character_5373fea5-bd3d-449e-8b0a-863837cb59a9
68  character_6f39b007-f2eb-432f-9453-f11fca034142
69  character_156955e5-16c4-4471-80f4-b26576981604
70  character_0de82c2c-2e81-47a6-8be5-869447a597e7
71  character_e8e4a879-0c10-4edc-ba02-9c34e27608e4
72  character_59c364d5-21c9-4ca6-a14c-6252c177a8b0
73  character_b76cbbd7-072d-454c-b4f6-890a9a3c6a5a
74  character_36721109-5c84-4c72-a1fb-35921247a28c
75  character_befb700f-3c36-4737-91da-84fcc7782c96
76  character_37da8809-cecb-4785-b38a-8d796463481f
77  character_c7eb7ff1-9826-4faa-8516-7e04543b60bf
78  character_1f2caf2a-a623-4479-9aa9-9486033fe50c
79  character_09ac0f99-fe74-4803-8707-ae28a4db6a77
80  character_e4e819a2-80c1-4ac2-968a-afcd2091b23b
81  character_b7e1b70c-2944-4c21-8e86-fa2fc4fdd7b1
82  character_31940d58-2022-4fc3-8d6e-66ada067305e
83  character_9c876811-a281-4055-a3fb-4aa7413e8a75
84  character_f3bb10e3-94b4-4bb2-bee8-7b9d4444bcd7
85  character_78f133ea-743c-41d9-a283-37c21940d1f7
86  character_d433df1a-fcbe-4a27-ac18-e52c2eccdbd9
87  character_d437cea7-2e99-4cb0-aaae-5808b163e5b9
88  character_13be94cf-ee75-43bc-bdd7-ee8389030deb
89  character_c0ea97c2-aa26-40d2-81cb-65ce1d2d2679
90  character_90667207-2f44-4a69-9344-bf847315711c
91  character_cb14369b-eb41-4182-a667-0fb667492987
92  character_4b3053ad-259e-40e6-b878-39c3bc574f08
93  character_724bd449-24cc-4c52-8bb8-4fd42d4d305c
94  character_ab5876dd-a222-44c0-9860-28fa13222881
95  character_c9a5f1d3-887b-49a8-a305-3a973a27b892
96  character_2c10651b-cf69-4b83-a8a9-c6b3ebbfa0ed
97  character_fadd597f-3d07-4815-91b3-6ea1d63997ce
98  character_fb40d8d4-76d5-49c7-80da-531db9b4a7c4
99  character_749c9952-b552-456f-b691-b7d7778b5004
100 character_1dc63201-80a3-4e90-b269-a530e318f7c1
101 character_30a509eb-92aa-4814-8725-717583439a5e
102 character_21cef660-1ab1-4af7-ab42-022f9e41fcee
103 character_a5ae22a6-9466-4d1f-9d03-d95e0585f1a9
104 character_413a237e-5d71-4e62-95df-15295c4ee9c3
105 character_6a1e75b7-0788-4bb1-925a-a1e7f0f79b28
106 character_014d11a0-1a8c-4aa2-8e58-04d5e65469dd
107 character_8c750b14-7343-4e72-82cd-90184529de6a
108 character_8110e862-1792-45b7-ab4a-76a206c5d4aa
109 character_25cb87e9-c888-4bb8-b61b-bca505d63640
110 character_5c9c3822-dc26-4202-823c-a06de0ff6c20
111 character_536a1b50-63af-4c5f-866c-ce1ae8c69252
112 character_cf865227-007a-485c-a606-1c0e6c6bd35c
113 character_e8459a35-9451-4997-9db3-e11d065a6825
114 character_e4849f0f-3962-48e9-8676-6050a562a2e3
115 character_3bcb70d5-3402-46b5-aab1-70957b24934b

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… t28b77afb…                    1 1                     
 2 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 3 Ameiurus… VTO_00… t28b77afb…                   NA 1 and 0               
 4 Ameiurus… VTO_00… t28b77afb…                   NA 1                     
 5 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 6 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 7 Ameiurus… VTO_00… t28b77afb…                    1 1                     
 8 Ictaluru… VTO_00… t28b77afb…                    1 1                     
 9 Ictaluru… VTO_00… t28b77afb…                    0 1 and 0               
10 Ictaluru… VTO_00… t28b77afb…                   NA 1                     
11 Ictaluru… VTO_00… t28b77afb…                    0 1                     
12 Ictaluru… VTO_00… t28b77afb…                    1 1                     
13 Ictaluru… VTO_00… t28b77afb…                   NA 1                     
14 Ictaluru… VTO_00… t28b77afb…                    1 1                     
15 Ictaluru… VTO_00… t28b77afb…                    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… t28b77afb-…                     1 1                     
2 Ictalur… VTO_00… t28b77afb-…                     0 1 and 0               
3 Ictalur… VTO_00… t28b77afb-…                    NA 1                     
4 Ictalur… VTO_00… t28b77afb-…                     0 1                     
5 Ictalur… VTO_00… t28b77afb-…                     1 1                     
6 Ictalur… VTO_00… t28b77afb-…                    NA 1                     
7 Ictalur… VTO_00… t28b77afb-…                     1 1                     
8 Ictalur… VTO_00… t28b77afb-…                     1 1