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)

Arguments

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.

Value

RNeXML::nexml object

Details

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.

Examples

# NOT RUN {
# 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)

# }