diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..c39eb79 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,118 @@ + + +
+ + + + +CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN “AS-IS” BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
-The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an “owner”) of an original work of authorship and/or a database (each, a “Work”).
Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works (“Commons”) that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the “Affirmer”), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
-Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (“Copyright and Related Rights”). Copyright and Related Rights include, but are not limited to, the following:
-i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
-ii. moral rights retained by the original author(s) and/or performer(s);
-iii. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work;
-iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
-v. rights protecting the extraction, dissemination, use and reuse of data in a Work;
-vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
-vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
-the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
moral rights retained by the original author(s) and/or performer(s);
publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work;
rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
rights protecting the extraction, dissemination, use and reuse of data in a Work;
database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer’s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer’s express Statement of Purpose.
Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer’s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer’s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “License”). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer’s express Statement of Purpose.
Limitations and Disclaimers.
-a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
-b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
-c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person’s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
-d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
-No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person’s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
vignettes/01_rphenoscape.Rmd
+ Source: vignettes/01_rphenoscape.Rmd
01_rphenoscape.Rmd
The desired input of many comparative studies is a matrix that includes all the data available for a set of traits and a focal taxon. Bringing similar types of trait data together across studies is notoriously difficult, but is straightforward with ontology annotations. Trait data that are tagged using similar ontology terms can be automatically called using R functions.
-This workshop uses trait data for vertebrates that has been annotated (tagged) with ontology terms. These data are accessed from the Phenoscape KB. In this lesson we use R functions to obtain and view character matrices from the KB, obtain synthetic matrices of inferred presence/absence characters, and understand the meaning and relations of ontology terms. The lesson assumes basic knowledge of R and RStudio.
+The desired input of many comparative studies is a matrix that +includes all the data available for a set of traits and a focal taxon. +Bringing similar types of trait data together across studies is +notoriously difficult, but is straightforward with ontology annotations. +Trait data that are tagged using similar ontology terms can be +automatically called using R functions.
+This workshop uses trait data for vertebrates that has been annotated +(tagged) with ontology terms. These data are accessed from the Phenoscape KB. In this lesson we +use R functions to obtain and view character matrices from the KB, +obtain synthetic matrices of inferred presence/absence characters, and +understand the meaning and relations of ontology terms. The lesson +assumes basic knowledge of R and RStudio.
You would like to understand the evolution of morphological traits in a taxonomic group, and you need a matrix to map to your (typically molecular) phylogenetic tree. You come to the Phenoscape KB to see what types of data are available across the members of your clade. In this exercise, you are an ichthyologist, interested in catfishes (Siluriformes), specifically the bullhead catfishes in the family Ictaluridae.
-You begin by querying ‘Siluriformes’ in the Phenoscape KB faceted browsing page (http://kb.phenoscape.org/#/facet). You immediately see the scope of the data:
+You would like to understand the evolution of morphological traits in +a taxonomic group, and you need a matrix to map to your (typically +molecular) phylogenetic tree. You come to the Phenoscape KB to see what +types of data are available across the members of your clade. In this +exercise, you are an ichthyologist, interested in catfishes +(Siluriformes), specifically the bullhead catfishes in the family +Ictaluridae.
+You begin by querying ‘Siluriformes’ in the Phenoscape KB faceted browsing page. You +immediately see the scope of the data:
From left to right across the top tabs, for ‘Siluriformes’:
Taxon annotations are the ontology terms tagged to original free text descriptions of phenotypes for each siluriform taxon. Click on the ‘Taxon annotations’ tab, and then the ‘Sources’ box on the right hand side of each row to see the publication source(s) and free text description of the phenotype to which each ontology annotation was tagged.
-You are specifically interested in Ictaluridae (bullhead catfishes), and you click on that family in the faceted browsing interface. Now filter using ‘fin’ as the anatomical entity under ‘Query’ and include parts (check the ‘parts’ box.)
-Download these taxa and their morphological trait data using the link provided.
-Go to the publications tab, which shows nine publications that contain fin data. Note that any of these studies, e.g., Lundberg (1992), can be entered under ‘publications’ in faceted browsing, but the original matrix cannot be downloaded.
+Taxon annotations are the ontology terms tagged to original free text +descriptions of phenotypes for each siluriform taxon. Click on the +‘Taxon annotations’ tab, and then the ‘Sources’ box on the right hand +side of each row to see the publication source(s) and free text +description of the phenotype to which each ontology annotation was +tagged.
+You are specifically interested in Ictaluridae (bullhead catfishes), +and you click on that family in the faceted browsing interface. Now +filter using ‘fin’ as the anatomical entity under ‘Query’ and include +parts (check the ‘parts’ box.)
+Download these taxa and their morphological trait data using the link +provided.
+Go to the publications tab, which shows nine publications that +contain fin data. Note that any of these studies, e.g., Lundberg (1992), +can be entered under ‘publications’ in faceted browsing, but the +original matrix cannot be downloaded.
Now we will repeat some of the above steps in R, beginning with a query for ‘Ictaluridae’ and ‘fin’ (including parts) to retrieve the list of studies that contain fin characters for this taxon.
-The RPhenoscape package provides convenient access to the Phenoscape Knowledgebase in the form of R functions returning R-native data structures. So that we don’t have to prefix every call of the package’s functions with the package name, we will first attach the package:
-library(rphenoscape)
First let’s look up information about the query terms. You can use the term detail functions pk_anatomical_detail()
, pk_taxon_detail()
, pk_phenotype_detail()
, and pk_gene_detail()
to retrieve an ontology term’s ID, label, and definition.
For example, view the details for the anatomy term “fin”:
-pk_anatomical_detail("fin")
-#> label
-#> 1 fin
-#> definition
-#> 1 An external projection of an aquatic animal as a fish used in propelling or guiding the body[BTO].
-#> id
-#> 1 http://purl.obolibrary.org/obo/UBERON_0008897
You can also use find_term()
to search the ontologies in the KB for partial name matches. For example, search for terms containing the string “pectoral fin” in the label or synonym:
find_term("pectoral fin")
-#> id
-#> 1 http://purl.obolibrary.org/obo/UBERON_0000151
-#> 2 http://purl.obolibrary.org/obo/ZFA_0001161
-#> 3 http://purl.obolibrary.org/obo/UBERON_2005316
-#> 4 http://purl.obolibrary.org/obo/UBERON_0003934
-#> 5 http://purl.obolibrary.org/obo/ZFA_0001000
-#> 6 http://purl.obolibrary.org/obo/UBERON_0003413
-#> 7 http://purl.obolibrary.org/obo/UBERON_0003372
-#> 8 http://purl.obolibrary.org/obo/UBERON_4300228
-#> 9 http://purl.obolibrary.org/obo/UBERON_0002534
-#> 10 http://purl.obolibrary.org/obo/ZFA_0000085
-#> 11 http://purl.obolibrary.org/obo/UBERON_0004710
-#> 12 http://purl.obolibrary.org/obo/UBERON_0005419
-#> 13 http://purl.obolibrary.org/obo/UBERON_4300172
-#> 14 http://purl.obolibrary.org/obo/ZFA_0000141
-#> 15 http://purl.obolibrary.org/obo/UBERON_0005729
-#> 16 http://purl.obolibrary.org/obo/UBERON_0007300
-#> 17 http://purl.obolibrary.org/obo/UBERON_0007269
-#> 18 http://purl.obolibrary.org/obo/UBERON_0010710
-#> 19 http://purl.obolibrary.org/obo/UBERON_0007302
-#> 20 http://purl.obolibrary.org/obo/UBERON_4500007
-#> 21 http://purl.obolibrary.org/obo/UBERON_4500010
-#> 22 http://purl.obolibrary.org/obo/UBERON_2001993
-#> 23 http://purl.obolibrary.org/obo/UBERON_2000544
-#> 24 http://purl.obolibrary.org/obo/UBERON_4300147
-#> 25 http://purl.obolibrary.org/obo/UBERON_2001456
-#> 26 http://purl.obolibrary.org/obo/UBERON_2005317
-#> 27 http://purl.obolibrary.org/obo/UBERON_4300261
-#> 28 http://purl.obolibrary.org/obo/ZFA_0001551
-#> 29 http://purl.obolibrary.org/obo/UBERON_4000175
-#> 30 http://purl.obolibrary.org/obo/UBERON_2001761
-#> 31 http://purl.obolibrary.org/obo/UBERON_2001762
-#> 32 http://purl.obolibrary.org/obo/UBERON_2001763
-#> 33 http://purl.obolibrary.org/obo/UBERON_2001764
-#> 34 http://purl.obolibrary.org/obo/UBERON_2001765
-#> 35 http://purl.obolibrary.org/obo/UBERON_2001766
-#> 36 http://purl.obolibrary.org/obo/UBERON_2001767
-#> 37 http://purl.obolibrary.org/obo/UBERON_2001586
-#> 38 http://purl.obolibrary.org/obo/UBERON_2201586
-#> 39 http://purl.obolibrary.org/obo/UBERON_2101586
-#> 40 http://purl.obolibrary.org/obo/UBERON_4440009
-#> 41 http://purl.obolibrary.org/obo/UBERON_2001787
-#> 42 http://purl.obolibrary.org/obo/UBERON_4300103
-#> 43 http://purl.obolibrary.org/obo/GO_0035118
-#> 44 http://purl.obolibrary.org/obo/GO_0033339
-#> 45 http://purl.obolibrary.org/obo/GO_0035138
-#> 46 http://purl.obolibrary.org/obo/ZFA_0000257
-#> 47 http://purl.obolibrary.org/obo/ZFA_0000789
-#> 48 http://purl.obolibrary.org/obo/ZFA_0005545
-#> 49 http://purl.obolibrary.org/obo/ZFA_0001588
-#> 50 http://purl.obolibrary.org/obo/ZFA_0001453
-#> 51 http://purl.obolibrary.org/obo/ZFA_0005317
-#> 52 http://purl.obolibrary.org/obo/ZFA_0005766
-#> 53 http://purl.obolibrary.org/obo/ZFA_0001586
-#> 54 http://purl.obolibrary.org/obo/ZFA_0000943
-#> label
-#> 1 pectoral fin
-#> 2 pectoral fin (zebrafish)
-#> 3 fin fold pectoral fin bud
-#> 4 mesenchyme pectoral fin
-#> 5 mesenchyme pectoral fin (zebrafish)
-#> 6 pectoral appendage bud mesenchyme
-#> 7 pectoral appendage bud ectoderm
-#> 8 pectoral fin bud mesenchyme
-#> 9 paired fin
-#> 10 apical ectodermal ridge pectoral fin bud (zebrafish)
-#> 11 pectoral appendage
-#> 12 pectoral appendage bud
-#> 13 pectoral fin bud
-#> 14 pectoral fin bud (zebrafish)
-#> 15 pectoral appendage field
-#> 16 pectoral appendage blood vessel
-#> 17 pectoral appendage musculature
-#> 18 pectoral fin skeleton
-#> 19 pectoral appendage vasculature
-#> 20 pectoral fin ray
-#> 21 unbranched pectoral fin ray
-#> 22 branched pectoral fin ray
-#> 23 pectoral fin actinotrichium
-#> 24 pectoral fin base
-#> 25 pectoral fin endoskeletal disc
-#> 26 pectoral fin fold
-#> 27 pectoral fin hook
-#> 28 pectoral fin lepidotrichium (zebrafish)
-#> 29 pectoral fin lepidotrichium
-#> 30 pectoral fin ray 1
-#> 31 pectoral fin ray 2
-#> 32 pectoral fin ray 3
-#> 33 pectoral fin ray 4
-#> 34 pectoral fin ray 5
-#> 35 pectoral fin ray 6
-#> 36 pectoral fin ray 7
-#> 37 pectoral fin radial bone
-#> 38 pectoral fin radial cartilage
-#> 39 pectoral fin radial element
-#> 40 pectoral fin radial skeleton
-#> 41 pectoral fin spine
-#> 42 rudimentary pectoral fin ray
-#> 43 embryonic pectoral fin morphogenesis
-#> 44 pectoral fin development
-#> 45 pectoral fin morphogenesis
-#> 46 pectoral fin cartilage (zebrafish)
-#> 47 mesoderm pectoral fin bud (zebrafish)
-#> 48 pectoral fin actinotrichium (zebrafish)
-#> 49 pectoral fin distal radial (zebrafish)
-#> 50 pectoral fin field (zebrafish)
-#> 51 pectoral fin fold (zebrafish)
-#> 52 pectoral fin plate fat (zebrafish)
-#> 53 pectoral fin radial (zebrafish)
-#> 54 pectoral fin skeleton (zebrafish)
-#> isDefinedBy matchType
-#> 1 http://purl.obolibrary.org/obo/uberon.owl exact
-#> 2 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 3 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 4 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 5 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 6 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 7 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 8 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 9 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 10 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 11 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 12 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 13 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 14 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 15 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 16 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 17 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 18 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 19 http://purl.obolibrary.org/obo/uberon.owl broad
-#> 20 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 21 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 22 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 23 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 24 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 25 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 26 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 27 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 28 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 29 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 30 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 31 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 32 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 33 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 34 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 35 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 36 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 37 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 38 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 39 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 40 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 41 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 42 http://purl.obolibrary.org/obo/uberon.owl partial
-#> 43 http://purl.obolibrary.org/obo/go.owl partial
-#> 44 http://purl.obolibrary.org/obo/go.owl partial
-#> 45 http://purl.obolibrary.org/obo/go.owl partial
-#> 46 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 47 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 48 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 49 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 50 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 51 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 52 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 53 http://purl.obolibrary.org/obo/zfa.owl partial
-#> 54 http://purl.obolibrary.org/obo/zfa.owl partial
There are several parameters to narrow and filter search results. For example, the parameter matchType
allows restricting to exact matches only:
find_term("pectoral fin", matchTypes = c("exact"))
-#> id label
-#> 1 http://purl.obolibrary.org/obo/UBERON_0000151 pectoral fin
-#> isDefinedBy matchType
-#> 1 http://purl.obolibrary.org/obo/uberon.owl exact
For a specific taxon, such as Siluriformes, you can view the taxon rank, term label, whether or not the taxon is extinct, its common name, and ID:
-pk_taxon_detail("Siluriformes")
-#> rank.id rank.label label
-#> 1 http://purl.obolibrary.org/obo/TAXRANK_0000003 order Siluriformes
-#> extinct common_name id
-#> 1 FALSE catfish http://purl.obolibrary.org/obo/VTO_0034991
Ontology terms are related to each other by superclass (parent) and subclass (child) relationships, among other relationships such as part_of. You can use the term classification functions pk_anatomical_class()
, pk_taxon_class()
, and pk_phenotype_class()
to view the superclass and subclass relationships for anatomy, taxonomy, or phenotypic quality terms.
For example, view the relationships for “pectoral fin”:
-pk_anatomical_class("pectoral fin")
-#> Querying the IRI for pectoral fin
-#> Retrieving classification information
-#> $label
-#> [1] "pectoral fin"
-#>
-#> $subClassOf
-#> @id label
-#> 1 http://purl.obolibrary.org/obo/UBERON_0002534 paired fin
-#> 2 http://purl.obolibrary.org/obo/UBERON_0004710 pectoral appendage
-#>
-#> $equivalentTo
-#> list()
-#>
-#> $superClassOf
-#> @id
-#> 1 http://purl.obolibrary.org/obo/UBERON_4200003
-#> 2 http://purl.obolibrary.org/obo/ZFA_0001161
-#> 3 http://purl.org/phenoscape/subclassof?value=%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000151%3E%0A+and+%28%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000050%3E+some+%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0002548%3E%29#159c0d7e-73f8-4a97-84f7-d86b51652dfc
-#> 4 http://purl.org/phenoscape/subclassof?value=%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000151%3E%0A+and+%28%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000050%3E+some+%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0002548%3E%29#0888ae16-5bb4-4cbc-8d22-425d25edf5d3
-#> 5 http://purl.org/phenoscape/subclassof?value=%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000151%3E%0A+and+%28%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000050%3E+some+%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000069%3E%29#a4bfb82c-cc6e-402a-a5b9-d0a8956df76a
-#> 6 http://purl.org/phenoscape/subclassof?value=%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000151%3E%0A+and+%28%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FBFO_0000050%3E+some+%3Chttp%3A%2F%2Fpurl.obolibrary.org%2Fobo%2FUBERON_0000069%3E%29#4ae642ac-9e5a-4a19-82d2-4e5d7e636723
-#> label
-#> 1 archipterygial fin
-#> 2 pectoral fin (zebrafish)
-#> 3 pectoral fin and (part_of some larva)
-#> 4 pectoral fin and (part_of some larva)
-#> 5 pectoral fin and (part_of some larval stage)
-#> 6 pectoral fin and (part_of some larval stage)
-#>
-#> $`@id`
-#> [1] "http://purl.obolibrary.org/obo/UBERON_0000151"
Note that because the KB integrates model organism phenotypes, the results show types of pectoral fin specific to model organisms, such as “pectoral fin (zebrafish)”.
+Now we will repeat some of the above steps in R, beginning with a +query for ‘Ictaluridae’ and ‘fin’ (including parts) to retrieve the list +of studies that contain fin characters for this taxon.
+The RPhenoscape +package provides convenient access to the Phenoscape Knowledgebase in +the form of R functions returning R-native data structures. So that we +don’t have to prefix every call of the package’s functions with the +package name, we will first attach the package:
+ +First let’s look up information about the query terms. The find_term()
+function searches the KB for terms matching a given search text, and
+will return the ID (term IRI), label, source ontology IRI, and type of
+match (e.g., exact, broad). For example, search for terms containing the
+string “fin” in the label or synonym:
+find_term("fin")
+#> id
+#> 1 http://purl.obolibrary.org/obo/UBERON_0008897
+#> 2 http://purl.obolibrary.org/obo/UBERON_0002389
+#> 3 http://purl.obolibrary.org/obo/UBERON_0009565
+#> 4 http://purl.obolibrary.org/obo/UBERON_0009552
+#> 5 http://purl.obolibrary.org/obo/ZFA_0000108
+#> 6 http://purl.obolibrary.org/obo/UBERON_2005316
+#> 7 http://purl.obolibrary.org/obo/GO_0033333
+#> 8 http://purl.obolibrary.org/obo/GO_0033334
+#> 9 http://purl.obolibrary.org/obo/GO_0031101
+#> 10 http://purl.obolibrary.org/obo/HP_0001231
+#> 11 http://purl.obolibrary.org/obo/HP_0001161
+#> 12 http://purl.obolibrary.org/obo/HP_0001187
+#> 13 http://purl.obolibrary.org/obo/HP_0001238
+#> 14 http://purl.obolibrary.org/obo/HP_0001166
+#> 15 http://purl.obolibrary.org/obo/HP_0001182
+#> 16 http://purl.obolibrary.org/obo/HP_0001817
+#> 17 http://purl.obolibrary.org/obo/HP_0001500
+#> 18 http://purl.obolibrary.org/obo/HP_0001821
+#> 19 http://purl.obolibrary.org/obo/HP_0004095
+#> 20 http://purl.obolibrary.org/obo/HP_0004097
+#> 21 http://purl.obolibrary.org/obo/HP_0002213
+#> 22 http://purl.obolibrary.org/obo/HP_0004099
+#> 23 http://purl.obolibrary.org/obo/HP_0006101
+#> 24 http://purl.obolibrary.org/obo/HP_0006107
+#> 25 http://purl.obolibrary.org/obo/HP_0001812
+#> 26 http://purl.obolibrary.org/obo/HP_0001804
+#> 27 http://purl.obolibrary.org/obo/HP_0005867
+#> 28 http://purl.obolibrary.org/obo/HP_0007477
+#> 29 http://purl.obolibrary.org/obo/HP_0009380
+#> 30 http://purl.obolibrary.org/obo/HP_0008391
+#> 31 http://purl.obolibrary.org/obo/HP_0010525
+#> 32 http://purl.obolibrary.org/obo/HP_0009700
+#> 33 http://purl.obolibrary.org/obo/HP_0009381
+#> 34 http://purl.obolibrary.org/obo/HP_0010557
+#> 35 http://purl.obolibrary.org/obo/HP_0008402
+#> 36 http://purl.obolibrary.org/obo/HP_0010554
+#> 37 http://purl.obolibrary.org/obo/HP_0025131
+#> 38 http://purl.obolibrary.org/obo/HP_0025261
+#> 39 http://purl.obolibrary.org/obo/HP_0011300
+#> 40 http://purl.obolibrary.org/obo/HP_0031090
+#> 41 http://purl.obolibrary.org/obo/HP_0030367
+#> 42 http://purl.obolibrary.org/obo/HP_0030837
+#> 43 http://purl.obolibrary.org/obo/HP_0030771
+#> 44 http://purl.obolibrary.org/obo/HP_0030033
+#> 45 http://purl.obolibrary.org/obo/HP_0030029
+#> 46 http://purl.obolibrary.org/obo/HP_0012742
+#> 47 http://purl.obolibrary.org/obo/HP_0012276
+#> 48 http://purl.obolibrary.org/obo/HP_0100759
+#> 49 http://purl.obolibrary.org/obo/HP_0034037
+#> 50 http://purl.obolibrary.org/obo/HP_0045089
+#> 51 http://purl.obolibrary.org/obo/HP_0100798
+#> 52 http://purl.obolibrary.org/obo/HP_0040019
+#> 53 http://purl.obolibrary.org/obo/HP_0100807
+#> 54 http://purl.obolibrary.org/obo/HP_0045090
+#> 55 http://purl.obolibrary.org/obo/HP_0033976
+#> 56 http://purl.obolibrary.org/obo/MP_0000561
+#> 57 http://purl.obolibrary.org/obo/MP_0000562
+#> 58 http://purl.obolibrary.org/obo/MP_0003807
+#> 59 http://purl.obolibrary.org/obo/MP_0000564
+#> 60 http://purl.obolibrary.org/obo/MP_0002544
+#> 61 http://purl.obolibrary.org/obo/MP_0006296
+#> 62 http://purl.obolibrary.org/obo/MP_0009930
+#> 63 http://purl.obolibrary.org/obo/MP_0030929
+#> 64 http://purl.obolibrary.org/obo/MP_0030930
+#> 65 http://purl.obolibrary.org/obo/UBERON_4000172
+#> 66 http://purl.obolibrary.org/obo/UBERON_4400005
+#> 67 http://purl.obolibrary.org/obo/ZFA_0001058
+#> 68 http://purl.obolibrary.org/obo/VTO_0013147
+#> 69 http://purl.obolibrary.org/obo/VTO_0003107
+#> 70 http://purl.obolibrary.org/obo/VTO_0021975
+#> 71 http://purl.obolibrary.org/obo/VTO_0018051
+#> 72 http://purl.obolibrary.org/obo/VTO_0016713
+#> 73 http://purl.obolibrary.org/obo/VTO_0015894
+#> 74 http://purl.obolibrary.org/obo/VTO_0023422
+#> 75 http://purl.obolibrary.org/obo/VTO_0023456
+#> 76 http://purl.obolibrary.org/obo/VTO_0028227
+#> 77 http://purl.obolibrary.org/obo/VTO_0023261
+#> 78 http://purl.obolibrary.org/obo/VTO_0025094
+#> 79 http://purl.obolibrary.org/obo/VTO_0023240
+#> 80 http://purl.obolibrary.org/obo/VTO_0024763
+#> 81 http://purl.obolibrary.org/obo/VTO_0029180
+#> 82 http://purl.obolibrary.org/obo/VTO_0031838
+#> 83 http://purl.obolibrary.org/obo/VTO_0059371
+#> 84 http://purl.obolibrary.org/obo/VTO_0059142
+#> 85 http://purl.obolibrary.org/obo/VTO_0063879
+#> 86 http://purl.obolibrary.org/obo/VTO_0062623
+#> 87 http://purl.obolibrary.org/obo/VTO_0073037
+#> 88 http://purl.obolibrary.org/obo/VTO_0066755
+#> 89 http://purl.obolibrary.org/obo/VTO_0069689
+#> 90 http://purl.obolibrary.org/obo/VTO_0068161
+#> 91 http://purl.obolibrary.org/obo/VTO_0073687
+#> label
+#> 1 fin
+#> 2 manual digit
+#> 3 nail of manual digit
+#> 4 distal segment of manual digit
+#> 5 fin (zebrafish)
+#> 6 fin fold pectoral fin bud
+#> 7 fin development
+#> 8 fin morphogenesis
+#> 9 fin regeneration
+#> 10 Abnormal fingernail morphology
+#> 11 Hand polydactyly
+#> 12 Hyperextensibility of the finger joints
+#> 13 Slender finger
+#> 14 Arachnodactyly
+#> 15 Tapered finger
+#> 16 Absent fingernail
+#> 17 Broad finger
+#> 18 Broad nail
+#> 19 Curved fingers
+#> 20 Deviation of finger
+#> 21 Fine hair
+#> 22 Macrodactyly
+#> 23 Finger syndactyly
+#> 24 Fingerpad telangiectases
+#> 25 Hyperconvex fingernails
+#> 26 Hypoplastic fingernail
+#> 27 4-5 metacarpal synostosis
+#> 28 Abnormal dermatoglyphics
+#> 29 Aplasia of the fingers
+#> 30 Dystrophic fingernails
+#> 31 Finger agnosia
+#> 32 Finger symphalangism
+#> 33 Short finger
+#> 34 Overlapping fingers
+#> 35 Ridged fingernail
+#> 36 Cutaneous finger syndactyly
+#> 37 Finger swelling
+#> 38 Stiff finger
+#> 39 Broad fingertip
+#> 40 Finger dactylitis
+#> 41 Finger hyperphalangy
+#> 42 Finger pain
+#> 43 Mallet finger
+#> 44 Small finger
+#> 45 Splayed fingers
+#> 46 Thin fingernail
+#> 47 Digital flexor tenosynovitis
+#> 48 Clubbing of fingers
+#> 49 Pseudo-chilblains on fingers
+#> 50 Distinctive finding
+#> 51 Fingernail dysplasia
+#> 52 Finger clinodactyly
+#> 53 Long fingers
+#> 54 Minor finding
+#> 55 Volar fingernail
+#> 56 adactyly
+#> 57 polydactyly
+#> 58 camptodactyly
+#> 59 syndactyly
+#> 60 brachydactyly
+#> 61 arachnodactyly
+#> 62 fuzzy hair
+#> 63 increased digit pigmentation
+#> 64 decreased digit pigmentation
+#> 65 lepidotrichium
+#> 66 fin ray
+#> 67 caudal fin (zebrafish)
+#> 68 Callosciurus finlaysonii
+#> 69 Limnonectes finchi
+#> 70 Agama finchi
+#> 71 Plestiodon finitimus
+#> 72 Uroplatus finiavana
+#> 73 Varanus finschi
+#> 74 Amazona finschi
+#> 75 Aratinga finschi
+#> 76 Euphonia finschi
+#> 77 Micropsitta finschii
+#> 78 Oenanthe finschii
+#> 79 Psittacula finschii
+#> 80 Pycnonotus finlaysoni
+#> 81 Stizorhina finschi
+#> 82 Francolinus finschi
+#> 83 Bunocephalus sp. (Fink and Fink 1981)
+#> 84 Cnemidocarpa finmarkiensis
+#> 85 Garra findolabium
+#> 86 Schistura finis
+#> 87 Lamprologus finalimus
+#> 88 Saurenchelys finitimus
+#> 89 Soleonasus finis
+#> 90 Theragra finnmarchica
+#> 91 Benitochromis finleyi
+#> isDefinedBy matchType
+#> 1 http://purl.obolibrary.org/obo/uberon.owl exact
+#> 2 http://purl.obolibrary.org/obo/uberon.owl broad
+#> 3 http://purl.obolibrary.org/obo/uberon.owl broad
+#> 4 http://purl.obolibrary.org/obo/uberon.owl broad
+#> 5 http://purl.obolibrary.org/obo/zfa.owl partial
+#> 6 http://purl.obolibrary.org/obo/uberon.owl partial
+#> 7 http://purl.obolibrary.org/obo/go.owl partial
+#> 8 http://purl.obolibrary.org/obo/go.owl partial
+#> 9 http://purl.obolibrary.org/obo/go.owl partial
+#> 10 http://purl.obolibrary.org/obo/hp.owl partial
+#> 11 http://purl.obolibrary.org/obo/hp.owl broad
+#> 12 http://purl.obolibrary.org/obo/hp.owl partial
+#> 13 http://purl.obolibrary.org/obo/hp.owl partial
+#> 14 http://purl.obolibrary.org/obo/hp.owl broad
+#> 15 http://purl.obolibrary.org/obo/hp.owl partial
+#> 16 http://purl.obolibrary.org/obo/hp.owl partial
+#> 17 http://purl.obolibrary.org/obo/hp.owl partial
+#> 18 http://purl.obolibrary.org/obo/hp.owl broad
+#> 19 http://purl.obolibrary.org/obo/hp.owl partial
+#> 20 http://purl.obolibrary.org/obo/hp.owl partial
+#> 21 http://purl.obolibrary.org/obo/hp.owl partial
+#> 22 http://purl.obolibrary.org/obo/hp.owl broad
+#> 23 http://purl.obolibrary.org/obo/hp.owl partial
+#> 24 http://purl.obolibrary.org/obo/hp.owl partial
+#> 25 http://purl.obolibrary.org/obo/hp.owl partial
+#> 26 http://purl.obolibrary.org/obo/hp.owl partial
+#> 27 http://purl.obolibrary.org/obo/hp.owl broad
+#> 28 http://purl.obolibrary.org/obo/hp.owl broad
+#> 29 http://purl.obolibrary.org/obo/hp.owl partial
+#> 30 http://purl.obolibrary.org/obo/hp.owl partial
+#> 31 http://purl.obolibrary.org/obo/hp.owl partial
+#> 32 http://purl.obolibrary.org/obo/hp.owl partial
+#> 33 http://purl.obolibrary.org/obo/hp.owl partial
+#> 34 http://purl.obolibrary.org/obo/hp.owl partial
+#> 35 http://purl.obolibrary.org/obo/hp.owl partial
+#> 36 http://purl.obolibrary.org/obo/hp.owl partial
+#> 37 http://purl.obolibrary.org/obo/hp.owl partial
+#> 38 http://purl.obolibrary.org/obo/hp.owl partial
+#> 39 http://purl.obolibrary.org/obo/hp.owl partial
+#> 40 http://purl.obolibrary.org/obo/hp.owl partial
+#> 41 http://purl.obolibrary.org/obo/hp.owl partial
+#> 42 http://purl.obolibrary.org/obo/hp.owl partial
+#> 43 http://purl.obolibrary.org/obo/hp.owl partial
+#> 44 http://purl.obolibrary.org/obo/hp.owl partial
+#> 45 http://purl.obolibrary.org/obo/hp.owl partial
+#> 46 http://purl.obolibrary.org/obo/hp.owl partial
+#> 47 http://purl.obolibrary.org/obo/hp.owl broad
+#> 48 http://purl.obolibrary.org/obo/hp.owl partial
+#> 49 http://purl.obolibrary.org/obo/hp.owl partial
+#> 50 http://purl.obolibrary.org/obo/hp.owl partial
+#> 51 http://purl.obolibrary.org/obo/hp.owl partial
+#> 52 http://purl.obolibrary.org/obo/hp.owl partial
+#> 53 http://purl.obolibrary.org/obo/hp.owl partial
+#> 54 http://purl.obolibrary.org/obo/hp.owl partial
+#> 55 http://purl.obolibrary.org/obo/hp.owl partial
+#> 56 http://purl.obolibrary.org/obo/mp.owl broad
+#> 57 http://purl.obolibrary.org/obo/mp.owl broad
+#> 58 http://purl.obolibrary.org/obo/mp.owl broad
+#> 59 http://purl.obolibrary.org/obo/mp.owl broad
+#> 60 http://purl.obolibrary.org/obo/mp.owl broad
+#> 61 http://purl.obolibrary.org/obo/mp.owl broad
+#> 62 http://purl.obolibrary.org/obo/mp.owl broad
+#> 63 http://purl.obolibrary.org/obo/mp.owl broad
+#> 64 http://purl.obolibrary.org/obo/mp.owl broad
+#> 65 http://purl.obolibrary.org/obo/uberon.owl broad
+#> 66 http://purl.obolibrary.org/obo/uberon.owl partial
+#> 67 http://purl.obolibrary.org/obo/zfa.owl partial
+#> 68 http://purl.obolibrary.org/obo/vto.owl partial
+#> 69 http://purl.obolibrary.org/obo/vto.owl partial
+#> 70 http://purl.obolibrary.org/obo/vto.owl partial
+#> 71 http://purl.obolibrary.org/obo/vto.owl partial
+#> 72 http://purl.obolibrary.org/obo/vto.owl partial
+#> 73 http://purl.obolibrary.org/obo/vto.owl partial
+#> 74 http://purl.obolibrary.org/obo/vto.owl partial
+#> 75 http://purl.obolibrary.org/obo/vto.owl partial
+#> 76 http://purl.obolibrary.org/obo/vto.owl partial
+#> 77 http://purl.obolibrary.org/obo/vto.owl partial
+#> 78 http://purl.obolibrary.org/obo/vto.owl partial
+#> 79 http://purl.obolibrary.org/obo/vto.owl partial
+#> 80 http://purl.obolibrary.org/obo/vto.owl partial
+#> 81 http://purl.obolibrary.org/obo/vto.owl partial
+#> 82 http://purl.obolibrary.org/obo/vto.owl partial
+#> 83 http://purl.obolibrary.org/obo/vto.owl partial
+#> 84 http://purl.obolibrary.org/obo/vto.owl partial
+#> 85 http://purl.obolibrary.org/obo/vto.owl partial
+#> 86 http://purl.obolibrary.org/obo/vto.owl partial
+#> 87 http://purl.obolibrary.org/obo/vto.owl partial
+#> 88 http://purl.obolibrary.org/obo/vto.owl partial
+#> 89 http://purl.obolibrary.org/obo/vto.owl partial
+#> 90 http://purl.obolibrary.org/obo/vto.owl partial
+#> 91 http://purl.obolibrary.org/obo/vto.owl partial
Note that because the KB integrates model organism phenotypes, the +results show types of fin specific to model organisms, such as “fin +(zebrafish)”.
+There are several parameters available to narrow and filter search
+results. For example, the parameter matchType
allows
+restricting to exact matches only:
+find_term("fin", matchTypes = c("exact"))
+#> id label
+#> 1 http://purl.obolibrary.org/obo/UBERON_0008897 fin
+#> isDefinedBy matchType
+#> 1 http://purl.obolibrary.org/obo/uberon.owl exact
To retrieve more details about a given term, such as definition,
+synonyms and classification, you can pass the term IRI (e.g., ‘http://purl.obolibrary.org/obo/UBERON_0008897’ for fin)
+to the function as.terminfo()
.
+Classification details include the superclass (parent) and subclass
+(child) relationships for a given ontology term, along with other
+relationships such as part_of.
For example, view the relationships and term info for “pectoral +fin”:
+
+pecfin <- find_term('pectoral fin', matchType='exact')
+as.terminfo(pecfin)
+#> terminfo 'pectoral fin' http://purl.obolibrary.org/obo/UBERON_0000151
+#> Definition: Paired fin that is located in the thoracic region of the body.
+#> Synonyms:
+#> forefin (exact)
+#> pectoral fins (related)
+#> Relationships:
+#> has skeleton pectoral fin skeleton
+#> develops from pectoral appendage bud
+#> Subclass of:
+#> paired fin
+#> pectoral appendage
+#> Superclass of:
+#> archipterygial fin
+#> pectoral fin (zebrafish)
+#> pectoral fin and (part_of some larva)
+#> pectoral fin and (part_of some larva)
+#> pectoral fin and (part_of some larval stage)
+#> pectoral fin and (part_of some larval stage)
For a specific taxon, such as Siluriformes, you can also view the +taxon rank, whether or not the taxon is extinct, and its common +name:
+
+taxon <- find_term('Siluriformes')
+as.terminfo(taxon)
+#> terminfo 'Siluriformes' http://purl.obolibrary.org/obo/VTO_0034991
+#> Synonyms:
+#> catfish (related)
+#> catfishes (related)
+#> Subclass of:
+#> Otophysi
+#> Superclass of:
+#> Ailia
+#> Akysidae
+#> Amblycipitidae
+#> Amphiliidae
+#> Anchariidae
+#> Ariidae
+#> Aspredinidae
+#> Astroblepidae
+#> Auchenipteridae
+#> Auchenoglanididae
+#> Australoglanididae
+#> Austroglanididae
+#> Bagridae
+#> Callichthyidae
+#> Cetopsidae
+#> Chacidae
+#> Clariidae
+#> Claroteidae
+#> Clupisoma
+#> Conorhynchidae
+#> Cranoglanididae
+#> Diplomystidae
+#> Doradidae
+#> Eopeyeria
+#> Erethistidae
+#> Eutropiichthys
+#> Heptapteridae
+#> Heteropneustidae
+#> Horabagridae
+#> Hypophthalmidae
+#> Hypsidoridae
+#> Ictaluridae
+#> Lacantuniidae
+#> Laides
+#> Liobagrus
+#> Loricariidae
+#> Malapteruridae
+#> Mochokidae
+#> Nematogenyidae
+#> Neotropius
+#> Olyridae
+#> Pangasiidae
+#> Pareutropius
+#> Phreatobius
+#> Pimelodidae
+#> Platytropius
+#> Plotosidae
+#> Proeutropiichthys
+#> Pseudopimelodidae
+#> Rita
+#> Schilbidae
+#> Scoloplacidae
+#> Selenaspis
+#> Silonia
+#> Siluridae
+#> Siluroidei
+#> Sisoridae
+#> Trichomycteridae
+#> Xiurenbagrus
+#> Extinct: FALSE
+#> Rank: order
+#> Common Name: catfish
Now we will query for ‘Ictaluridae’ and ‘fin’ (including parts) to retrieve the list of studies that contain fin characters for this taxon.
-slist <- pk_get_study_list(taxon = "Ictaluridae", entity = "fin", relation = "part of")
The list is returned as a data.frame containing the study IDs and citations. Navigate to Global Environment and click on ‘slist’ to view the ID and citation (author, year) for each study in the KB that contains any ictalurid species associated with fin data. Note that taxon, entity, and quality are optional arguments in this query, and we have also included fin parts. Here we found nine studies. Click on ‘slist’ in the Global Environment to view these studies and their IDs.
-Next we want to obtain the character matrix for one of these studies. Using the study IDs from the previous step, we can get a list of the character matrices as NeXML objects. We will choose the Lundberg (1992) publication, the fifth item on the list above.
-lundberg_nexml <- pk_get_study_xml(slist$id[5])
-#> ....This might take a while....
-#> https://scholar.google.com/scholar?q=The+Phylogeny+of+Ictalurid+Catfishes%3A+A+Synthesis+of+Recent+Work&btnG=&hl=en&as_sdt=0%2C42
Now go to Global Environment pane and click on ‘lundberg_nexml’ to view the study ID and associated NeXML object.
-To view the full Lundberg (1992) matrix within RStudio, we need to first retrieve the matrix as a data.frame from the NeXML object:
-lundberg_matrix <- pk_get_study(lundberg_nexml)
-#> Map symbols to labels...
You can take a look at a small part of the Lundberg (1992) matrix (e.g., the first five taxa and first five characters):
-lundberg_matrix[[1]][1:5, 1:7]
-#> taxa otu
-#> 1 Ameiurus brunneus otu_8985e6a0-7cf3-4019-a964-a7cec83fc9eb
-#> 2 Ameiurus catus otu_c63b2154-2be6-47df-8d27-cd3568287900
-#> 3 Ameiurus melas otu_baf69862-dbe5-4e0f-8012-ba81966c146d
-#> 4 Ameiurus natalis otu_ea5132da-ca01-4b1d-afcb-3370f57e4337
-#> 5 Ameiurus nebulosus otu_dce96f1e-1bbf-4d0f-9084-0c83a7d5c2c9
-#> 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
-#> Anterior extent of sphenotic
-#> 1 reaches or extends anterior to the level of anterior margin of epiphyseal bar
-#> 2 reaches or extends anterior to the level of anterior margin of epiphyseal bar
-#> 3 reaches or extends anterior to the level of anterior margin of epiphyseal bar
-#> 4 reaches or extends anterior to the level of anterior margin of epiphyseal bar
-#> 5 reaches or extends anterior to the level of anterior margin of epiphyseal bar
-#> Anterior limb of fourth transverse process
-#> 1 supracleithral facet shallow, basal recess shallow and broad
-#> 2 supracleithral facet deep, basal recess deep and broad
-#> 3 supracleithral facet deep, basal recess deep and broad
-#> 4 supracleithral facet deep, basal recess deep and narrow
-#> 5 supracleithral facet deep, basal recess deep and narrow
Now navigate to Global Environment and click on ‘lundberg_matrix’ to view the matrix, including the total number of taxa and characters (i.e., the dimensions of the data.frame). To view the entire matrix in this panel, click on the first icon that appears to the right when you hover over the second row.
-Note that all taxa and characters from this study are returned, not just those pertaining to our original search terms. In this example, many anatomical entities other than ‘fin’ and its parts are returned as part of the original study matrix. In a later step, we will learn how to subset a matrix using anatomy or taxonomy terms.
+Now we will query for ‘Ictaluridae’ and ‘fin’ (including parts) to +retrieve the list of studies that contain fin characters for this +taxon.
+
+slist <- get_studies(taxon = "Ictaluridae", entity = "fin", includeRels = "part of")
The list is returned as a data.frame containing the study IDs and +citations. Navigate to Global Environment and click on ‘slist’ to view +the ID and citation (author, year) for each study in the KB that +contains any ictalurid species associated with fin data. Note that +taxon, entity, and quality are optional arguments in this query, and we +have also included fin parts. Here we found nine studies. Click on +‘slist’ in the Global Environment to view these studies and their +IDs.
+Next we want to obtain the character matrix for one of these studies. +Using the study IDs from the previous step, we can get a list of the +character matrices as NeXML objects. We will choose the Lundberg (1992) +publication, the fifth item on the list above.
+
+lundberg_nexml <- get_study_data(slist$id[5])
Now go to Global Environment pane and click on ‘lundberg_nexml’ to +view the study ID and associated NeXML object.
+To view the full Lundberg (1992) matrix within RStudio, we need to +first retrieve the matrix as a data.frame from the NeXML object:
+
+lundberg_matrix <- get_char_matrix(lundberg_nexml[[1]], otus_id = FALSE)
You can take a look at a small part of the Lundberg (1992) matrix +(e.g., the first five taxa and first five characters):
+
+lundberg_matrix[1:5, 1:7]
+#> taxa otu
+#> 1 Ameiurus brunneus otu_331eacec-f62a-489b-aa97-01f88c469d4a
+#> 2 Ameiurus catus otu_f0b4abb4-c4ca-4d99-b6d3-d069176eea82
+#> 3 Ameiurus melas otu_5a3062f1-9803-4120-ae34-d2aa1ce02a75
+#> 4 Ameiurus natalis otu_b92dfa0d-8c16-4228-815f-c418c6e92781
+#> 5 Ameiurus nebulosus otu_31f42c8a-cd70-4bf4-994d-9bc483822ba7
+#> Anal-fin rays, species mean count Anterior dentations of pectoral spine
+#> 1 1 3
+#> 2 2 2
+#> 3 2 1
+#> 4 3 1
+#> 5 2 2
+#> Anterior distal serrae of pectoral spine Anterior extent of sphenotic
+#> 1 1 0
+#> 2 2 0
+#> 3 0 0
+#> 4 2 0
+#> 5 1 0
+#> Anterior limb of fourth transverse process
+#> 1 2
+#> 2 1
+#> 3 1
+#> 4 0
+#> 5 0
Now navigate to Global Environment and click on ‘lundberg_matrix’ to +view the matrix, including the total number of taxa and characters +(i.e., the dimensions of the data.frame). To view the entire matrix in +this panel, click on the first icon that appears to the right when you +hover over the second row.
+We can use the information in the NeXML object to convert character +state symbols to labels:
+
+state_symbols2labels(lundberg_nexml[[1]], charmat = lundberg_matrix)[1:5, 1:7]
+#> taxa otu
+#> 1 Ameiurus brunneus otu_331eacec-f62a-489b-aa97-01f88c469d4a
+#> 2 Ameiurus catus otu_f0b4abb4-c4ca-4d99-b6d3-d069176eea82
+#> 3 Ameiurus melas otu_5a3062f1-9803-4120-ae34-d2aa1ce02a75
+#> 4 Ameiurus natalis otu_b92dfa0d-8c16-4228-815f-c418c6e92781
+#> 5 Ameiurus nebulosus otu_31f42c8a-cd70-4bf4-994d-9bc483822ba7
+#> 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
+#> Anterior extent of sphenotic
+#> 1 reaches or extends anterior to the level of anterior margin of epiphyseal bar
+#> 2 reaches or extends anterior to the level of anterior margin of epiphyseal bar
+#> 3 reaches or extends anterior to the level of anterior margin of epiphyseal bar
+#> 4 reaches or extends anterior to the level of anterior margin of epiphyseal bar
+#> 5 reaches or extends anterior to the level of anterior margin of epiphyseal bar
+#> Anterior limb of fourth transverse process
+#> 1 supracleithral facet shallow, basal recess shallow and broad
+#> 2 supracleithral facet deep, basal recess deep and broad
+#> 3 supracleithral facet deep, basal recess deep and broad
+#> 4 supracleithral facet deep, basal recess deep and narrow
+#> 5 supracleithral facet deep, basal recess deep and narrow
Note that all taxa and characters from this study are returned, not +just those pertaining to our original search terms. In this example, +many anatomical entities other than ‘fin’ and its parts are returned as +part of the original study matrix. In a later step, we will learn how to +subset a matrix using anatomy or taxonomy terms.
In the previous step, we queried the KB for individual studies that contain characters pertaining to the fins in ictalurid catfish, and we obtained character matrices for source publications that included those characters. Now we want to get a matrix that synthesizes these characters into a single matrix.
-OntoTrace from the KB combines characters from multiple publications into a single synthetic matrix. It allows a user to specify any number or combination of anatomical entities and taxa. It returns a matrix as a nexml object that includes only presence or absence of anatomical entities. It uses asserted data of presence or absence, i.e., originally described by an author, or inferred data. Data are inferred from asserted characters, e.g., if an author describes a part of a fin such as ‘fin ray’, the fin is inferred present and scored as such in the matrix.
-The OntoTrace default settings are to include parts of the anatomical entity and to include variable-only characters, but here we will include those that are invariant as well.
-nex <- pk_get_ontotrace_xml(taxon = "Ictaluridae", entity = "fin", variable_only = FALSE)
To view the matrix within RStudio, get the matrix (m) as a data.frame
from the NeXML object. Opening this (‘m’) in the Global Environment shows the taxa, character names, and state assignments (0, absent; 1, present) (note: the otu and otus are NeXML-internal IDs):
m <- pk_get_ontotrace(nex)
The character and taxon lists for the matrix can also be returned. Click on ‘meta’ in the Global Environment pane to view the data.frames for taxa and entities:
-meta <- pk_get_ontotrace_meta(nex)
The above returns 29 species of ictalurid catfishes and 123 anatomical entities for fins and their parts.
-You will need to go to the Phenoscape KB to view the supporting states, i.e., the source data upon which inferences were made or those that were directly asserted.
-For example, in the returned OntoTrace matrix (see ‘m’ in Global Environment (row 10)) the pelvic fin is scored as present (‘1’) for Ictalurus australis. Enter these data into the faceted browsing interface: https://kb.phenoscape.org/#/facet
+In the previous step, we queried the KB for individual studies that +contain characters pertaining to the fins in ictalurid catfish, and we +obtained character matrices for source publications that included those +characters. Now we want to get a matrix that synthesizes these +characters into a single matrix.
+OntoTrace from the +KB combines characters from multiple publications into a single +synthetic matrix. It allows a user to specify any number or combination +of anatomical entities and taxa. It returns a matrix as a nexml object +that includes only presence or absence of anatomical entities. It uses +asserted data of presence or absence, i.e., originally described by an +author, or inferred data. Data are inferred from asserted characters, +e.g., if an author describes a part of a fin such as ‘fin ray’, the fin +is inferred present and scored as such in the matrix.
+The OntoTrace default settings are to include parts of the anatomical +entity and to include variable-only characters, but here we will include +those that are invariant as well.
+
+nex <- get_ontotrace_data(taxon = "Ictaluridae", entity = "fin", variable_only = FALSE)
To view the matrix within RStudio, get the matrix (m) as a
+data.frame
from the NeXML object. Opening this (‘m’) in the
+Global Environment shows the taxa, character names, and state
+assignments (0, absent; 1, present) (note: the otu and otus are
+NeXML-internal IDs):
+m <- get_char_matrix(nex)
The character and taxon lists for the matrix can also be returned. +Click on ‘meta’ in the Global Environment pane to view the data.frames +for taxa and entities:
+
+meta <- get_char_matrix_meta(nex)
The above returns 29 species of ictalurid catfishes and 124 +anatomical entities for fins and their parts.
+You will need to go to the Phenoscape KB to view the +supporting states, i.e., the source data upon which inferences were made +or those that were directly asserted.
+For example, in the returned OntoTrace matrix (see ‘m’ in Global +Environment (row 10)) the pelvic fin is scored as present (‘1’) for +Ictalurus australis. Enter these data on the faceted browsing page:
Looking at ‘Taxon annotations’, you will find that there are zero phenotypes, i.e., no asserted character states to ‘pelvic fin present’. Now click the ‘inferred presence’ radio button under Phenotypic quality. You will now see two phenotypes for this taxon in the KB. These phenotypes ‘pelvic fin lepidotrichium amount’ and ‘pelvic splint present’ logically imply the presence of a pelvic fin. Thus, though an author did not directly assert the presence of a pelvic fin in Ictalurus australis, it is inferred and thus reported as present (‘1’) in the OntoTrace matrix.
+Looking at ‘Taxon annotations’, you will find that there are zero +phenotypes, i.e., no asserted character states to ‘pelvic fin present’. +Now click the ‘inferred presence’ radio button under Phenotypic quality. +You will now see two phenotypes for this taxon in the KB. These +phenotypes ‘pelvic fin lepidotrichium amount’ and ‘pelvic splint +present’ logically imply the presence of a pelvic fin. Thus, though an +author did not directly assert the presence of a pelvic fin in +Ictalurus australis, it is inferred and thus reported as +present (‘1’) in the OntoTrace matrix.
In the above step you retrieved a synthetic matrix for the Ictaluridae. Now you would like to pare it down in taxonomic and anatomical scope. Let’s begin by trimming the matrix down to the presence and absence characters pertaining only to the genus Ictalurus. We will reduce the matrix to include only descendents of Ictalurus.
-First, we need to parse the list to determine which taxa in the matrix (‘m’) are descendants of Ictalurus. This returns a list of TRUE or FALSE assignments for each taxon in the matrix:
-is_desc <- pk_is_descendant('Ictalurus', m$taxa)
We then subset the matrix m to the descendants of Ictalurus:
-ictalurus_m <- m[is_desc, ]
View the new matrix by clicking on the ‘ictalurus_m’ data.frame
in the Global Environment.
We can also subset the matrix by anatomy. In this case, let’s select characters for the pectoral fin and its parts. We will use pk_is_descendant()
to first parse the characters (column names; note the first three taxon-related columns are excluded) to determine which are descendents (types or parts) of the term ‘pectoral fin’. Because this function only looks for descendent terms, we also need to specify that any characters pertaining to ‘pectoral fin’ itself are included.
is_desc_pecfin <- pk_is_descendant('pectoral fin', colnames(ictalurus_m)[-c(1,2,3)], includeRels = "part_of") | colnames(ictalurus_m)[-c(1,2,3)] == 'pectoral fin'
-table(is_desc_pecfin)
-#> is_desc_pecfin
-#> FALSE TRUE
-#> 109 14
Using the ‘colnames’ command below, view the character names to verify that pectoral fin related characters will be selected:
-colnames(ictalurus_m)[-c(1,2,3)][is_desc_pecfin]
-#> [1] "anterior dentation of pectoral fin spine"
-#> [2] "anterior distal serration of pectoral fin spine"
-#> [3] "pectoral fin"
-#> [4] "pectoral fin lepidotrichium"
-#> [5] "pectoral fin proximal radial bone"
-#> [6] "pectoral fin proximal radial cartilage"
-#> [7] "pectoral fin proximal radial element"
-#> [8] "pectoral fin radial bone"
-#> [9] "pectoral fin radial cartilage"
-#> [10] "pectoral fin radial element"
-#> [11] "pectoral fin radial skeleton"
-#> [12] "pectoral fin skeleton"
-#> [13] "pectoral fin spine"
-#> [14] "posterior dentation of pectoral fin spine"
We now subset the matrix m using ‘is_desc_pecfin’ and retain the first three taxon-related columns:
-to_keep <- c(TRUE, TRUE, TRUE, is_desc_pecfin)
-pecfin_m <- ictalurus_m[, to_keep]
View this matrix of pectoral fin characters for Ictalurus by clicking on ‘pecfin_m’ in the Global Environment.
+In the above step you retrieved a synthetic matrix for the +Ictaluridae. Now you would like to pare it down in taxonomic and +anatomical scope. Let’s begin by trimming the matrix down to the +presence and absence characters pertaining only to the genus +Ictalurus. We will reduce the matrix to include only +descendents of Ictalurus.
+First, we need to parse the list to determine which taxa in the +matrix (‘m’) are descendants of Ictalurus. This returns a list +of TRUE or FALSE assignments for each taxon in the matrix:
+
+is_desc <- is_descendant('Ictalurus', m$taxa)
We then subset the matrix m to the descendants of +Ictalurus:
+
+ictalurus_m <- m[is_desc, ]
View the new matrix by clicking on the ‘ictalurus_m’
+data.frame
in the Global Environment.
We can also subset the matrix by anatomy. In this case, let’s select
+characters for the pectoral fin and its parts. We will use is_descendant()
+to first parse the characters (column names; note the first three
+taxon-related columns are excluded) to determine which are descendents
+(types or parts) of the term ‘pectoral fin’. Because this function only
+looks for descendent terms, we also need to specify that any characters
+pertaining to ‘pectoral fin’ itself are included.
+is_desc_pecfin <- is_descendant('pectoral fin', colnames(ictalurus_m)[-c(1,2,3)], includeRels = "part_of") | colnames(ictalurus_m)[-c(1,2,3)] == 'pectoral fin'
+table(is_desc_pecfin)
+#> is_desc_pecfin
+#> FALSE TRUE
+#> 110 14
Using the ‘colnames’ command below, view the character names to +verify that pectoral fin related characters will be selected:
+
+colnames(ictalurus_m)[-c(1,2,3)][is_desc_pecfin]
+#> [1] "anterior dentation of pectoral fin spine"
+#> [2] "anterior distal serration of pectoral fin spine"
+#> [3] "pectoral fin"
+#> [4] "pectoral fin lepidotrichium"
+#> [5] "pectoral fin proximal radial bone"
+#> [6] "pectoral fin proximal radial cartilage"
+#> [7] "pectoral fin proximal radial element"
+#> [8] "pectoral fin radial bone"
+#> [9] "pectoral fin radial cartilage"
+#> [10] "pectoral fin radial element"
+#> [11] "pectoral fin radial skeleton"
+#> [12] "pectoral fin skeleton"
+#> [13] "pectoral fin spine"
+#> [14] "posterior dentation of pectoral fin spine"
We now subset the matrix m using ‘is_desc_pecfin’ and retain the +first three taxon-related columns:
+
+to_keep <- c(TRUE, TRUE, TRUE, is_desc_pecfin)
+pecfin_m <- ictalurus_m[, to_keep]
View this matrix of pectoral fin characters for Ictalurus by +clicking on ‘pecfin_m’ in the Global Environment.
Knowing how the information about an anatomical structure may rely on other layers of anatomical information is critical, if the goal is to isolate and analyze independent features. We can query the KB for a presence-absence dependency matrix for a specified set of anatomical structures. The dependency matrix is derived from the formalized knowledge of relationships among entities encoded in the ontology. In the example below, the presence of ‘pelvic splint’ is dependent on the presence of ‘pelvic fin’. In other words, the pelvic fin is implied present when the pelvic splint is present because ‘pelvic splint’ is part_of ‘pelvic fin’.
-tl <- c("pectoral fin", "pelvic fin", "pelvic splint", "antorbital", "preopercle")
-
-dep_mat <- pa_dep_matrix(tl, .names = "label")
-dep_mat
-#> pectoral fin pelvic fin pelvic splint antorbital preopercle
-#> pectoral fin 1 0 0 0 0
-#> pelvic fin 0 1 0 0 0
-#> pelvic splint 0 1 1 0 0
-#> antorbital 0 0 0 1 0
-#> preopercle 0 0 0 0 1
In the PARAMO tutorial, we will learn how to use these dependency matrices to reconstruct individual traits and entire phenotypes.
+Knowing how the information about an anatomical structure may rely on +other layers of anatomical information is critical, if the goal is to +isolate and analyze independent features. We can query the KB for a +presence-absence dependency matrix for a specified set of anatomical +structures. The dependency matrix is derived from the formalized +knowledge of relationships among entities encoded in the ontology. In +the example below, the presence of ‘pelvic splint’ is dependent on the +presence of ‘pelvic fin’. In other words, the pelvic fin is implied +present when the pelvic splint is present because ‘pelvic splint’ is +part_of ‘pelvic fin’.
+
+tl <- c("pectoral fin", "pelvic fin", "pelvic splint", "antorbital", "preopercle")
+
+dep_mat <- pa_dep_matrix(tl, .names = "label")
+dep_mat
+#> pectoral fin pelvic fin pelvic splint antorbital preopercle
+#> pectoral fin 1 0 0 0 0
+#> pelvic fin 0 1 0 0 0
+#> pelvic splint 0 1 1 0 0
+#> antorbital 0 0 0 1 0
+#> preopercle 0 0 0 0 1
In the PARAMO tutorial, we will learn how to use these dependency +matrices to reconstruct individual traits and entire phenotypes.
We can also obtain similarity metrics for phenotypes based on ontological distance. Three similarity metrics - Jaccard, Tanimoto, and Cosine - are computed by the KB to measure similarity between terms (see RPhenoscape documentation in the Help panel for how these are measured). For example, here we compute and visualize Jaccard similarity for premaxillary tooth phenotypes in Ictaluridae:
-phens <- get_phenotypes(entity = "premaxillary tooth", taxon = "Ictaluridae")
-nrow(phens)
-#> [1] 9
-sm <- jaccard_similarity(terms = phens$id, .labels = phens$label, .colnames = "label")
-plot(hclust(as.dist(1-sm)))
We can also obtain similarity metrics for phenotypes based on +ontological distance. Three similarity metrics - Jaccard, Tanimoto, and +Cosine - are computed by the KB to measure similarity between terms (see +RPhenoscape documentation in the Help panel for how these are measured). +For example, here we compute and visualize Jaccard similarity for +premaxillary tooth phenotypes in Ictaluridae:
+
+phens <- get_phenotypes(entity = "premaxillary tooth", taxon = "Ictaluridae")
+nrow(phens)
+#> [1] 9
+sm <- jaccard_similarity(terms = phens$id, .labels = phens$label, .colnames = "label")
+plot(hclust(as.dist(1-sm)))
In the PARAMO tutorial, we’ll use a semantic similarity matrix to visualize traits in a heat map. We are also developing methods that use semantic similarity to cluster phenotypes into characters and character states.
+In the PARAMO tutorial, we’ll use a semantic similarity matrix to +visualize traits in a heat map. We are also developing methods that use +semantic similarity to cluster phenotypes into characters and character +states.
Developed by Hilmar Lapp, Wasila Dahdul, Josef Uyeda.
+ +Developed by Hilmar Lapp, Wasila Dahdul, Josef Uyeda.
DESCRIPTION
+ Lapp H, Dahdul W, Uyeda J (2022). +SCATE.shortcourse: Short Course on Phylogenetic Comparative Analysis of Integrated Anatomical Traits. +https://github.com/phenoscape/scate-shortcourse, https://phenoscape.org/scate-shortcourse/. +
+@Manual{, + title = {SCATE.shortcourse: Short Course on Phylogenetic Comparative Analysis of Integrated Anatomical Traits}, + author = {Hilmar Lapp and Wasila Dahdul and Josef Uyeda}, + year = {2022}, + note = {https://github.com/phenoscape/scate-shortcourse, https://phenoscape.org/scate-shortcourse/}, +}
This R package encapsulates the material for the short course on Phylogenetic Comparative Analysis of Integrated Anatomical Traits.
The purpose of doing so is to leverage the R package installation mechanism for ensuring that all R dependencies needed for the course are installed and available, simply as a result of installing this package.
The material itself is in the form of vignettes written in RMarkdown. Users are encouraged to modify the code chunks and re-execute the vignettes as a means of exploring the material.
-You can download the course material to your computer directly from Github as a Zip archive. Click the Download Zip link that appears under the Clone or Download, move the Zip archive to a directory of your choice, then unpack it.
+You can download the course material to your computer directly from Github as a Zip archive. Click the Download Zip link that appears under the Clone or Download, move the Zip archive to a directory of your choice, then unpack it.
You can then open the folder containing the material as a project in RStudio, and render (“knit”) and modify the vignette(s) (see vignette/
subdirectory).
The RPhenoscape vignette depends only on the RPhenoscape package, which can be installed directly from Github as per its documentation. (RPhenoscape has itself a number of recursive dependencies; installing the package will install those, too.)
-The PARAMO vignette has a number of dependencies. These can be installed automatically by installing the workshop package, either from the command line (use R CMD build
, followed by R CMD INSTALL
), or from within RStudio using the install_github()
function in the remotes
package (which can be installed from CRAN using install.packages()
):
remotes::install_github("phenoscape/scate-shortcourse")
The RPhenoscape vignette depends only on the RPhenoscape package, which can be installed directly from Github as per its documentation. (RPhenoscape has itself a number of recursive dependencies; installing the package will install those, too.)
+The PARAMO vignette has a number of dependencies. These can be installed automatically by installing the workshop package, either from the command line (use R CMD build
, followed by R CMD INSTALL
), or from within RStudio using the install_github()
function in the remotes
package (which can be installed from CRAN using install.packages()
):
+remotes::install_github("phenoscape/scate-shortcourse")
This command will likely trigger a (possibly long) list of packages that are required to be installed and upgraded, or suggested for upgrade, with a prompt for choosing how to select which packages to upgrade or install. Unless you happen to have installed an earlier version of RPhenoscape that fails to meet the required version, we recommend to use the option for installing and upgrading from CRAN only. (Typically, this will be option 2.)
Note that the above command will use the default options for build arguments, which will leave out building and installing the vignettes. Since the best use of the vignettes is to go through (and potentially modify) them within RStudio, this shouldn’t be an issue.
-If your operating system is some flavor of Linux, many of the package dependencies that include compiled code will end up being installed from source. Some of these have dependencies external to R, and thus installing them from source will fail if these external dependencies are not pre-installed.
-Currently, the following packages are required on top of a Ubuntu 18.04 / R 5.3.3 environment:
-Currently, the following packages are required on top of a Ubuntu 18.04 / R 5.3.3 environment: - libmagick++-dev - libgmp-dev - libmpfr-dev - pandoc
Other base systems may require additional (or fewer) external packages.
SCATE is funded by the US National Science Foundation (NSF) as collaborative awards 1661456 (Duke University), 1661529 (Virginia Tech), 1661516 (University of South Dakota), and 1661356 (UNC Chapel Hill and RENCI) within the Advances in Biological Informatics (ABI) program.
+SCATE is funded by the US National Science Foundation (NSF) as collaborative awards 1661456 (Duke University), 1661529 (Virginia Tech), 1661516 (University of South Dakota), and 1661356 (UNC Chapel Hill and RENCI) within the Advances in Biological Informatics (ABI) program.
To the extent possible under law, the SCATE Project Team has waived all copyright and related or neighboring rights to this work. See the CC Zero public domain waiver for details.
+To the extent possible under law, the SCATE Project Team has waived all copyright and related or neighboring rights to this work. See the CC Zero public domain waiver for details.
If you reuse or make derivatives of this work, we request that you cite or otherwise give proper credit to this work.
Developed by Hilmar Lapp, Wasila Dahdul, Josef Uyeda.
+ +Developed by Hilmar Lapp, Wasila Dahdul, Josef Uyeda.
Make rate matrix for RevBayes
-Mk_Rev(M, prior = "dnExp(20)")- -
M | -rate matrix |
-
---|---|
prior | -prior to be used |
-
Mk_Rev(M, prior = "dnExp(20)")
rate matrix
prior to be used
matrix
+cat(Mk_Rev(M))
+#> Error in nrow(M): object 'M' not found
+
R/workshop_functions.R
+ Source: R/workshop_functions.R
RAC_query.Rd
Function for aggregating characters under a specified set of terms (for example, body regions)
-RAC_query(char_info, ONT, names)- +
RAC_query(char_info, ONT, names)
R/auto_functions.R
+ Source: R/auto_functions.R
amalgamate_deps.Rd
Generates a graph and model for traits given a dependency matrix
-amalgamate_deps(dep_mat)- -
dep_mat | -A dependency matrix |
-
---|
amalgamate_deps(dep_mat)
A dependency matrix
A list of: +
A list of: $M Transition matrices for the Structured-Hidden State Markov Models that can be run in RevBayes, corHMM or other tools $graph The full graph of all dependencies among traits @@ -149,39 +87,33 @@
The dependency matrix can come from `rphenoscape::pa_dep_matrix` or be user generated
- - -R/auto_functions.R
+ Source: R/auto_functions.R
amalgamated_fits_corHMM.Rd
A wrapper for corHMM that fits Structured Hidden State Models
-amalgamated_fits_corHMM(td, amalgamations, ...)- -
td | -A treeplyr treedata object |
-
---|---|
amalgamations | -A list produced by `amalgamate_deps` |
-
... | -Additional arguments passed to `corHMM::rayDISC` |
-
amalgamated_fits_corHMM(td, amalgamations, ...)
A list of fits for each character in the dataset
+A treeplyr treedata object
A list produced by `amalgamate_deps`
Additional arguments passed to `corHMM::rayDISC`
This function fits the models contained in `amalgamations$M` to each of the characters in `td` using the function `corHMM::rayDISC`.
- - -R/auto_functions.R
+ Source: R/auto_functions.R
amalgamated_simmaps_phytools.Rd
A wrapper for phytools that draws stochastic character maps given a corHMM fit
-amalgamated_simmaps_phytools(fits, ...)- -
fits | -A list produced by `amalgamated_fits_corHMM` |
-
---|---|
... | -Additional arguments passed to `phytools::make.simmap` |
-
amalgamated_simmaps_phytools(fits, ...)
A list produced by `amalgamated_fits_corHMM`
A list of stochastic character maps for each character in the dataset
+Additional arguments passed to `phytools::make.simmap`
This function takes the models produced from `amalgamated_fits_corHMM` and uses them to generate stochastic character maps.
- - -Combining two matrices. The parametric schem of matrice is defined by nattural numbers; different numbers = different rate parameters
-comb2matrices(M1, M2, dependent.state = NULL, name.sep = "", - diag.as = "")- -
M1 | -matrix; if dependency true thenM1 controls M2 |
-
---|---|
M2 | -matrix; if dependency true then: M2 depends on those states of M1 specified in dependent.state |
-
dependent.state | -state(s) of M1 that switches on matrix M2 |
-
name.sep | -separator for state names |
-
diag.as | -hpopulate main diagonal with |
-
comb2matrices(M1, M2, dependent.state = NULL, name.sep = "",
+ diag.as = "")
matrix; if dependency true thenM1 controls M2
matrix; if dependency true then: M2 depends on those states of M1 specified in dependent.state
state(s) of M1 that switches on matrix M2
separator for state names
Matrix
+ +hpopulate main diagonal with
-M1<-matrix(c(-1,1, 2,-2),2,2,byrow=TRUE) -rownames(M1)<-colnames(M1)<-c("0","1") -M2<-matrix(c(-3,3, 4,-4),2,2,byrow=TRUE) -rownames(M2)<-colnames(M2)<-c("0","1") -comb2matrices(M1, M2, dependent.state=NULL)#> 00 01 10 11 -#> 00 -4 3 1 0 -#> 01 4 -5 0 1 -#> 10 2 0 -5 3 -#> 11 0 2 4 -6comb2matrices(M1, M2, dependent.state=2)#> 00 01 10 11 -#> 00 -1 0 1 0 -#> 01 0 -1 0 1 -#> 10 2 0 -5 3 -#> 11 0 2 4 -6
M1<-matrix(c(-1,1, 2,-2),2,2,byrow=TRUE)
+rownames(M1)<-colnames(M1)<-c("0","1")
+M2<-matrix(c(-3,3, 4,-4),2,2,byrow=TRUE)
+rownames(M2)<-colnames(M2)<-c("0","1")
+comb2matrices(M1, M2, dependent.state=NULL)
+#> 00 01 10 11
+#> 00 -4 3 1 0
+#> 01 4 -5 0 1
+#> 10 2 0 -5 3
+#> 11 0 2 4 -6
+comb2matrices(M1, M2, dependent.state=2)
+#> 00 01 10 11
+#> 00 -1 0 1 0
+#> 01 0 -1 0 1
+#> 10 2 0 -5 3
+#> 11 0 2 4 -6
+
R/SMM_functions.R
+ Source: R/SMM_functions.R
combNmatrices.Rd
Liely as independently evolving
-combNmatrices(list.matrices, ...)- -
list.matrices | -Lsit of matrices |
-
---|
combNmatrices(list.matrices, ...)
Matrix
+Lsit of matrices
R/Functions_Discr_maps.R
+ Source: R/Functions_Discr_maps.R
discr_Simmap.Rd
Reading unsummarized Stoch Map files from ReVBayes for one tree
-discr_Simmap(tree, res)- +
discr_Simmap(tree, res)
R/Functions_Discr_maps.R
+ Source: R/Functions_Discr_maps.R
discr_Simmap_all.Rd
Reading unsummarized Stoch Map files from ReVBayes
-discr_Simmap_all(tree, res)- +
discr_Simmap_all(tree, res)
R/workshop_functions.R
+ Source: R/workshop_functions.R
dropDependentTraits.Rd
Utility function for cleaning up character data table after amalgamating characters
-dropDependentTraits(char_info, dep.mat, td)- +
dropDependentTraits(char_info, dep.mat, td)
R/workshop_functions.R
+ Source: R/workshop_functions.R
filter_coverage.Rd
Utility function for filtering based on missing traits and taxa
-filter_coverage(td, traits = 0, taxa = 0)- +
filter_coverage(td, traits = 0, taxa = 0)
R/PARAMO_functions.R
+ Source: R/PARAMO_functions.R
get_descendants_chars.Rd
Returns all characters located (associated) with a given ontology terms
-get_descendants_chars(ontology, annotations = "auto", terms, ...)- -
ontology | -ontology_index object. |
-
---|---|
annotations | -which annotations to use: "auto" means automatic annotations, "manual" means manual ones. -Alternatively, any othe list element containing annotations can be specified. |
-
terms | -IDs of ontology terms for which descendants are queried. |
-
... | -other parameters for ontologyIndex::get_descendants() function |
-
get_descendants_chars(ontology, annotations = "auto", terms, ...)
ontology_index object.
which annotations to use: "auto" means automatic annotations, "manual" means manual ones. +Alternatively, any othe list element containing annotations can be specified.
IDs of ontology terms for which descendants are queried.
The vector of character IDs.
+other parameters for ontologyIndex::get_descendants() function
-ontology<-HAO#> Error in eval(expr, envir, enclos): object 'HAO' not found#> Error in ontology$terms_selected_id <- list(`CHAR:1` = c("HAO:0000653"), `CHAR:2` = c("HAO:0000653")): object 'ontology' not foundget_descendants_chars(ontology, annotations="manual", "HAO:0000653")#> Error in get_descendants_chars(ontology, annotations = "manual", "HAO:0000653"): object 'ontology' not found
ontology<-HAO
+#> Error in eval(expr, envir, enclos): object 'HAO' not found
+ontology$terms_selected_id<-list(`CHAR:1`=c("HAO:0000653"), `CHAR:2`=c("HAO:0000653"))
+#> Error in ontology$terms_selected_id <- list(`CHAR:1` = c("HAO:0000653"), `CHAR:2` = c("HAO:0000653")): object 'ontology' not found
+get_descendants_chars(ontology, annotations="manual", "HAO:0000653")
+#> Error in get_descendants_chars(ontology, annotations = "manual", "HAO:0000653"): object 'ontology' not found
+
R/SMM_functions.R
+ Source: R/SMM_functions.R
get_graph_matrix.Rd
Construct dependency matrices and their correponding attributes
-get_graph_matrix(graph)- -
graph | -igraph object of ontology terms |
-
---|
get_graph_matrix(graph)
igraph object of ontology terms
List of matrices and their attributes
+$binary.matrices # intial binary matrices assigned to each node of graph $comb.matrices$matrix # combined matrix for each node $comb.matrices$state.string # vector of states [1] "00" "01" "10" "11" @@ -154,39 +92,35 @@
-get_graph_matrix(g)#> Error in get_graph_matrix(g): object 'g' not found
get_graph_matrix(g)
+#> Error in get_graph_matrix(g): object 'g' not found
+
R/PARAMO_functions.R
+ Source: R/PARAMO_functions.R
get_onto_id.Rd
Returns IDs of ontology terms given terms' names
-get_onto_id(vec_name, ontology, names = F)- -
vec_name | -names od terms |
-
---|---|
ontology | -ontology |
-
names | -use element name |
-
get_onto_id(vec_name, ontology, names = F)
names od terms
ontology
vector of IDs.
+use element name
-#> Error in match(unlist(vec_name, use.names = FALSE), ontology$name): object 'HAO' not found
vec_name=c("ventral mesofurco-profurcal muscle", "anatomical entity")
+get_onto_id(vec_name, HAO)
+#> Error in get_onto_id(vec_name, HAO): object 'HAO' not found
+
R/SMM_functions.R
+ Source: R/SMM_functions.R
init_binary_matrix.Rd
Call matrices are populated with different parameters
-init_binary_matrix(graph)- -
graph | -igraph object |
-
---|
init_binary_matrix(graph)
igraph object
List of matrices
+-init_binary_matrix(g)#> Error in "igraph" %in% class(graph): object 'g' not found
init_binary_matrix(g)
+#> Error in "igraph" %in% class(graph): object 'g' not found
+
R/SMM_functions.R
+ Source: R/SMM_functions.R
init_char_matrix.Rd
Initialize binary matrices
-init_char_matrix(char.state, rate.param, diag.as = NA)- -
char.state | -names for character states |
-
---|---|
rate.param | -names for the rate parameters |
-
diag.as | -values to pas to the main diagonal elements |
-
init_char_matrix(char.state, rate.param, diag.as = NA)
names for character states
names for the rate parameters
matrix
+ +values to pas to the main diagonal elements
R/PARAMO_functions.R
+ Source: R/PARAMO_functions.R
list2edges.Rd
Takes list of charater annotations amd creates an edge matrix comprising two columns: from and to. The list to table conversion can be done using ldply function from plyr package: plyr::ldply(list, rbind).
-list2edges(annotated.char.list, col_order_inverse = F)- -
annotated.char.list | -Character list with ontology annotations. |
-
---|---|
col_order_inverse | -The default creates the first columns consisting if character IDs and the second columns consisting of ontology annatotaions. -The inverse order changes the columns order. |
-
list2edges(annotated.char.list, col_order_inverse = F)
Character list with ontology annotations.
The default creates the first columns consisting if character IDs and the second columns consisting of ontology annatotaions. +The inverse order changes the columns order.
Two-column matrix.
+-annot_list<-list(`CHAR:1`=c("HAO:0000933", "HAO:0000958"), `CHAR:2`=c("HAO:0000833", "HAO:0000258")) -list2edges(annot_list)#> [,1] [,2] -#> [1,] "CHAR:1" "HAO:0000933" -#> [2,] "CHAR:1" "HAO:0000958" -#> [3,] "CHAR:2" "HAO:0000833" -#> [4,] "CHAR:2" "HAO:0000258"# attache plyr package and run -# ldply(annot_list, rbind) -
annot_list<-list(`CHAR:1`=c("HAO:0000933", "HAO:0000958"), `CHAR:2`=c("HAO:0000833", "HAO:0000258"))
+list2edges(annot_list)
+#> [,1] [,2]
+#> [1,] "CHAR:1" "HAO:0000933"
+#> [2,] "CHAR:1" "HAO:0000958"
+#> [3,] "CHAR:2" "HAO:0000833"
+#> [4,] "CHAR:2" "HAO:0000258"
+# attache plyr package and run
+# ldply(annot_list, rbind)
+
R/workshop_functions.R
+ Source: R/workshop_functions.R
makeTraitTree.Rd
Makes a trait tree using semantic similarity
-makeTraitTree(td, skip = 1:2)- +
makeTraitTree(td, skip = 1:2)
R/Functions_Discr_maps.R
+ Source: R/Functions_Discr_maps.R
make_tree_eq.Rd
make branch length and maps equal, use tree.tmp with rounded (3) edge.length
-make_tree_eq(tree.tmp, target.tr, round = 3)- +
make_tree_eq(tree.tmp, target.tr, round = 3)
R/workshop_functions.R
+ Source: R/workshop_functions.R
ontologyHeatMap.Rd
Plots a heatmap along with a phylogeny and trait tree
-ontologyHeatMap(td, njt, start = 3, margs = c(0.2, 0.25), ...)- +
ontologyHeatMap(td, njt, start = 3, margs = c(0.2, 0.25), ...)
R/Functions_Stack_maps.R
+ Source: R/Functions_Stack_maps.R
paramo.Rd
Final stack of maps for a set of stochastic maps stored in a directory cc chars id to stack ntrees number of trees to stack dirW directory for zip file
-paramo(cc, ntrees = 10, dirW = c(""))- -
paramo(cc, ntrees = 10, dirW = c(""))
A list of stacked stochastic character maps
+R/Functions_Stack_maps.R
+ Source: R/Functions_Stack_maps.R
paramo.list.Rd
Final stack of maps for a set of stochastic maps stored in a list
-paramo.list(cc, tree.list, ntrees = 1)- -
cc | -chars id to stack |
-
---|---|
tree.list | -Named list with stochastic character maps |
-
ntrees | -number of trees to stack |
-
paramo.list(cc, tree.list, ntrees = 1)
chars id to stack
Named list with stochastic character maps
A list of stacked stochastic character maps
+ +number of trees to stack
R/workshop_functions.R
+ Source: R/workshop_functions.R
prepareMapsRayDISC.Rd
Function for processing revbayes stochastic maps
-prepareMapsRayDISC(td, simmaps, discretization_level = 100)- +
prepareMapsRayDISC(td, simmaps, discretization_level = 100)
R/workshop_functions.R
+ Source: R/workshop_functions.R
prepareMapsRev.Rd
Function for processing revbayes stochastic maps
-prepareMapsRev(td, discretization_level = 100, start_tree = 1, - end_tree = 2)- +
prepareMapsRev(td, discretization_level = 100, start_tree = 1,
+ end_tree = 2)
R/workshop_functions.R
+ Source: R/workshop_functions.R
print_coverage.Rd
Function to display the number of matching species and average value across them from an Ontotrace matrix
-print_coverage(x)- +
print_coverage(x)
R/workshop_functions.R
+ Source: R/workshop_functions.R
ratemat1.Rd
Data object for Rev scripts
-ratemat1()
-
+ ratemat1()
R/Functions_Discr_maps.R
+ Source: R/Functions_Discr_maps.R
read_Simmap_Rev.Rd
Reading unsummarized Stoch Map files from ReVBayes
-read_Simmap_Rev(file, start = 1, end = 1, save = NULL)- -
file | -file |
-
---|---|
start | -start from tree |
-
end | -end with tree |
-
save | -save to file. if NULL reads in R |
-
read_Simmap_Rev(file, start = 1, end = 1, save = NULL)
file
start from tree
end with tree
save to file. if NULL reads in R
R/workshop_functions.R
+ Source: R/workshop_functions.R
recode_td.Rd
recodes a treedata object based on amalgamated characters
-recode_td(td, traits, states, depstates = numeric(0))- +
recode_td(td, traits, states, depstates = numeric(0))
R/auto_functions.R
+ Source: R/auto_functions.R
recode_traits.Rd
Automatically recode amalgamated traits in PARAMO Amalgamates traits using the matrices returned by amalgamate_deps
-recode_traits(td, M)- -
td | -A treeplyr treedata object with characters to recode |
-
---|---|
M | -A list produced by the function `amalgamate_deps` |
-
recode_traits(td, M)
A treeplyr treedata object with characters to recode
A list produced by the function `amalgamate_deps`
R/auto_functions.R
+ Source: R/auto_functions.R
remove_indirect.Rd
Function for removing redundant dependency edges from our graph
-remove_indirect(dependency_matrix)- -
dependency_matrix | -A dependency matrix |
-
---|
remove_indirect(dependency_matrix)
R/workshop_functions.R
+ Source: R/workshop_functions.R
strip_IRI.Rd
Utility function for stripping off url from IRI
-strip_IRI(x)- +
strip_IRI(x)
Takes table where each row consists of charcter number and ontology annotations and returns a list. Each character is assigned its own ID CHAR:XXXX
-table2list(table, id_col = c(1), descendants_cols = c(2:ncol(table)))- -
table | -A character table with annotations. |
-
---|---|
id_col | -A column ID corresponding to character |
-
descendants_cols | -IDs of columns corresponding to character annotations |
-
A character table with annotations.
A column ID corresponding to character
The list.
+IDs of columns corresponding to character annotations
-# converting Sharkey_2011 data set to list of characater states -list_data<-table2list(Sharkey_2011)#> Error in nrow(table): object 'Sharkey_2011' not found
# converting Sharkey_2011 data set to list of characater states
+list_data<-table2list(Sharkey_2011)
+#> Error in nrow(table): object 'Sharkey_2011' not found
+
R/workshop_functions.R
+ Source: R/workshop_functions.R
writeRevOntologyModels.Rd
Function to write Ontology CTMC models as a .Rev file for execution in Revbayes
-writeRevOntologyModels(td, M, dir, dirW, dirR, dirD)- +
writeRevOntologyModels(td, M, dir, dirW, dirR, dirD)