diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..de2aec7 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,148 @@ + + + + + + + + +Page not found (404) • rphenoscape + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + + +
+ + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 249be3b..7925794 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -8,21 +8,29 @@ License • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -68,7 +79,7 @@ -
+
@@ -134,22 +145,32 @@

License

+ + + + + diff --git a/docs/articles/index.html b/docs/articles/index.html index 7082d7b..efafaf4 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -8,21 +8,29 @@ Articles • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -68,7 +79,7 @@ -
+
@@ -106,26 +117,31 @@

Articles

All vignettes

- +
+
RPhenoscape Intro
+
+
+ + + diff --git a/docs/articles/rphenoscape.html b/docs/articles/rphenoscape.html index 1443866..3cfbb61 100644 --- a/docs/articles/rphenoscape.html +++ b/docs/articles/rphenoscape.html @@ -6,18 +6,19 @@ RPhenoscape Intro • rphenoscape - - - + + + + + - - + - +
- +
-

Site built with pkgdown 1.3.0.

+

Site built with pkgdown 1.6.1.

+
+ diff --git a/docs/authors.html b/docs/authors.html index 7ce38d6..62c6b4b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -8,21 +8,29 @@ Authors • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
@@ -68,7 +79,7 @@ -
+
@@ -108,7 +119,11 @@

Authors

  • -

    Hilmar Lapp. Maintainer, author. ORCID +

    Hilmar Lapp. Maintainer, author. +

    +
  • +
  • +

    John Bradley. Author.

  • @@ -118,19 +133,23 @@

    Authors

    +
    + + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index 43b04a0..72e376b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,11 +5,13 @@ -Semantically rich phenotypic traits from the Phenoscape Knowledgebase • rphenoscape - - - - +Semantically Rich Phenotypic Traits from the Phenoscape Knowledgebase • rphenoscape + + + + + + - - -
    + +
    -
    - - - - +
    +
      -
    • Author: Hong Xu, Hilmar Lapp
    • +
    • Author: Hong Xu, Hilmar Lapp, John Bradley
    • Maintainer: Hilmar Lapp
    -

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

    +

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

    Installation

    -

    The development version of RPhenoscape is available on Github. It has not yet been released to CRAN. To install RPhenoscape from Github, use the install_github() function in the remotes package (which can be installed from CRAN using install.packages()):

    -
    remotes::install_github("phenoscape/rphenoscape")
    +

    The development version of RPhenoscape is available on Github. It has not yet been released to CRAN. To install RPhenoscape from Github, use the install_github() function in the remotes package (which can be installed from CRAN using install.packages()):

    +
    +remotes::install_github("phenoscape/rphenoscape")

    By default, this will skip building the package vignettes. To build and install package vignettes as well, you must have recent versions of the knitr and rmarkdown packages installed, and use additional parameters, depending on the version of the remotes package you have installed, to request building vignettes.

    -
    packageVersion("remotes")
    -
    [1] '2.0.4'
    +
    +packageVersion("remotes")
    +
    [1] '2.1.1'

    If the version is 2.1.0 or higher, use the build_vignettes parameter (which by default is FALSE):

    -
    remotes::install_github("phenoscape/rphenoscape", build_vignettes = TRUE)
    +
    +remotes::install_github("phenoscape/rphenoscape", build_vignettes = TRUE)

    If the version of remotes is lower, use the build_opts parameter:

    -
    remotes::install_github("phenoscape/rphenoscape", build_opts=c("--no-manual"))
    +
    +remotes::install_github("phenoscape/rphenoscape", build_opts=c("--no-manual"))

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

    -
    library(rphenoscape)
    +

    @@ -116,17 +118,18 @@

  • Subsetting matrices by taxonomic subgroup or anatomical part
  • Searching for details for a given taxon
  • +

    By definition, most functions in this package connect to the Phenoscape Knowledgebase API. The base URL path to the API endpoints can changed from the default by setting the PHENOSCAPE_API environment variable. (See R Startup and RStudio support on .Renviron on how to control environment variables at R session startup.)


    Phenoscape Knowledgebase

    - + diff --git a/docs/pkgdown.css b/docs/pkgdown.css index c03fb08..1273238 100644 --- a/docs/pkgdown.css +++ b/docs/pkgdown.css @@ -17,12 +17,14 @@ html, body { height: 100%; } +body { + position: relative; +} + body > .container { display: flex; height: 100%; flex-direction: column; - - padding-top: 60px; } body > .container .row { @@ -69,6 +71,10 @@ summary { margin-top: calc(-60px + 1em); } +dd { + margin-left: 3em; +} + /* Section anchors ---------------------------------*/ a.anchor { @@ -102,37 +108,135 @@ a.anchor { margin-top: -40px; } -/* Static header placement on mobile devices */ -@media (max-width: 767px) { - .navbar-fixed-top { - position: absolute; - } - .navbar { - padding: 0; - } +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; } +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} /* Sidebar --------------------------*/ -#sidebar { +#pkgdown-sidebar { margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; } -#sidebar h2 { + +#pkgdown-sidebar h2 { font-size: 1.5em; margin-top: 1em; } -#sidebar h2:first-child { +#pkgdown-sidebar h2:first-child { margin-top: 0; } -#sidebar .list-unstyled li { +#pkgdown-sidebar .list-unstyled li { margin-bottom: 0.5em; } +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + .orcid { - height: 16px; + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; vertical-align: middle; } @@ -140,14 +244,14 @@ a.anchor { .ref-index th {font-weight: normal;} -.ref-index td {vertical-align: top;} +.ref-index td {vertical-align: top; min-width: 100px} .ref-index .icon {width: 40px;} .ref-index .alias {width: 40%;} .ref-index-icons .alias {width: calc(40% - 40px);} .ref-index .title {width: 60%;} .ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} .ref-arguments .name {width: 20%;} .ref-arguments .desc {width: 80%;} @@ -222,6 +326,19 @@ a.sourceLine:hover { visibility: visible; } +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + /* mark.js ----------------------------*/ mark { @@ -234,3 +351,17 @@ mark { .html-widget { margin-bottom: 10px; } + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index eb7e83d..7e7048f 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,18 +2,11 @@ (function($) { $(function() { - $("#sidebar") - .stick_in_parent({offset_top: 40}) - .on('sticky_kit:bottom', function(e) { - $(this).parent().css('position', 'static'); - }) - .on('sticky_kit:unbottom', function(e) { - $(this).parent().css('position', 'relative'); - }); + $('.navbar-fixed-top').headroom(); - $('body').scrollspy({ - target: '#sidebar', - offset: 60 + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); }); $('[data-toggle="tooltip"]').tooltip(); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index e158a6b..58579c2 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,8 +1,9 @@ pandoc: 1.19.2.1 -pkgdown: 1.3.0 +pkgdown: 1.6.1 pkgdown_sha: ~ articles: rphenoscape: rphenoscape.html +last_built: 2021-03-31T19:31Z urls: reference: http://rphenoscape.phenoscape.org/reference article: http://rphenoscape.phenoscape.org/articles diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000..17a3580 Binary files /dev/null and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/add_provenance_record.html b/docs/reference/add_provenance_record.html index ffd8514..f63e358 100644 --- a/docs/reference/add_provenance_record.html +++ b/docs/reference/add_provenance_record.html @@ -8,21 +8,29 @@ Generate and add provenance record to nexml — add_provenance_record • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,13 +38,13 @@ - + - + @@ -50,9 +58,10 @@ + - +
    @@ -74,7 +83,7 @@ -
    +
    @@ -111,16 +120,14 @@

    Generate and add provenance record to nexml

    -

    If the content of a nexml object is modified, this function can add a provenance record documenting the modification. The provenance documentation is added to the toplevel metadata (i.e., at the "nexml" level).

    -
    -
    add_provenance_record(nexml, cmd = NA, creator = Sys.getenv("USER"))
    - +
    add_provenance_record(nexml, cmd = NA, creator = Sys.getenv("USER"))
    +

    Arguments

    @@ -141,11 +148,10 @@

    Arg software. The default is the system's USER environment variable.

    - +

    Value

    A nexml object with provenance records added.

    -

    Details

    At present, for each invocation this implementation will do the following:

      @@ -177,35 +183,33 @@

      Details ] .

    - -
    - +
    +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/anatomy_ontology_iris.html b/docs/reference/anatomy_ontology_iris.html index 42eb877..ff14469 100644 --- a/docs/reference/anatomy_ontology_iris.html +++ b/docs/reference/anatomy_ontology_iris.html @@ -8,21 +8,29 @@ Get IRIs of ontologies with anatomy terms — anatomy_ontology_iris • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,13 +38,13 @@ - + - + @@ -50,9 +58,10 @@ + - +
    @@ -74,7 +83,7 @@ -
    +
    @@ -111,45 +120,44 @@

    Get IRIs of ontologies with anatomy terms

    -

    Obtains the IRIs of anatomical entity ontologies in the Phenoscape KB. Note that this will normally include the Gene Ontology (GO), because it contains a substantial number of anatomical entity terms in its subcellular location branch.

    -
    -
    anatomy_ontology_iris()
    - +
    anatomy_ontology_iris()
    + +

    Value

    A character vector

    -
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/corpus_size.html b/docs/reference/corpus_size.html index 61a3e04..94162a1 100644 --- a/docs/reference/corpus_size.html +++ b/docs/reference/corpus_size.html @@ -8,21 +8,29 @@ Obtain the size of different corpora — corpus_size • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,15 +118,13 @@

    Obtain the size of different corpora

    -

    Obtains the size of a certain number of predefined corpora. The total size of a corpus is important for calculating term frequencies.

    -
    -
    corpus_size(corpus = c("taxon_annotations", "taxa", "gene_annotations",
    -  "genes"))
    - +
    corpus_size(corpus = c("taxon_annotations", "taxa", "gene_annotations",
    +  "genes"))
    +

    Arguments

    @@ -129,49 +136,45 @@

    Arg acceptable.

    - +

    Value

    the size of the specified corpus as an integer number.

    -

    Details

    Corpus sizes are cached per session after they have first been obtained. Thus, if the Phenoscape KB changes, a session needs to be restarted to have those changes be reflected.

    -

    Examples

    -
    corpus_size("taxa")
    #> [1] 752
    corpus_size("taxon_annotations")
    #> [1] 805354
    +
    corpus_size("taxa") +
    #> [1] 785
    corpus_size("taxon_annotations") +
    #> [1] 809892
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/find_term.html b/docs/reference/find_term.html index 6fee2f5..d278a29 100644 --- a/docs/reference/find_term.html +++ b/docs/reference/find_term.html @@ -8,21 +8,29 @@ Find terms matching a query text — find_term • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,16 +118,14 @@

    Find terms matching a query text

    -

    Searches the KB for terms matching the given text, and returns the result(s) as a data frame (see Value).

    -
    -
    find_term(query, type = NA, definedBy = quote(!is.na(.)),
    -  matchBy = NA, matchTypes = NA, nomatch = NA, limit = 100,
    -  verbose = FALSE)
    - +
    find_term(query, type = NA, definedBy = quote(!is.na(.)),
    +  matchBy = NA, matchTypes = NA, nomatch = NA, limit = 100,
    +  verbose = FALSE)
    +

    Arguments

    @@ -148,13 +155,13 @@

    Arg to match. Provide as IRIs or using common namespace prefixes. The default is NA, which will use the remote API's default, currently "rdfs:label", "oboInOwl:hasExactSynonym", "oboInOwl:NarrowSynonym", and -"oboInOwl:hasBroadSynonym". To match only against label, use c("rdfs:label").

    +"oboInOwl:hasBroadSynonym". To match only against label, use c("rdfs:label").

    +Use c("exact") to accept exact matches only.

    @@ -171,46 +178,42 @@

    Arg

    matchTypes

    character, the types of matches (exact, partial, broad) to accept. By default (value NA), no filtering by match type is performed. -Use c("exact") to accept exact matches only.

    nomatch

    logical; whether to issue a message if no matches found

    - +

    Value

    A data frame with columns "id", "label", "isDefinedBy", and "matchType" and one row for each term match.

    -

    Details

    Matches can be filtered by type of term (class, property, etc), ontology in which the term is defined, and by type of match (exact, partial, etc). The term properties considered for matching can also be controlled.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/get_KBinfo.html b/docs/reference/get_KBinfo.html index 13a96f7..e60a3af 100644 --- a/docs/reference/get_KBinfo.html +++ b/docs/reference/get_KBinfo.html @@ -8,21 +8,29 @@ Summary and metadata about the Phenoscape KB — get_KBinfo • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,17 +118,15 @@

    Summary and metadata about the Phenoscape KB

    -

    Returns the date of the current release of the Phenoscape Knowledgebase (KB) and counts of annotated matrices, taxa, phenotypes, characters, and states.

    -
    -
    get_KBinfo()
    +    
    get_KBinfo()
     
     # S3 method for KBinfo
    -print(x, ..., tz = "")
    - +print(x, ..., tz = "")
    +

    Arguments

    @@ -138,48 +145,47 @@

    Arg local timezone

    - +

    Value

    A list of class "KBinfo" with summary statistics of annotation counts and other KB metadata (specifically, a timestamp for the current KB build).

    -

    Examples

    -
    kbmeta <- get_KBinfo() -names(kbmeta)
    #> [1] "annotated_taxa" "annotated_characters" "annotated_matrices" -#> [4] "annotated_states" "build_time"
    kbmeta
    #> Annotated taxa: 6118 -#> Annotated characters: 12724 -#> Annotated matrices: 217 -#> Annotated states: 26407 -#> Build time: 2019-12-03 15:19:58 EST
    +
    kbmeta <- get_KBinfo() +names(kbmeta) +
    #> [1] "annotated_taxa" "annotated_characters" "annotated_matrices" +#> [4] "annotated_states" "build_time"
    kbmeta +
    #> Annotated taxa: 6206 +#> Annotated characters: 13364 +#> Annotated matrices: 230 +#> Annotated states: 26905 +#> Build time: 2020-04-08 16:37:21 EDT
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/get_data.html b/docs/reference/get_data.html index cbc4472..9341056 100644 --- a/docs/reference/get_data.html +++ b/docs/reference/get_data.html @@ -8,21 +8,29 @@ Get data from an API endpoint — get_data • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,18 +118,17 @@

    Get data from an API endpoint

    -

    Obtains and parses data from JSON, CSV, and NeXML-returning API endpoints, respectively.

    -
    -
    get_json_data(url, query, verbose = FALSE, ensureNames = NULL)
    +    
    get_json_data(url, query, verbose = FALSE, ensureNames = NULL,
    +  forceGET = FALSE)
    +
    +get_csv_data(url, query, ..., verbose = FALSE, forceGET = FALSE)
     
    -get_csv_data(url, query, ..., verbose = FALSE)
    +get_nexml_data(url, query, verbose = FALSE, forceGET = FALSE)
    -get_nexml_data(url, query, verbose = FALSE)
    -

    Arguments

    @@ -141,53 +149,56 @@

    Arg

    + + + + +read.csv()

    character, which column or list names to ensure are included in the result to be returned. If result returned by the API endpoint does not include them, they will be added, with NA values.

    forceGET

    logical, whether to force using the HTTP GET method for API +access regardless of request length. The default is FALSE, meaning queries +exceeding a certain size for transmission will automatically use HTTP POST +for accessing the KB API.

    ...

    for get_csv_data, additional parameters to be passed on to -read.csv()

    - +

    Value

    For get_json_data, a data frame or list, depending on the result of -jsonlite::fromJSON().

    +jsonlite::fromJSON().

    For get_csv_data, a data frame.

    For get_nexml_data, a nexml object.

    -

    Details

    These are package-internal functions.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/get_phenotypes.html b/docs/reference/get_phenotypes.html index 2e16f4e..bb18fdf 100644 --- a/docs/reference/get_phenotypes.html +++ b/docs/reference/get_phenotypes.html @@ -8,21 +8,29 @@ Retrieve phenotypes by entity, quality, taxon, and study — get_phenotypes • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,14 +38,14 @@ - + - + @@ -51,9 +59,10 @@ + - +
    @@ -75,7 +84,7 @@ -
    +
    @@ -112,18 +121,16 @@

    Retrieve phenotypes by entity, quality, taxon, and study

    -

    Retrieves "semantic phenotypes", i.e., phenotypes encoded as ontological expressions. Filtering is possible by anatomical entity (optionally including entities related by certain properties, see includeRels), phenotypic quality, taxonomic group where the phenotypes have been recorded, and study (a.k.a. publication).

    -
    -
    get_phenotypes(entity = NA, quality = NA, taxon = NA, study = NA,
    -  includeRels = c("part of"), .withTaxon = FALSE, verbose = FALSE)
    - +
    get_phenotypes(entity = NA, quality = NA, taxon = NA, study = NA,
    +  includeRels = c("part of"), .withTaxon = FALSE, verbose = FALSE)
    +

    Arguments

    @@ -167,7 +174,7 @@

    Arg time-consuming operations. Default is FALSE.

    - +

    Value

    A data frame with columns "id" and "label".

    @@ -176,82 +183,77 @@

    Value

    (phenotypes, taxon) tuples will be unique, both phenotypes and taxa individually will then be redundant in the returned data frame (the association is n:n).

    -

    Details

    Entity, quality, and taxon can be given as IRI or as name (i.e, term label). In the latter case, names will be resolved to IRIs against anatomy ontologies, PATO, and taxonomy ontologies, respectively. Warnings will be issued if only a partial match can be found. The study must be given as IRI.

    -

    Examples

    -
    # NOT RUN {
    -phens1 <- get_phenotypes(entity = "pelvic fin")
    -head(phens1)
    +    
    if (FALSE) { +phens1 <- get_phenotypes(entity = "pelvic fin") +head(phens1) # by default, parts are already included -phens2 <- get_phenotypes(entity = "pelvic fin", includeRels = c("part")) -nrow(phens1) == nrow(phens2) -table(phens2$id %in% phens1$id) +phens2 <- get_phenotypes(entity = "pelvic fin", includeRels = c("part")) +nrow(phens1) == nrow(phens2) +table(phens2$id %in% phens1$id) # but historical homologues are not -phens2 <- get_phenotypes(entity = "pelvic fin", includeRels = c("part", "hist")) -table(phens2$id %in% phens1$id) +phens2 <- get_phenotypes(entity = "pelvic fin", includeRels = c("part", "hist")) +table(phens2$id %in% phens1$id) # neither are serially homologous -phens2 <- get_phenotypes(entity = "pelvic fin", includeRels = TRUE) -table(phens2$id %in% phens1$id) +phens2 <- get_phenotypes(entity = "pelvic fin", includeRels = TRUE) +table(phens2$id %in% phens1$id) # filter also by quality -phens2 <- get_phenotypes(entity = "pelvic fin", quality = "shape") -table(phens1$id %in% phens2$id) +phens2 <- get_phenotypes(entity = "pelvic fin", quality = "shape") +table(phens1$id %in% phens2$id) # filter also by quality and taxon -phens2 <- get_phenotypes(entity = "pelvic fin", quality = "shape", taxon = "Siluriformes") -table(phens1$id %in% phens2$id) +phens2 <- get_phenotypes(entity = "pelvic fin", quality = "shape", taxon = "Siluriformes") +table(phens1$id %in% phens2$id) # filter by entity, quality and taxon, and return taxa as well (resulting in # (phenotype, taxon) "tuples") -phens2a <- get_phenotypes(entity = "pelvic fin", quality = "shape", taxon = "Siluriformes", - .withTaxon = TRUE) -head(phens2a) -nrow(phens2a) - nrow(phens2) # lots of redundancy due to n:n relationship -nrow(unique(phens2a[,c("id", "label")])) == nrow(phens2) # but same #phenotypes +phens2a <- get_phenotypes(entity = "pelvic fin", quality = "shape", taxon = "Siluriformes", + .withTaxon = TRUE) +head(phens2a) +nrow(phens2a) - nrow(phens2) # lots of redundancy due to n:n relationship +nrow(unique(phens2a[,c("id", "label")])) == nrow(phens2) # but same #phenotypes # can compute and visualize similarity -sm <- jaccard_similarity(terms = phens2$id, .labels = phens2$label, .colnames = "label") -plot(hclust(as.dist(1-sm))) -# }
    +sm <- jaccard_similarity(terms = phens2$id, .labels = phens2$label, .colnames = "label") +plot(hclust(as.dist(1-sm))) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/get_term_label.html b/docs/reference/get_term_label.html index b4c82c5..2d325bc 100644 --- a/docs/reference/get_term_label.html +++ b/docs/reference/get_term_label.html @@ -8,21 +8,29 @@ Obtains the labels for a list of terms — get_term_label • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    @@ -110,15 +119,13 @@

    Obtains the labels for a list of terms

    -

    Attempts to obtain the label for each term, identified by IRI, in the input list. Terms for which no label is found in the database will have NA as the label in the result (see Value).

    -
    -
    get_term_label(term_iris, preserveOrder = FALSE, verbose = FALSE)
    - +
    get_term_label(term_iris, preserveOrder = FALSE, verbose = FALSE)
    +

    Arguments

    @@ -138,39 +145,38 @@

    Arg time-consuming operations.

    - +

    Value

    A data.frame with columns "id" and "label". The "id" column contains the IRIs. The label will be NA for term IRIs that are not present in the KB, or for which the KB cannot produce a label.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 9b20bfa..5601196 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -8,21 +8,29 @@ Function reference • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,12 @@ + + @@ -44,9 +54,10 @@ + - +
    @@ -68,7 +79,7 @@ -
    + +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/nexml_drop.html b/docs/reference/nexml_drop.html index 76036dc..1fa7463 100644 --- a/docs/reference/nexml_drop.html +++ b/docs/reference/nexml_drop.html @@ -8,21 +8,29 @@ Drop parts of a nexml object — nexml_drop • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -62,9 +70,10 @@ + - +
    @@ -86,7 +95,7 @@ -
    +
    @@ -123,11 +132,10 @@

    Drop parts of a nexml object

    -

    nexml_drop_otu drops OTUs (taxa) from a nexml object. Currently none of the OTUs to be dropped can be used in a tree that's part of the nexml object. If they are, first drop the OTUs from the tree(s) -(for example, using drop.tip() from package "ape"), then +(for example, using drop.tip() from package "ape"), then replace the tree(s). Dropping OTUs will not only drop them from the OTUs block, but will also drop matrix rows that referenced the OTUs to be dropped. This may in turn leave some characters unused. Therefore, it is recommended @@ -140,18 +148,17 @@

    Drop parts of a nexml object

    unused characters.

    is_unused_otu is a filter function for nexml_drop_otu for dropping unused OTUs.

    -
    -
    nexml_drop_otu(nexml, filter, at = NA, block = 1, ...)
    +    
    nexml_drop_otu(nexml, filter, at = NA, block = 1, ...)
    +
    +nexml_drop_char(nexml, filter, at = NA, block = 1, ...,
    +  pruneStates = TRUE, pruneRows = TRUE)
     
    -nexml_drop_char(nexml, filter, at = NA, block = 1, ...,
    -  pruneStates = TRUE, pruneRows = TRUE)
    +is_unused_char(charList, ...)
     
    -is_unused_char(charList, ...)
    +is_unused_otu(otuList, ...)
    -is_unused_otu(otuList, ...)
    -

    Arguments

    @@ -218,7 +225,7 @@

    Arg to filter on.

    - +

    Value

    The functions for dropping components return a nexml @@ -230,12 +237,12 @@

    Value

    object that is not used in either the matrix (or matrices) of the characters block(s), or, unless ignoreTrees = TRUE, for a node of a tree, and FALSE otherwise.

    -

    Examples

    -
    nex <- RNeXML::nexml_read(system.file("examples", "ontotrace-result.xml", package = "rphenoscape")) +
    nex <- RNeXML::nexml_read(system.file("examples", "ontotrace-result.xml", package = "rphenoscape")) # drop by label matching -nexml_drop_otu(nex, filter = function(x) grepl(" sp.", x), at = "label")
    #> A nexml object representing: +nexml_drop_otu(nex, filter = function(x) grepl(" sp.", x), at = "label") +
    #> A nexml object representing: #> 1 phylogenetic tree block(s), where: #> block 1 contains 0 phylogenetic tree(s) #> 1 character block(s), where: @@ -260,15 +267,15 @@

    Examp #> NeXML generated by RNeXML using schema version: 0.9 #> Size: 209.6 Kb

    # can pipe dropping and then removing potentially unused characters or OTUs: -library(dplyr)
    #> -#> Attaching package: ‘dplyr’
    #> The following object is masked from ‘package:testthat’: -#> -#> matches
    #> The following objects are masked from ‘package:stats’: +library(dplyr) +
    #> +#> Attaching package: ‘dplyr’
    #> The following objects are masked from ‘package:stats’: #> #> filter, lag
    #> The following objects are masked from ‘package:base’: #> -#> intersect, setdiff, setequal, union
    nexml_drop_char(nex, filter = function(x) grepl("pelvic", x), at = "label") %>% - nexml_drop_otu(filter = is_unused_otu)
    #> A nexml object representing: +#> intersect, setdiff, setequal, union
    nexml_drop_char(nex, filter = function(x) grepl("pelvic", x), at = "label") %>% + nexml_drop_otu(filter = is_unused_otu) +
    #> A nexml object representing: #> 1 phylogenetic tree block(s), where: #> block 1 contains 0 phylogenetic tree(s) #> 1 character block(s), where: @@ -294,48 +301,47 @@

    Examp #> #> NeXML generated by RNeXML using schema version: 0.9 #> Size: 205.8 Kb

    -
    # NOT RUN { -nex <- pk_get_ontotrace_xml(taxon = "Ictaluridae", - entity = "fin", variable_only = FALSE) +if (FALSE) { +nex <- pk_get_ontotrace_xml(taxon = "Ictaluridae", + entity = "fin", variable_only = FALSE) # ontotrace results store VTO IRIs in dwc:taxonID annotations: -nexml_drop_otu(nex, - filter = function(x) !pk_is_descendant("Ictalurus", x), - at = "dwc:taxonID") %>% - nexml_drop_char(filter = is_unused_char) +nexml_drop_otu(nex, + filter = function(x) !pk_is_descendant("Ictalurus", x), + at = "dwc:taxonID") %>% + nexml_drop_char(filter = is_unused_char) # anatomy IRIs are in obo:IAO_0000219 ("denotes") annotations: -nexml_drop_char(nex, - filter = function(x) - !pk_is_descendant("paired fin", x, includeRels = "part_of"), - at = "obo:IAO_0000219") %>% - nexml_drop_otu(filter = is_unused_otu) -# }
    +nexml_drop_char(nex, + filter = function(x) + !pk_is_descendant("paired fin", x, includeRels = "part_of"), + at = "obo:IAO_0000219") %>% + nexml_drop_otu(filter = is_unused_otu) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/obo_prefix.html b/docs/reference/obo_prefix.html index 8f16504..59fabdd 100644 --- a/docs/reference/obo_prefix.html +++ b/docs/reference/obo_prefix.html @@ -8,21 +8,29 @@ Extract the OBO ontology prefix from IRIs — obo_prefix • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,13 +117,11 @@

    Extract the OBO ontology prefix from IRIs

    -

    Extract the OBO ontology prefix from IRIs

    -
    -
    obo_prefix(x)
    - +
    obo_prefix(x)
    +

    Arguments

    @@ -123,48 +130,46 @@

    Arg

    a list or vector of IRIs, and/or objects that have an "id" key.

    - +

    Value

    A character vector of the same length as the input vector or list, with NA in the positions where extracting the OBO ontology prefix failed.

    -

    Examples

    -
    tt <- c("http://purl.obolibrary.org/obo/UBERON_0011618", +
    tt <- c("http://purl.obolibrary.org/obo/UBERON_0011618", "http://purl.obolibrary.org/obo/PATO_0002279", "http://purl.obolibrary.org/obo/VTO_0071642", "http://purl.obolibrary.org/obo/MP_0030825", - "http://purl.obolibrary.org/obo/NCBITaxon_7955") -obo_prefix(tt)
    #> [1] "UBERON" "PATO" "VTO" "MP" "NCBITaxon"
    + "http://purl.obolibrary.org/obo/NCBITaxon_7955") +obo_prefix(tt) +
    #> [1] "UBERON" "PATO" "VTO" "MP" "NCBITaxon"
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pa_dep_matrix.html b/docs/reference/pa_dep_matrix.html index 353bd04..e4010f5 100644 --- a/docs/reference/pa_dep_matrix.html +++ b/docs/reference/pa_dep_matrix.html @@ -8,21 +8,29 @@ Obtains a presence-absence dependency matrix — pa_dep_matrix • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -53,9 +61,10 @@ + - +
    @@ -77,7 +86,7 @@ -
    +
    @@ -114,7 +123,6 @@

    Obtains a presence-absence dependency matrix

    -

    Obtains a presence-absence dependency matrix for the given set of terms. The resulting matrix M will have values 1 and 0, where M[i,j] = 1 iff the presence if term i implies the presence of term j. Note that it follows that @@ -122,12 +130,11 @@

    Obtains a presence-absence dependency matrix

    Note also that the matrix is asymmetric; that is, M[i,j] = 1 does not imply M[j,i] = 1 for \(i\neq j\). Terms i and j (\(i\neq j\)) for which M[i,j] = M[j,i] = 1 are sometimes referred to as super-dependent.

    -
    -
    pa_dep_matrix(terms, .names = c("ID", "IRI", "label"), .labels = NULL,
    -  preserveOrder = FALSE, verbose = FALSE)
    - +
    pa_dep_matrix(terms, .names = c("ID", "IRI", "label"), .labels = NULL,
    +  preserveOrder = FALSE, verbose = FALSE)
    +

    Arguments

    @@ -168,7 +175,7 @@

    Arg potentially time-consuming operations.

    - +

    Value

    A data.fram M with M[i,j] = 1 iff the presence of term i implies the @@ -180,51 +187,49 @@

    Value

    have attribute term.iris, giving the term IRIs for the rows (and columns). Note that these extra attributes will be lost upon subsetting the returned matrix.

    -

    Examples

    -
    # NOT RUN {
    -tl <- c("http://purl.obolibrary.org/obo/UBERON_0000981",
    +    
    if (FALSE) { +tl <- c("http://purl.obolibrary.org/obo/UBERON_0000981", "http://purl.obolibrary.org/obo/UBERON_0002103", "http://purl.obolibrary.org/obo/UBERON_0000976", - "http://purl.obolibrary.org/obo/UBERON_0002102") -m <- pa_dep_matrix(tl) -m # term IDs as row and column names -id_prefixes <- attr(m, "prefixes") -id_prefixes # 4x "http://purl.obolibrary.org/obo/" - -m <- pa_dep_matrix(tl, .names = "label") -m # term labels as row and column names -mat_terms <- attr(m, "term.iris") -mat_terms # term IRIs in the same order as rows (and columns) -# }
    + "http://purl.obolibrary.org/obo/UBERON_0002102") +m <- pa_dep_matrix(tl) +m # term IDs as row and column names +id_prefixes <- attr(m, "prefixes") +id_prefixes # 4x "http://purl.obolibrary.org/obo/" + +m <- pa_dep_matrix(tl, .names = "label") +m # term labels as row and column names +mat_terms <- attr(m, "term.iris") +mat_terms # term IRIs in the same order as rows (and columns) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/phenotype.html b/docs/reference/phenotype.html index dcf85b9..2ec58df 100644 --- a/docs/reference/phenotype.html +++ b/docs/reference/phenotype.html @@ -8,21 +8,29 @@ Phenotype Objects — phenotype • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -60,9 +68,10 @@ + - +
    @@ -84,7 +93,7 @@ -
    +
    @@ -121,7 +130,6 @@

    Phenotype Objects

    -

    as.phenotype creates an object (or a list of objects) of type "phenotype". The object to be coerced can be a character vector (of IRIs), or a data.frame. In the latter case, there must be a column "id" with the IRIs of phenotypes. @@ -136,25 +144,24 @@

    Phenotype Objects

    chars extracts the (non-redundant) characters from the phenotype object (or an object coercible to phenotype).

    print pretty-prints objects of type "phenotype"

    -
    -
    as.phenotype(x, withTaxa = FALSE, ...)
    +    
    as.phenotype(x, withTaxa = FALSE, ...)
     
     # S3 method for data.frame
    -as.phenotype(x, ...)
    +as.phenotype(x, ...)
     
    -is.phenotype(x)
    +is.phenotype(x)
     
    -is_valid_phenotype(x)
    +is_valid_phenotype(x)
     
    -charstates(x)
    +charstates(x)
     
    -chars(x)
    +chars(x)
     
     # S3 method for phenotype
    -print(x, ...)
    - +print(x, ...)
    +

    Arguments

    @@ -174,7 +181,7 @@

    Arg

    additional parameters where applicable; ignored for printing

    - +

    Value

    as.phenotype returns and object of type "phenotype", or a list of such objects @@ -202,18 +209,19 @@

    Value

    chars returns a data.frame with collumns "character.id" and "character.label" (IRI and label of the character), and "study.id" and "study.label" (IRI and short label for the study to which the character and state belong).

    -

    Details

    Create and test objects of type "phenotype", and extract properties from them.

    -

    Examples

    # query for a set of phenotypes (IDs and their labels) -phens <- get_phenotypes(entity = "basihyal bone") -nrow(phens)
    #> [1] 19
    # turn one into a phenotype object -obj <- as.phenotype(phens[3, "id"]) -class(obj)
    #> [1] "phenotype" "list"
    obj
    #> Phenotype 'basihyal bone absent' +phens <- get_phenotypes(entity = "basihyal bone") +nrow(phens) +
    #> [1] 20
    # turn one into a phenotype object +obj <- as.phenotype(phens[3, "id"]) +class(obj) +
    #> [1] "phenotype" "list"
    obj +
    #> Phenotype 'basihyal bone absent' #> Linked to states: #> label character.label study.label #> 1 states 0, 1 and 2 Basihyal Imamura et al. (2005) @@ -230,7 +238,8 @@

    Examp #> #> No information about taxa exhibiting this phenotype.

    # optionally include taxa exhibiting the phenotype -as.phenotype(phens[3,], withTaxa = TRUE)
    #> Phenotype 'basihyal bone absent' +as.phenotype(phens[3,], withTaxa = TRUE) +
    #> Phenotype 'basihyal bone absent' #> Linked to states: #> label character.label study.label #> 1 states 0, 1 and 2 Basihyal Imamura et al. (2005) @@ -252,7 +261,8 @@

    Examp #> 4 http://purl.obolibrary.org/obo/VTO_0052740 Hemitripterus villosus #> 5 http://purl.obolibrary.org/obo/VTO_0052539 Liparis agassizii #> [ reached 'max' / getOption("max.print") -- omitted 6 rows ]

    # full list of taxa: -as.phenotype(phens[3,], withTaxa = TRUE)$taxa
    #> id label +as.phenotype(phens[3,], withTaxa = TRUE)$taxa +
    #> id label #> 1 http://purl.obolibrary.org/obo/VTO_0035423 Corydoras rabauti #> 2 http://purl.obolibrary.org/obo/VTO_0052870 Enophrys diceraus #> 3 http://purl.obolibrary.org/obo/VTO_0071753 Eumicrotremus asperrimus @@ -265,8 +275,12 @@

    Examp #> 10 http://purl.obolibrary.org/obo/VTO_0034991 Siluriformes #> 11 http://purl.obolibrary.org/obo/VTO_0036124 Silurus glanis

    # can also coerce entire list at once -objs <- as.phenotype(phens) -class(objs)
    #> [1] "list"
    length(objs)
    #> [1] 19
    all(sapply(objs, is.phenotype))
    #> [1] TRUE
    objs[[3]]
    #> Phenotype 'basihyal bone absent' +objs <- as.phenotype(phens) +class(objs) +
    #> [1] "list"
    length(objs) +
    #> [1] 20
    all(sapply(objs, is.phenotype)) +
    #> [1] TRUE
    objs[[3]] +
    #> Phenotype 'basihyal bone absent' #> Linked to states: #> label character.label study.label #> 1 states 0, 1 and 2 Basihyal Imamura et al. (2005) @@ -283,86 +297,76 @@

    Examp #> #> No information about taxa exhibiting this phenotype.

    # extract character states and (non-redundant) characters -charstates(obj)
    #> id -#> 1 http://purl.org/phenoscape/uuid/aad2b9ab-d755-41c3-b0d4-07828af709bd -#> 2 http://purl.org/phenoscape/uuid/d432b4d8-f351-40bc-8dde-bf14aaa1cbd1 -#> 3 http://purl.org/phenoscape/uuid/302e3faf-9ac3-40c7-936a-047249b3c8cf -#> 4 http://purl.org/phenoscape/uuid/559715cf-1fcf-48e0-bd5f-0f4d3f06fded +charstates(obj) +
    #> id +#> 1 http://purl.org/phenoscape/uuid/62b5a920-8b49-42be-86f9-baab28a601fc +#> 2 http://purl.org/phenoscape/uuid/eb9a3385-bd7f-46a8-ac8f-ac109e8e0e3c +#> 3 http://purl.org/phenoscape/uuid/78fa240f-904b-4018-89e9-07c1550539fc +#> 4 http://purl.org/phenoscape/uuid/5b7b3d47-890a-4bf7-be90-61417c3d1bf3 #> label #> 1 states 0, 1 and 2 #> 2 absent (unordered) #> 3 Absent #> 4 basihyal absent #> character.id -#> 1 http://purl.org/phenoscape/uuid/1d8251ad-2454-4d7a-8b59-f4a425332003 -#> 2 http://purl.org/phenoscape/uuid/1d8251ad-2454-4d7a-8b59-f4a425332003 -#> 3 http://purl.org/phenoscape/uuid/6a9cc2f1-88c0-419a-8bca-0bb3918e7bb0 -#> 4 http://purl.org/phenoscape/uuid/b54a1da4-4e8f-4495-8c29-6a05d4d7c6bb -#> character.label -#> 1 Basihyal -#> 2 Basihyal -#> 3 Basihyal bone -#> 4 Basihyal -#> study.id -#> 1 http://dx.doi.org/10.1007/s10228-005-0282-6 -#> 2 http://dx.doi.org/10.1007/s10228-005-0282-6 -#> 3 http://specifyassets.nhm.ku.edu/Ichthyology/originals/sp68693518805352821487.att.pdf -#> 4 https://scholar.google.com/scholar?q=Higher-level+Phylogeny+of+Siluriformes%2C+With+a+New+Classification+of+the+Order+%28Teleostei%2C+Ostariophysi%29&btnG=&hl=en&as_sdt=0%2C42 +#> 1 http://purl.org/phenoscape/uuid/44a9193e-4da7-45ba-9eae-6ca060579da2 +#> 2 http://purl.org/phenoscape/uuid/44a9193e-4da7-45ba-9eae-6ca060579da2 +#> 3 http://purl.org/phenoscape/uuid/46cd66db-2454-4304-bf12-9a63aa7421ba +#> 4 http://purl.org/phenoscape/uuid/cedb8568-c69e-45b1-907c-d9a0bc677f6e +#> character.label study.id +#> 1 Basihyal http://dx.doi.org/10.1007/s10228-005-0282-6 +#> 2 Basihyal http://dx.doi.org/10.1007/s10228-005-0282-6 +#> 3 Basihyal bone http://dx.doi.org/10.11646/zootaxa.2877.1.1 +#> 4 Basihyal https://ci.nii.ac.jp/naid/10012505149/ #> study.label #> 1 Imamura et al. (2005) #> 2 Imamura et al. (2005) #> 3 Mabee et al. (2011) -#> 4 De Pinna (1993)
    chars(obj)
    #> character.id -#> 1 http://purl.org/phenoscape/uuid/1d8251ad-2454-4d7a-8b59-f4a425332003 -#> 3 http://purl.org/phenoscape/uuid/6a9cc2f1-88c0-419a-8bca-0bb3918e7bb0 -#> 4 http://purl.org/phenoscape/uuid/b54a1da4-4e8f-4495-8c29-6a05d4d7c6bb -#> character.label -#> 1 Basihyal -#> 3 Basihyal bone -#> 4 Basihyal -#> study.id -#> 1 http://dx.doi.org/10.1007/s10228-005-0282-6 -#> 3 http://specifyassets.nhm.ku.edu/Ichthyology/originals/sp68693518805352821487.att.pdf -#> 4 https://scholar.google.com/scholar?q=Higher-level+Phylogeny+of+Siluriformes%2C+With+a+New+Classification+of+the+Order+%28Teleostei%2C+Ostariophysi%29&btnG=&hl=en&as_sdt=0%2C42 +#> 4 De Pinna (1993)
    chars(obj) +
    #> character.id +#> 1 http://purl.org/phenoscape/uuid/44a9193e-4da7-45ba-9eae-6ca060579da2 +#> 3 http://purl.org/phenoscape/uuid/46cd66db-2454-4304-bf12-9a63aa7421ba +#> 4 http://purl.org/phenoscape/uuid/cedb8568-c69e-45b1-907c-d9a0bc677f6e +#> character.label study.id +#> 1 Basihyal http://dx.doi.org/10.1007/s10228-005-0282-6 +#> 3 Basihyal bone http://dx.doi.org/10.11646/zootaxa.2877.1.1 +#> 4 Basihyal https://ci.nii.ac.jp/naid/10012505149/ #> study.label #> 1 Imamura et al. (2005) #> 3 Mabee et al. (2011) #> 4 De Pinna (1993)
    -
    # NOT RUN { +if (FALSE) { # IDs that don't resolve still yield an object, but is not valid -obj <- as.phenotype("http://foo") -is.phenotype(obj) -is_valid_phenotype(obj) -# }
    +obj <- as.phenotype("http://foo") +is.phenotype(obj) +is_valid_phenotype(obj) +} + - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/phenotype_matches.html b/docs/reference/phenotype_matches.html index 07a9955..aad2514 100644 --- a/docs/reference/phenotype_matches.html +++ b/docs/reference/phenotype_matches.html @@ -8,21 +8,29 @@ Which phenotypes match filter — phenotype_matches • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,13 +117,11 @@

    Which phenotypes match filter

    -

    Determines which of one or more phenotype IDs match the given filter.

    -
    -
    phenotype_matches(x, studies)
    - +
    phenotype_matches(x, studies)
    +

    Arguments

    @@ -129,52 +136,48 @@

    Arg is allowed if it has a column labeled "id".

    - +

    Value

    a logical vector of the same length as the vector of phenotypes, with TRUE as element if the corresponding phenotype matches, and FALSE otherwise.

    -

    Details

    At present, the only supported query filter is a list of studies (as their IDs). A phenotype matches if it is linked to at least one of the studies.

    -

    Examples

    -
    x <- get_phenotypes(entity = "basihyal bone") -nrow(x)
    #> [1] 19
    # which of these are in the same study or studies as the first one? -phenotype_matches(x, pk_get_study_list(phenotype = x$id[1]))
    #> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE -#> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    +
    x <- get_phenotypes(entity = "basihyal bone") +nrow(x) +
    #> [1] 20
    # which of these are in the same study or studies as the first one? +phenotype_matches(x, pk_get_study_list(phenotype = x$id[1])) +
    #> [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE +#> [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_class.html b/docs/reference/pk_class.html index 40e9da4..4b25157 100644 --- a/docs/reference/pk_class.html +++ b/docs/reference/pk_class.html @@ -8,21 +8,29 @@ Get term classification — pk_class • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,17 +117,15 @@

    Get term classification

    -

    Return direct superclasses, direct subclasses, and equivalent classes of a given term

    -
    -
    pk_taxon_class(x, verbose = TRUE)
    +    
    pk_taxon_class(x, verbose = TRUE)
     
    -pk_anatomical_class(x, verbose = TRUE)
    +pk_anatomical_class(x, verbose = TRUE)
    +
    +pk_phenotype_class(x, verbose = TRUE)
    -pk_phenotype_class(x, verbose = TRUE)
    -

    Arguments

    @@ -131,37 +138,36 @@

    Arg

    logical: optional. If TRUE (default), informative messages printed.

    - +

    Value

    A list containing data.frame

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_get_iri.html b/docs/reference/pk_get_iri.html index ace6def..1661202 100644 --- a/docs/reference/pk_get_iri.html +++ b/docs/reference/pk_get_iri.html @@ -8,21 +8,29 @@ Resolve a text query to IRI — pk_get_iri • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,15 +118,13 @@

    Resolve a text query to IRI

    -

    Finds the term matching the query text, and returns its IRI. If the query text is already a IRI, it is returned as is.

    -
    -
    pk_get_iri(text, as, exactOnly = FALSE, nomatch = NA,
    -  verbose = FALSE)
    - +
    pk_get_iri(text, as, exactOnly = FALSE, nomatch = NA,
    +  verbose = FALSE)
    +

    Arguments

    @@ -149,46 +156,42 @@

    Arg time-consuming operations. Default is FALSE.

    - +

    Value

    The IRI if a match is found.

    -

    Details

    This uses find_term to find matches, and assumes that the term of interest is a class. If there is an exact match, its IRI will be returned. If there isn't, by default partial, and as a last resort broad, matches will also be considered, although this will result in a warning.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_get_ontotrace_xml.html b/docs/reference/pk_get_ontotrace_xml.html index 9967489..298c768 100644 --- a/docs/reference/pk_get_ontotrace_xml.html +++ b/docs/reference/pk_get_ontotrace_xml.html @@ -8,21 +8,29 @@ Obtain a synthetic presence/absence matrix — pk_get_ontotrace_xml • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    @@ -110,16 +119,14 @@

    Obtain a synthetic presence/absence matrix

    -

    Queries the Phenoscape KB for a synthetic presence/absence character matrix for the given taxa and anatomical entities, and returns the result as a nexml object (from the RNeXML package).

    -
    -
    pk_get_ontotrace_xml(taxon, entity, relation = "part of",
    -  variable_only = TRUE, strict = TRUE)
    - +
    pk_get_ontotrace_xml(taxon, entity, relation = "part of",
    +  variable_only = TRUE, strict = TRUE)
    +

    Arguments

    @@ -155,11 +162,10 @@

    Arg result in an error.

    - +

    Value

    RNeXML::nexml object

    -

    Details

    The character matrix includes both asserted and logically inferred states. The @@ -167,64 +173,60 @@

    Details also includes all parts of the entities. See parameter relation for changing this. By default, only characters that are variable across the resulting taxa are included; use variable_only to change this.

    -

    Examples

    -
    # NOT RUN {
    +    
    if (FALSE) { # one taxon (including subclasses), one entity (including subclasses and # by default its parts) -nex <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "fin") +nex <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "fin") # same as above, except do not include parts or other relationships (fin # presence/absence does not vary across Ictalurus, hence need to allow # non-variable characters) -nex <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "fin", - relation = NA, variable_only = FALSE) +nex <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "fin", + relation = NA, variable_only = FALSE) # instead of parts, include entities in develops_from relationship to the query entity -nex <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "paired fin bud", - relation = "develops from", variable_only = FALSE) +nex <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "paired fin bud", + relation = "develops from", variable_only = FALSE) # query with multiple taxa, and/or multiple entities: -nex <- pk_get_ontotrace_xml(taxon = c("Ictalurus", "Ameiurus"), - entity = c("pectoral fin", "pelvic fin")) +nex <- pk_get_ontotrace_xml(taxon = c("Ictalurus", "Ameiurus"), + entity = c("pectoral fin", "pelvic fin")) # Use the RNeXML API to obtain the character matrix etc: -m <- RNeXML::get_characters(nex) -dim(m) # number of taxa and characters -rownames(m) # taxon names -colnames(m) # characters (entity names) +m <- RNeXML::get_characters(nex) +dim(m) # number of taxa and characters +rownames(m) # taxon names +colnames(m) # characters (entity names) -# }
    +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_get_study.html b/docs/reference/pk_get_study.html index 661ce1b..a0e28e6 100644 --- a/docs/reference/pk_get_study.html +++ b/docs/reference/pk_get_study.html @@ -8,21 +8,29 @@ pk_get_study — pk_get_study • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,13 +117,11 @@

    pk_get_study

    -

    pk_get_study

    -
    -
    pk_get_study(nexmls)
    - +
    pk_get_study(nexmls)
    +

    Arguments

    @@ -123,46 +130,44 @@

    Arg

    a list of nexml objects

    - +

    Value

    A list of data.frames containing matrices

    -

    Examples

    -
    # NOT RUN {
    -slist <- pk_get_study_list(taxon = "Ameiurus", entity = "pelvic splint")
    -nex_list <- pk_get_study_xml(slist$id) # get the list of NeXML objects for the studies
    -pk_get_study(nex_list) # retrieve the study matrices
    -pk_get_study_meta(nex_list) # retrieve the meta data for the studies
    -# }
    +
    if (FALSE) { +slist <- pk_get_study_list(taxon = "Ameiurus", entity = "pelvic splint") +nex_list <- pk_get_study_xml(slist$id) # get the list of NeXML objects for the studies +pk_get_study(nex_list) # retrieve the study matrices +pk_get_study_meta(nex_list) # retrieve the meta data for the studies +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_get_study_list.html b/docs/reference/pk_get_study_list.html index 08689b1..0d84b34 100644 --- a/docs/reference/pk_get_study_list.html +++ b/docs/reference/pk_get_study_list.html @@ -8,21 +8,29 @@ Query the list of studies by taxa, anatomical entities, and qualities. — pk_get_study_list • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    @@ -110,16 +119,14 @@

    Query the list of studies by taxa, anatomical entities, and qualities.

    -

    Return studies that contain taxa which are members of the optional input taxon, and characters which have phenotype annotations subsumed by the given entity and quality terms.

    -
    -
    pk_get_study_list(taxon = NA, entity = NA, quality = NA,
    -  phenotype = NA, includeRels = NA, relation = "part of")
    - +
    pk_get_study_list(taxon = NA, entity = NA, quality = NA,
    +  phenotype = NA, includeRels = NA, relation = "part of")
    +

    Arguments

    @@ -157,73 +164,71 @@

    Arg part of. Only used if includeRels is left at its default value.

    - +

    Value

    data.frame

    -

    Examples

    -
    # NOT RUN {
    +    
    if (FALSE) { # by default, parts are included -slist <- pk_get_study_list(taxon = "Siluridae", entity = "fin") -colnames(slist) -nrow(slist) +slist <- pk_get_study_list(taxon = "Siluridae", entity = "fin") +colnames(slist) +nrow(slist) # can also disable parts -slist <- pk_get_study_list(taxon = "Siluridae", entity = "fin", includeRels = FALSE) -nrow(slist) +slist <- pk_get_study_list(taxon = "Siluridae", entity = "fin", includeRels = FALSE) +nrow(slist) # or filter studies only by entity, including their parts -slist <- pk_get_study_list(entity = "pelvic fin", includeRels = c("part of")) -nrow(slist) +slist <- pk_get_study_list(entity = "pelvic fin", includeRels = c("part of")) +nrow(slist) # or filter studies only by entity, including their parts -slist <- pk_get_study_list(entity = "pelvic fin", includeRels = c("part of")) -nrow(slist) +slist <- pk_get_study_list(entity = "pelvic fin", includeRels = c("part of")) +nrow(slist) # including not only parts but also historical and serial homologs -slist <- pk_get_study_list(entity = "pelvic fin", - includeRels = c("part of", +slist <- pk_get_study_list(entity = "pelvic fin", + includeRels = c("part of", "serially homologous to", - "historical homologous to")) -nrow(slist) + "historical homologous to")) +nrow(slist) # relationship names can be given as prefixes -slist1 <- pk_get_study_list(entity = "pelvic fin", - includeRels = c("part", "serial", "historical")) -nrow(slist1) == nrow(slist) +slist1 <- pk_get_study_list(entity = "pelvic fin", + includeRels = c("part", "serial", "historical")) +nrow(slist1) == nrow(slist) # or apply no filter, obtaining all studies in the KB -slist <- pk_get_study_list() -nrow(slist) -# }
    +slist <- pk_get_study_list() +nrow(slist) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_get_study_meta.html b/docs/reference/pk_get_study_meta.html index 14d90a9..ee36352 100644 --- a/docs/reference/pk_get_study_meta.html +++ b/docs/reference/pk_get_study_meta.html @@ -8,21 +8,29 @@ pk_get_study_meta — pk_get_study_meta • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,13 +117,11 @@

    pk_get_study_meta

    -

    pk_get_study_meta

    -
    -
    pk_get_study_meta(nexmls)
    - +
    pk_get_study_meta(nexmls)
    +

    Arguments

    @@ -123,46 +130,44 @@

    Arg

    a list of NeXML objects

    - +

    Value

    A list of data.frames containing taxa and characters

    -

    Examples

    -
    # NOT RUN {
    -slist <- pk_get_study_list(taxon = "Ameiurus", entity = "pelvic splint")
    -nex_list <- pk_get_study_xml(slist$id) # get the list of NeXML objects for the studies
    -pk_get_study(nex_list) # retrieve the study matrices
    -pk_get_study_meta(nex_list) # retrieve the meta data for the studies
    -# }
    +
    if (FALSE) { +slist <- pk_get_study_list(taxon = "Ameiurus", entity = "pelvic splint") +nex_list <- pk_get_study_xml(slist$id) # get the list of NeXML objects for the studies +pk_get_study(nex_list) # retrieve the study matrices +pk_get_study_meta(nex_list) # retrieve the meta data for the studies +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_get_study_xml.html b/docs/reference/pk_get_study_xml.html index ea407cb..1302284 100644 --- a/docs/reference/pk_get_study_xml.html +++ b/docs/reference/pk_get_study_xml.html @@ -8,21 +8,29 @@ pk_get_study_xml — pk_get_study_xml • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,13 +117,11 @@

    pk_get_study_xml

    -

    pk_get_study_xml

    -
    -
    pk_get_study_xml(study_ids)
    - +
    pk_get_study_xml(study_ids)
    +

    Arguments

    @@ -123,44 +130,42 @@

    Arg

    a list of study IDs.

    - +

    Value

    A list of nexml objects

    -

    Examples

    -
    # NOT RUN {
    -slist <- pk_get_study_list(taxon = "Ameiurus", entity = "pelvic splint")
    -nex_list <- pk_get_study_xml(slist$id)
    -# }
    +
    if (FALSE) { +slist <- pk_get_study_list(taxon = "Ameiurus", entity = "pelvic splint") +nex_list <- pk_get_study_xml(slist$id) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_is_descendant.html b/docs/reference/pk_is_descendant.html index 5406fd2..761bc60 100644 --- a/docs/reference/pk_is_descendant.html +++ b/docs/reference/pk_is_descendant.html @@ -8,21 +8,29 @@ Test which candidate terms are ancestors or descendants of a term — pk_is_descendant • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    @@ -110,17 +119,15 @@

    Test which candidate terms are ancestors or descendants of a term

    -

    Tests which in a list of candidate terms are ancestors to or descendants of the query term. Note that terms are not considered ancestors and descendants of themselves.

    -
    -
    pk_is_descendant(term, candidates, includeRels = c("none", "part_of"))
    +    
    pk_is_descendant(term, candidates, includeRels = c("none", "part_of"))
    +
    +pk_is_ancestor(term, candidates, includeRels = c("none", "part_of"))
    -pk_is_ancestor(term, candidates, includeRels = c("none", "part_of"))
    -

    Arguments

    @@ -141,12 +148,11 @@

    Arg sense for anatomy terms. The default is not to include these.

    - +

    Value

    A logical vector indicating which candidate terms are ancestors and descendants, respectively, of the query term.

    -

    Details

    Any of both the query term and the list of candidate terms can be supplied @@ -154,56 +160,52 @@

    Details to IRIs, allowing any ontology as the target. If labels aren't unique enough across ontologies, it is advisable to do the resolution before calling these functions, using pk_get_iri with the appropriate ontology set.

    -

    Examples

    -
    # NOT RUN {
    +    
    if (FALSE) { # taxa: -pk_is_descendant("Halecostomi", c("Halecostomi", "Icteria", "Sciaenidae")) -pk_is_ancestor("Sciaenidae", c("Halecostomi", "Abeomelomys", "Sciaenidae")) +pk_is_descendant("Halecostomi", c("Halecostomi", "Icteria", "Sciaenidae")) +pk_is_ancestor("Sciaenidae", c("Halecostomi", "Abeomelomys", "Sciaenidae")) # anatomical entities: -pk_is_descendant("paired fin", c("pectoral fin", "pelvic fin", "dorsal fin")) -pk_is_descendant("paired fin", c("pelvic fin", "pelvic fin ray")) -pk_is_descendant("paired fin", c("pelvic fin", "pelvic fin ray"), includeRels = "part_of") +pk_is_descendant("paired fin", c("pectoral fin", "pelvic fin", "dorsal fin")) +pk_is_descendant("paired fin", c("pelvic fin", "pelvic fin ray")) +pk_is_descendant("paired fin", c("pelvic fin", "pelvic fin ray"), includeRels = "part_of") -pk_is_ancestor("pelvic fin", c("paired fin", "hindlimb", "fin")) -pk_is_ancestor("pelvic fin ray", c("paired fin", "fin")) -pk_is_ancestor("pelvic fin ray", c("paired fin", "fin"), includeRels = "part_of") +pk_is_ancestor("pelvic fin", c("paired fin", "hindlimb", "fin")) +pk_is_ancestor("pelvic fin ray", c("paired fin", "fin")) +pk_is_ancestor("pelvic fin ray", c("paired fin", "fin"), includeRels = "part_of") # phenotypic quality -pk_is_ancestor("triangular", c("shape", "color", "amount")) -pk_is_descendant("shape", c("T-shaped", "star shaped", "yellow")) -# }
    +pk_is_ancestor("triangular", c("shape", "color", "amount")) +pk_is_descendant("shape", c("T-shaped", "star shaped", "yellow")) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_is_extinct.html b/docs/reference/pk_is_extinct.html index 4807732..79db436 100644 --- a/docs/reference/pk_is_extinct.html +++ b/docs/reference/pk_is_extinct.html @@ -8,21 +8,29 @@ Determine which taxa are extinct — pk_is_extinct • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,13 +117,11 @@

    Determine which taxa are extinct

    -

    This is simply a convenience function on top of pk_taxon_detail().

    -
    -
    pk_is_extinct(taxon, verbose = FALSE)
    - +
    pk_is_extinct(taxon, verbose = FALSE)
    +

    Arguments

    @@ -130,40 +137,39 @@

    Arg possibly time-consuming operations. The default is FALSE.

    - +

    Value

    A logical named vector with value TRUE if the corresponding input taxon is marked as extinct, and FALSE otherwise. For taxon names that failed to be looked up, the value will be NA. Names will be the input taxa where there were given as names, and the label of the respective taxon otherwise.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_ontotrace.html b/docs/reference/pk_ontotrace.html index 2e2098b..cae7fb6 100644 --- a/docs/reference/pk_ontotrace.html +++ b/docs/reference/pk_ontotrace.html @@ -8,21 +8,29 @@ Returns a NeXML-format evolutionary character matrix. — pk_ontotrace • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    @@ -110,17 +119,15 @@

    Returns a NeXML-format evolutionary character matrix.

    -

    Generate matrix of inferred presence/absence associations for anatomical structures subsumed by the provided entity class expression, for any taxa within the provided taxon class expression.

    -
    -
    pk_get_ontotrace(nex)
    +    
    pk_get_ontotrace(nex)
    +
    +pk_get_ontotrace_meta(nex)
    -pk_get_ontotrace_meta(nex)
    -

    Arguments

    @@ -129,47 +136,45 @@

    Arg

    a nexml object

    - +

    Value

    data.frame: The OntoTrace matrix.

    -

    Examples

    -
    # NOT RUN {
    -nex0 <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "fin")
    -
    -nex <- pk_get_ontotrace_xml(taxon = c("Ictalurus", "Ameiurus"), entity = "fin spine")
    -pk_get_ontotrace(nex)
    -pk_get_ontotrace_meta(nex)
    -# }
    +
    if (FALSE) { +nex0 <- pk_get_ontotrace_xml(taxon = "Ictalurus", entity = "fin") + +nex <- pk_get_ontotrace_xml(taxon = c("Ictalurus", "Ameiurus"), entity = "fin spine") +pk_get_ontotrace(nex) +pk_get_ontotrace_meta(nex) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pk_terms.html b/docs/reference/pk_terms.html index 92120a6..17a2604 100644 --- a/docs/reference/pk_terms.html +++ b/docs/reference/pk_terms.html @@ -8,21 +8,29 @@ Get term details (ID, label, definition) — pk_terms • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,20 +118,18 @@

    Get term details (ID, label, definition)

    -

    Retrieve details about a taxon, an anatomical structure, a gene, or a phenotypic quality.

    -
    -
    pk_taxon_detail(term, verbose = FALSE)
    +    
    pk_taxon_detail(term, verbose = FALSE)
     
    -pk_anatomical_detail(term, verbose = FALSE)
    +pk_anatomical_detail(term, verbose = FALSE)
     
    -pk_phenotype_detail(term, verbose = FALSE)
    +pk_phenotype_detail(term, verbose = FALSE)
    +
    +pk_gene_detail(term, taxon = NA, verbose = FALSE)
    -pk_gene_detail(term, taxon = NA, verbose = FALSE)
    -

    Arguments

    @@ -144,7 +151,7 @@

    Arg ontology IRI for which to match the gene name.

    - +

    Value

    A data.frame, with at least columns "id" and "label".

    @@ -156,18 +163,20 @@

    Value

    For pk_gene_detail, the additional columns are "taxon.id" and "taxon.label" for the corresponding NCBI Taxonomy ID and name, and "matchType" ('exact' or 'partial').

    -

    Examples

    -
    pk_taxon_detail("Coralliozetus")
    #> id label extinct +
    pk_taxon_detail("Coralliozetus") +
    #> id label extinct #> 1 http://purl.obolibrary.org/obo/VTO_0042955 Coralliozetus FALSE #> rank.id rank.label common_name -#> 1 http://purl.obolibrary.org/obo/TAXRANK_0000005 genus <NA>
    pk_anatomical_detail("basihyal bone")
    #> label -#> 1 basihyal bone +#> 1 http://purl.obolibrary.org/obo/TAXRANK_0000005 genus <NA>
    pk_anatomical_detail("basihyal bone") +
    #> label isDefinedBy +#> 1 basihyal bone http://purl.obolibrary.org/obo/uberon.owl #> definition #> 1 Replacement bone that is median and is the anterior-most bone of the ventral hyoid arch. #> id -#> 1 http://purl.obolibrary.org/obo/UBERON_0011618
    pk_gene_detail("socs5")
    #> id label matchType +#> 1 http://purl.obolibrary.org/obo/UBERON_0011618
    pk_gene_detail("socs5") +
    #> id label matchType #> 1 http://xenbase.org/XB-GENEPAGE-479592 socs5 exact #> 2 http://www.informatics.jax.org/marker/MGI:2385459 Socs5 exact #> 3 http://zfin.org/ZDB-GENE-061013-408 socs5a partial @@ -179,32 +188,30 @@

    Examp #> 4 http://purl.obolibrary.org/obo/NCBITaxon_7955 Danio rerio

    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/pkb_args_to_query.html b/docs/reference/pkb_args_to_query.html index 7f8baf9..d72c707 100644 --- a/docs/reference/pkb_args_to_query.html +++ b/docs/reference/pkb_args_to_query.html @@ -8,21 +8,29 @@ Creates a list of named query parameters — pkb_args_to_query • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,13 +38,13 @@ - + - + @@ -50,9 +58,10 @@ + - +
    @@ -74,7 +83,7 @@ -
    +
    @@ -111,16 +120,14 @@

    Creates a list of named query parameters

    -

    Several Phenoscape KB API endpoints use a form-like parameter list for filtering (limiting), or, in the case of relationships, expanding, the query result. This function aids in preparing the query string for these endpoints. It is internal to the package.

    -
    -
    pkb_args_to_query(..., includeRels = FALSE, verbose = FALSE)
    - +
    pkb_args_to_query(..., includeRels = FALSE, verbose = FALSE)
    +

    Arguments

    @@ -146,38 +153,37 @@

    Arg operations are run.

    - +

    Value

    A list of named query parameters suitatoble for several form-like query endpoints in the Phenoscape KB API.

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/profile_similarity.html b/docs/reference/profile_similarity.html index 80a3e35..3b9e6d4 100644 --- a/docs/reference/profile_similarity.html +++ b/docs/reference/profile_similarity.html @@ -8,21 +8,29 @@ Semantic similarity between profiles — profile_similarity • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -58,9 +66,10 @@ + - +
    @@ -82,7 +91,7 @@ -
    +
    @@ -119,7 +128,6 @@

    Semantic similarity between profiles

    -

    Calculates the semantic similarity between profiles (groups) of terms.

    bestPairs aggregates pairwise scores by "best pairs" between two profiles. That is, for profiles P1 and P2 with terms T1[i] (i = 1,...n) and T2[j] @@ -132,15 +140,14 @@

    Semantic similarity between profiles

    similarity scores such that the diagonal of the pair-wise similarity matrix is ignored. This may be desirable, for example, when average with-in group similarity should exclude the similarity of terms to themselves.

    -
    -
    profile_similarity(pairwise, subsumer_mat, ..., f, reduce = NA)
    +    
    profile_similarity(pairwise, subsumer_mat, ..., f, reduce = NA)
    +
    +bestPairs(X, best = max, aggregate = mean)
     
    -bestPairs(X, best = max, aggregate = mean)
    +reduce.ignoringDiag(X, aggregate = mean)
    -reduce.ignoringDiag(X, aggregate = mean)
    -

    Arguments

    @@ -163,7 +170,7 @@

    Arg

    - @@ -185,17 +192,17 @@

    Arg

    - + +NA values before calculating the aggregate. The default is mean().

    f

    a factor (or an object coercible to factor) defining the group +

    a factor (or an object coercible to factor) defining the group (profile) membership of the terms (= columns) in the subsumer matrix. Columns and rows of the resulting profile similarity matrix will take their names from the levels of the factor. The factor may have 2 or more levels.

    best

    the function for determing the best score. The default is max().

    the function for determing the best score. The default is max().

    aggregate

    the function for aggregating scores (for reduce.ignoringDiag) or best pairwise scores (for bestPairs). For reduce.ignoringDiag, the function must also accept parameter na.rm, and if the value is TRUE, remove -NA values before calculating the aggregate. The default is mean().

    - +

    Details

    A profile refers to a group of terms, and profile similarity to the similarity @@ -209,7 +216,7 @@

    Details and then the pairwise scores between the terms in two groups are reduced to a single score giving the between-group score.

    - +

    Note

    In pairwise mode, if the reduce function is asymmetric (as will typically be @@ -217,85 +224,88 @@

    Note

    of the profile similarity matrix will not be symmetric. If a symmetric similarity matrix is desired, this can be achieved by computing (X + t(X)) / 2, if X is the profile similarity matrix.

    -

    Examples

    -
    tt <- sapply(c("pelvic fin", "pectoral fin", - "forelimb", "hindlimb", "dorsal fin", "caudal fin"), - pk_get_iri, as = "anatomy") +
    tt <- sapply(c("pelvic fin", "pectoral fin", + "forelimb", "hindlimb", "dorsal fin", "caudal fin"), + pk_get_iri, as = "anatomy") # define groups (profiles) as factors: -pairedUnpaired <- c(rep("paired", times = 4), rep("unpaired", times = 2)) -finsLimbs <- c("fins", "fins", "limbs", "limbs", "fins", "fins") -pairedFinLimb <- interaction(as.factor(pairedUnpaired), as.factor(finsLimbs)) +pairedUnpaired <- c(rep("paired", times = 4), rep("unpaired", times = 2)) +finsLimbs <- c("fins", "fins", "limbs", "limbs", "fins", "fins") +pairedFinLimb <- interaction(as.factor(pairedUnpaired), as.factor(finsLimbs)) # compute subsumer matrix -subs.mat <- subsumer_matrix(tt, .colnames = "label", .labels = names(tt), - preserveOrder = TRUE) +subs.mat <- subsumer_matrix(tt, .colnames = "label", .labels = names(tt), + preserveOrder = TRUE) # group-wise profile similarity: -profile_similarity(jaccard_similarity, subs.mat, f = pairedUnpaired)
    #> paired unpaired -#> paired 1.0000000 0.3163265 -#> unpaired 0.3163265 1.0000000
    profile_similarity(jaccard_similarity, subs.mat, f = finsLimbs)
    #> fins limbs -#> fins 1.0000000 0.7653061 -#> limbs 0.7653061 1.0000000
    profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb)
    #> paired.fins unpaired.fins paired.limbs -#> paired.fins 1.0000000 0.3483146 0.8152174 -#> unpaired.fins 0.3483146 1.0000000 0.3152174 -#> paired.limbs 0.8152174 0.3152174 1.0000000
    +profile_similarity(jaccard_similarity, subs.mat, f = pairedUnpaired) +
    #> paired unpaired +#> paired 1.0000000 0.3366337 +#> unpaired 0.3366337 1.0000000
    profile_similarity(jaccard_similarity, subs.mat, f = finsLimbs) +
    #> fins limbs +#> fins 1.0000000 0.7722772 +#> limbs 0.7722772 1.0000000
    profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb) +
    #> paired.fins unpaired.fins paired.limbs +#> paired.fins 1.0000000 0.3695652 0.8210526 +#> unpaired.fins 0.3695652 1.0000000 0.3368421 +#> paired.limbs 0.8210526 0.3368421 1.0000000
    # pairwise, using mean (average pairwise score); result is symmetric -profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, - reduce = mean)
    #> paired.fins unpaired.fins paired.limbs -#> paired.fins 0.9397590 0.3742470 0.8251232 -#> unpaired.fins 0.3742470 0.9189189 0.3413199 -#> paired.limbs 0.8251232 0.3413199 0.9285714
    # the same, but excluding self-similarity of terms within groups -profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, - reduce = reduce.ignoringDiag)
    #> paired.fins unpaired.fins paired.limbs -#> paired.fins 0.8795181 0.3742470 0.8251232 -#> unpaired.fins 0.3742470 0.8378378 0.3413199 -#> paired.limbs 0.8251232 0.3413199 0.8571429
    # pairwise, using max; result is symmetric -profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, - reduce = max)
    #> paired.fins unpaired.fins paired.limbs -#> paired.fins 1.0000000 0.3750000 0.8571429 -#> unpaired.fins 0.3750000 1.0000000 0.3414634 -#> paired.limbs 0.8571429 0.3414634 1.0000000
    # pairwise, using average of best pairs; result is _not_ symmetric -sm <- profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, - reduce = bestPairs) -sm
    #> paired.fins unpaired.fins paired.limbs -#> paired.fins 1.0000000 0.3750000 0.8571429 -#> unpaired.fins 0.3742470 1.0000000 0.3413199 -#> paired.limbs 0.8571429 0.3414634 1.0000000
    # make symmtric, for example by averaging: -(sm + t(sm)) / 2
    #> paired.fins unpaired.fins paired.limbs -#> paired.fins 1.0000000 0.3746235 0.8571429 -#> unpaired.fins 0.3746235 1.0000000 0.3413917 -#> paired.limbs 0.8571429 0.3413917 1.0000000
    +profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, + reduce = mean) +
    #> paired.fins unpaired.fins paired.limbs +#> paired.fins 0.9418605 0.3964696 0.8310345 +#> unpaired.fins 0.3964696 0.9250000 0.3641711 +#> paired.limbs 0.8310345 0.3641711 0.9310345
    # the same, but excluding self-similarity of terms within groups +profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, + reduce = reduce.ignoringDiag) +
    #> paired.fins unpaired.fins paired.limbs +#> paired.fins 0.8837209 0.3964696 0.8310345 +#> unpaired.fins 0.3964696 0.8500000 0.3641711 +#> paired.limbs 0.8310345 0.3641711 0.8620690
    # pairwise, using max; result is symmetric +profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, + reduce = max) +
    #> paired.fins unpaired.fins paired.limbs +#> paired.fins 1.0000000 0.3975904 0.8620690 +#> unpaired.fins 0.3975904 1.0000000 0.3647059 +#> paired.limbs 0.8620690 0.3647059 1.0000000
    # pairwise, using average of best pairs; result is _not_ symmetric +sm <- profile_similarity(jaccard_similarity, subs.mat, f = pairedFinLimb, + reduce = bestPairs) +sm +
    #> paired.fins unpaired.fins paired.limbs +#> paired.fins 1.0000000 0.3975904 0.8620690 +#> unpaired.fins 0.3964696 1.0000000 0.3641711 +#> paired.limbs 0.8620690 0.3647059 1.0000000
    # make symmtric, for example by averaging: +(sm + t(sm)) / 2 +
    #> paired.fins unpaired.fins paired.limbs +#> paired.fins 1.000000 0.3970300 0.8620690 +#> unpaired.fins 0.397030 1.0000000 0.3644385 +#> paired.limbs 0.862069 0.3644385 1.0000000
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/similarity.html b/docs/reference/similarity.html index 732b850..6ddaa4b 100644 --- a/docs/reference/similarity.html +++ b/docs/reference/similarity.html @@ -8,21 +8,29 @@ Compute semantic similarity metrics between terms — similarity • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,8 +38,8 @@ - + - + @@ -67,9 +75,10 @@ + - +
    @@ -91,7 +100,7 @@ -
    +
    @@ -128,7 +137,6 @@

    Compute semantic similarity metrics between terms

    -

    The Tanimoto similarity ST is computed according to the definition for bit vectors (see Jaccard index at Wikipedia). For weights \(W_i \in \{0, 1\}\) it is the same as the @@ -150,18 +158,17 @@

    Compute semantic similarity metrics between terms

    The Resnik similarity between two terms is the information content (IC) of their most informative common ancestor (MICA), which is the common subsumer with the greatest information content.

    -
    -
    tanimoto_similarity(subsumer_mat = NA, terms = NULL, ...)
    +    
    tanimoto_similarity(subsumer_mat = NA, terms = NULL, ...)
    +
    +jaccard_similarity(subsumer_mat = NA, terms = NULL, ...)
     
    -jaccard_similarity(subsumer_mat = NA, terms = NULL, ...)
    +cosine_similarity(subsumer_mat = NA, terms = NULL, ...)
     
    -cosine_similarity(subsumer_mat = NA, terms = NULL, ...)
    +resnik_similarity(subsumer_mat = NA, terms = NULL, ...,
    +  wt = term_freqs, wt_args = list(), base = 10)
    -resnik_similarity(subsumer_mat = NA, terms = NULL, ..., - wt = term_freqs, wt_args = list(), base = 10)
    -

    Arguments

    @@ -191,7 +198,9 @@

    Arg information content, and where a term will always have a score equal to or greater than any of its superclasses. If a function, it must accept parameter x as the vector of term IRIs and return a vector of frequencies (not -IC scores) for the terms. The default is to use function term_freqs().

    +IC scores) for the terms. The default is to use function term_freqs(). +Subsumer terms with zero or missing (NA) frequency will be omitted from the +calculation.

    @@ -205,67 +214,63 @@

    Arg content from term frequency. The default is 10.

    wt_args
    - +

    Value

    A matrix with M[i,j] = similarity of terms i and j.

    -

    References

    Philip Resnik (1995). "Using information content to evaluate semantic similarity in a taxonomy". Proceedings of the 14th International Joint Conference on Artificial Intelligence (IJCAI'95). 1: 448–453

    -

    Examples

    -
    # NOT RUN {
    -sm <- jaccard_similarity(terms = c("pelvic fin", "pectoral fin",
    +    
    if (FALSE) { +sm <- jaccard_similarity(terms = c("pelvic fin", "pectoral fin", "forelimb", "hindlimb", - "dorsal fin", "caudal fin"), - .colnames = "label") -sm + "dorsal fin", "caudal fin"), + .colnames = "label") +sm # e.g., turn into distance matrix, cluster, and plot -plot(hclust(as.dist(1-sm))) -# }# NOT RUN { -phens <- get_phenotypes("basihyal bone", taxon = "Cyprinidae") -sm.ic <- resnik_similarity(terms = phens$id, - .colnames = "label", .labels = phens$label, - wt_args = list(as = "phenotype", - corpus = "taxa")) -maxIC <- -log10(1 / corpus_size("taxa")) +plot(hclust(as.dist(1-sm))) +} +if (FALSE) { +phens <- get_phenotypes("basihyal bone", taxon = "Cyprinidae") +sm.ic <- resnik_similarity(terms = phens$id, + .colnames = "label", .labels = phens$label, + wt_args = list(as = "phenotype", + corpus = "taxa")) +maxIC <- -log10(1 / corpus_size("taxa")) # normalize by max IC, turn into distance matrix, cluster, and plot -plot(hclust(as.dist(1-sm.ic/maxIC))) -# }
    +plot(hclust(as.dist(1-sm.ic/maxIC))) +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/subsumer_matrix.html b/docs/reference/subsumer_matrix.html index 7f22317..dac5820 100644 --- a/docs/reference/subsumer_matrix.html +++ b/docs/reference/subsumer_matrix.html @@ -8,21 +8,29 @@ Obtains a subsumer matrix — subsumer_matrix • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,12 +38,12 @@ - + - + @@ -49,9 +57,10 @@ + - +
    @@ -73,7 +82,7 @@ -
    +
    @@ -110,16 +119,14 @@

    Obtains a subsumer matrix

    -

    A subsumer matrix M for terms \(j \in \{1, \dots, n\}\) has value \(M_{i,j}=1\) iff class i (which can be an anonymous class expression) subsumes term j, and zero otherwise. Therefore, it will have n columns, one for each term.

    -
    -
    subsumer_matrix(terms, .colnames = c("ID", "IRI", "label"),
    -  .labels = NULL, preserveOrder = FALSE, verbose = FALSE)
    - +
    subsumer_matrix(terms, .colnames = c("ID", "IRI", "label"),
    +  .labels = NULL, preserveOrder = FALSE, verbose = FALSE)
    +

    Arguments

    @@ -160,7 +167,7 @@

    Arg potentially time-consuming operations.

    - +

    Value

    A data.frame representing the subsumer matrix

    @@ -171,7 +178,6 @@

    Value

    have attribute term.iris, giving the term IRIs for the rows (and columns). Note that these extra attributes will be lost upon subsetting the returned matrix.

    -

    Details

    In this implementation, for each row i @@ -181,53 +187,49 @@

    Details very many) classes not subsuming any of the terms will not be included. This subsumer matrix is thus only useful for similarity metrics for which non-subsuming terms can be ignored.

    -

    Examples

    -
    # NOT RUN {
    -tl <- c("http://purl.obolibrary.org/obo/UBERON_0000981",
    +    
    if (FALSE) { +tl <- c("http://purl.obolibrary.org/obo/UBERON_0000981", "http://purl.obolibrary.org/obo/UBERON_0002103", "http://purl.obolibrary.org/obo/UBERON_0000976", - "http://purl.obolibrary.org/obo/UBERON_0002102") -m <- subsumer_matrix(tl) -m <- # term IDs as column names -id_prefixes <- attr(m, "prefixes") -id_prefixes # 4x "http://purl.obolibrary.org/obo/" - -m <- subsumer_matrix(tl, .colnames = "label") -m # term labels as column names -mat_terms <- attr(m, "term.iris") -mat_terms # term IRIs in the same order as columns -# }
    + "http://purl.obolibrary.org/obo/UBERON_0002102") +m <- subsumer_matrix(tl) +m <- # term IDs as column names +id_prefixes <- attr(m, "prefixes") +id_prefixes # 4x "http://purl.obolibrary.org/obo/" + +m <- subsumer_matrix(tl, .colnames = "label") +m # term labels as column names +mat_terms <- attr(m, "term.iris") +mat_terms # term IRIs in the same order as columns +} +
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/taxon_ontology_iris.html b/docs/reference/taxon_ontology_iris.html index ab03cd3..e1bbc85 100644 --- a/docs/reference/taxon_ontology_iris.html +++ b/docs/reference/taxon_ontology_iris.html @@ -8,21 +8,29 @@ Get IRIs of ontologies with taxonomy terms — taxon_ontology_iris • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,10 +38,10 @@ - + - + @@ -47,9 +55,10 @@ + - +
    @@ -71,7 +80,7 @@ -
    +
    @@ -108,42 +117,41 @@

    Get IRIs of ontologies with taxonomy terms

    -

    Obtains the IRIs of taxon ontologies in the Phenoscape KB.

    -
    -
    taxon_ontology_iris()
    - +
    taxon_ontology_iris()
    + +

    Value

    A character vector

    - - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/term_category.html b/docs/reference/term_category.html index ea1ce66..a09d20b 100644 --- a/docs/reference/term_category.html +++ b/docs/reference/term_category.html @@ -8,21 +8,29 @@ Determine the general category of terms — term_category • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,13 +38,13 @@ - + - + @@ -50,9 +58,10 @@ + - +
    @@ -74,7 +83,7 @@ -
    +
    @@ -111,16 +120,14 @@

    Determine the general category of terms

    -

    Terms in the Phenoscape KB fall into different general categories: entity, quality, phenotype (which typically are entity-quality compositions), and taxon. The category is sometimes needed to plug a term IRI into the right parameter for a function or API call.

    -
    -
    term_category(x)
    - +
    term_category(x)
    +

    Arguments

    @@ -130,12 +137,11 @@

    Arg objects (such as phenotype objects)

    - +

    Value

    A character vector with the term categories ("entity", "quality", "phenotype", or "taxon") of the terms in the input list.

    -

    Details

    The implementation will first try infer the category from the object type @@ -143,43 +149,40 @@

    Details it will rely subsumption by specific upper ontology terms, specifically the BFO terms "independent continuant" (for entity terms) and "quality" (for quality terms).

    -

    Examples

    -
    term_category(c("http://purl.obolibrary.org/obo/UBERON_0011618", +
    term_category(c("http://purl.obolibrary.org/obo/UBERON_0011618", "http://purl.obolibrary.org/obo/PATO_0002279", "http://purl.obolibrary.org/obo/VTO_0071642", - "http://purl.obolibrary.org/obo/MP_0030825"))
    #> [1] "entity" "quality" "taxon" "phenotype"
    phens <- get_phenotypes("basihyal bone") -term_category(phens$id[1:3])
    #> [1] "phenotype" "phenotype" "phenotype"
    + "http://purl.obolibrary.org/obo/MP_0030825")) +
    #> [1] "entity" "quality" "taxon" "phenotype"
    phens <- get_phenotypes("basihyal bone") +term_category(phens$id[1:3]) +
    #> [1] "phenotype" "phenotype" "phenotype"
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/term_freqs.html b/docs/reference/term_freqs.html index 7078433..541f944 100644 --- a/docs/reference/term_freqs.html +++ b/docs/reference/term_freqs.html @@ -8,21 +8,29 @@ Obtains term frequencies for the Phenoscape KB — term_freqs • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,11 +38,11 @@ - + - + @@ -48,9 +56,10 @@ + - +
    @@ -72,7 +81,7 @@ -
    +
    @@ -109,16 +118,14 @@

    Obtains term frequencies for the Phenoscape KB

    -

    Determines the frequencies for the given input list of terms, based on the selected corpus.

    -
    -
    term_freqs(x, as = c("auto", "entity", "quality", "phenotype"),
    -  corpus = c("taxon_annotations", "taxa", "gene_annotations", "genes"),
    -  decodeIRI = TRUE, ...)
    - +
    term_freqs(x, as = c("auto", "entity", "quality", "phenotype"),
    +  corpus = c("taxon_annotations", "taxa", "gene_annotations", "genes"),
    +  decodeIRI = TRUE, ...)
    +

    Arguments

    @@ -164,12 +171,11 @@

    Arg It can also be used to always include parts for entity terms.

    - +

    Value

    a vector of frequencies as floating point numbers (between zero and 1.0), of the same length (and ordering) as the input list of terms.

    -

    Details

    Depending on the corpus selected, the frequencies are queried directly @@ -183,7 +189,6 @@

    Details Phenoscape KB, resulting in counts of zero for such terms. For some of these the implementation here will try to rewrite the query (see parameter decodeIRI), but this only works to a limited extent.

    -

    Note

    Term categories being accurate is vital for obtaining correct counts and @@ -198,52 +203,48 @@

    Note

    result as as. If all terms are of the same category and the category is known beforehand, it saves time and prevents potential errors to supply this category using as.

    -

    Examples

    -
    terms <- c("pectoral fin", "pelvic fin", "dorsal fin", "paired fin") -IRIs <- sapply(terms, pk_get_iri, as = "anatomy") -term_freqs(IRIs)
    #> [1] 0.001797967 0.002695709 0.004368265 0.004585561
    -phens <- get_phenotypes(entity = "basihyal bone") -term_freqs(phens$id, as = "phenotype", corpus = "taxon_annotations")
    #> [1] 3.973408e-05 4.966760e-06 1.365859e-05 1.129938e-04 6.208450e-06 -#> [6] 2.607549e-05 6.332619e-05 2.222625e-04 1.365859e-05 1.328608e-04 -#> [11] 4.966760e-06 6.518872e-04 8.940168e-05 2.619966e-04 5.090929e-05 -#> [16] 1.862535e-05 1.192022e-04 2.235042e-05 1.030603e-04
    term_freqs(phens$id, as = "phenotype", corpus = "taxa")
    #> [1] 0.002659574 NA 0.002659574 0.002659574 0.001329787 0.001329787 -#> [7] 0.002659574 0.001329787 0.002659574 0.005319149 0.002659574 0.005319149 -#> [13] 0.001329787 0.002659574 0.002659574 NA 0.003989362 0.001329787 -#> [19] 0.001329787
    +
    terms <- c("pectoral fin", "pelvic fin", "dorsal fin", "paired fin") +IRIs <- sapply(terms, pk_get_iri, as = "anatomy") +term_freqs(IRIs) +
    #> [1] 0.001791597 0.002191650 0.004333911 0.004073383
    +phens <- get_phenotypes(entity = "basihyal bone") +term_freqs(phens$id, as = "phenotype", corpus = "taxon_annotations") +
    #> [1] 3.951144e-05 4.938930e-06 1.358206e-05 1.123607e-04 6.173663e-06 +#> [6] 2.592938e-05 6.297136e-05 2.210171e-04 2.222519e-04 1.358206e-05 +#> [11] 1.358206e-04 4.938930e-06 6.494693e-04 8.890074e-05 2.617633e-04 +#> [16] 5.185877e-05 1.852099e-05 1.185343e-04 2.222519e-05 1.024828e-04
    term_freqs(phens$id, as = "phenotype", corpus = "taxa") +
    #> [1] 0.002547771 0.000000000 0.002547771 0.002547771 0.001273885 0.001273885 +#> [7] 0.002547771 0.001273885 0.001273885 0.002547771 0.005095541 0.002547771 +#> [13] 0.005095541 0.001273885 0.002547771 0.002547771 0.000000000 0.003821656 +#> [19] 0.001273885 0.001273885
    - +
    -

    Site built with pkgdown 1.3.0.

    +

    Site built with pkgdown 1.6.1.

    +
    + + diff --git a/docs/reference/term_iri.html b/docs/reference/term_iri.html index 5bccdb2..7451ff5 100644 --- a/docs/reference/term_iri.html +++ b/docs/reference/term_iri.html @@ -8,21 +8,29 @@ Obtain IRI(s) for canonical terms and properties — partOf_iri • rphenoscape + - + - - + + + + + + + - + + - + - - + + + @@ -30,14 +38,14 @@ - + - + @@ -51,9 +59,10 @@ + - +
    @@ -75,7 +84,7 @@ -
    +
    @@ -112,22 +121,20 @@

    Obtain IRI(s) for canonical terms and properties

    -

    partOf_iri returns the IRI ofthe canonical "part_of" relationship in the database.

    hasPart_iri returns the IRI ofthe canonical "has_part" relationship in the database.

    Provides cached access to IRIs of terms and properties that are frequently used.

    -
    -
    partOf_iri()
    +    
    partOf_iri()
    +
    +hasPart_iri()
     
    -hasPart_iri()
    +term_iri(label, type = "owl:Class", preferOntologies = NULL,
    +  firstOnly = TRUE)
    -term_iri(label, type = "owl:Class", preferOntologies = NULL, - firstOnly = TRUE)
    -

    Arguments

    @@ -157,11 +164,10 @@

    Arg multiple matches. The default is TRUE.

    - +

    Value

    Character, the IRI(s) for the requested term or property.

    -

    Details

    Requested IRIs are not hard-coded. Instead, they are dynamically retrieved from @@ -171,40 +177,38 @@

    Details

    For the frequently needed properties "part of", "has part" etc, one should use the predefined functions (partOf_iri(), hasPart_iri()), so that the correct matches are cached and used internally by the package.

    -

    Examples

    -
    term_iri("part of", type = "owl:ObjectProperty", preferOntologies = c("RO", "BFO"))
    #> [1] "http://purl.obolibrary.org/obo/BFO_0000050"
    term_iri("develops from", type = "owl:ObjectProperty", preferOntologies = c("RO"))
    #> [1] "http://purl.obolibrary.org/obo/RO_0002202"
    term_iri("anatomical structure", firstOnly = FALSE)
    #> [1] "http://purl.obolibrary.org/obo/UBERON_0000061" +
    term_iri("part of", type = "owl:ObjectProperty", preferOntologies = c("RO", "BFO")) +
    #> [1] "http://purl.obolibrary.org/obo/BFO_0000050"
    term_iri("develops from", type = "owl:ObjectProperty", preferOntologies = c("RO")) +
    #> [1] "http://purl.obolibrary.org/obo/RO_0002202"
    term_iri("anatomical structure", firstOnly = FALSE) +
    #> [1] "http://purl.obolibrary.org/obo/UBERON_0000061" #> [2] "http://purl.obolibrary.org/obo/CARO_0000003"
    - + + +