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)
taxon | character, required. A vector of taxon names. |
---|---|
entity | character, required. A single character string or a vector of anatomical class expressions. |
relation | character string, optional. The relationship to the entities to be included in the result. Must be either "part of" or "develops from", or set to NA to disable. Default is "part of". |
variable_only | logical, optional. Whether to only include characters that are variable across the selected set of taxa. Default is TRUE. |
strict | logical, optional. Whether or not to treat any failure to resolve any taxon or entity names to IRI as input error. Resolution by partial or other inexact match results in a warning, but is not considered a failure. If FALSE, query execution will continue with the taxon and entity terms that did resolve to IRI. Default is TRUE, meaning any resolution failure will result in an error. |
RNeXML::nexml object
The character matrix includes both asserted and logically inferred states. The
query always includes all subclasses of both taxa and entities, and by default
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.
if (FALSE) { # one taxon (including subclasses), one entity (including subclasses and # by default its parts) 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) # 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) # query with multiple taxa, and/or multiple entities: 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) }