Learn R Programming

rols (version 1.8.0)

olsQuery: Returns matching identifiers

Description

This function queries one or all ontologies for a pattern and returns all identifiers/terms. If a valid ontologyName is provided, only that ontology is queried. The function then sends a getTermsByNameRequest SOAP message and retrieves and parses the getTermsByNameResponse. The original corresponging interface is public Map getTermsByName(String partialName, String ontologyName, boolean reverseKeyOrder). If no ontologyName is provided, all ontologies are used; the function then sends a getPrefixedTermsByNameRequest SOAP message and retrieves and parses the getPrefixedTermsByNameResponse. The original corresponging interface is public Map getPrefixedTermsByName(String partialName, boolean reverseKeyOrder).

Usage

olsQuery(pattern, ontologyName, exact = FALSE, n = 3, simplify = TRUE)

Arguments

pattern
A character used to query the OLS.
ontologyName
Optional. A character with the name of a valid ontology name. If missing, all ontologies are searched for pattern.
exact
Require pattern to match term exactly. Default is FALSE. Note that if ontologyName is missing, exact is ignored.
n
Number of attempts to repeat the query if no result is found. Default is 3.
simplify
A logical indicating whether the S4 Map instance should be simplified. Default is TRUE.

Value

A named character if simplify is TRUE. An instance of class Map otherwise.

Details

Some valid queries sometimes return empty results due to network instabilities. For this reason, each olsQuery is repeated 3 times (see n parameter) as long as empty resuls are obtained. In general, when the ontology is specified, queries are fast and reliable.

See Also

Other ols-queries: allIds; isIdObsolete; olsVersion; ontologies; ontologyLoadDate; ontologyNames; rootId; termMetadata; termXrefs; term

Examples

Run this code
olsQuery("tgn","GO") ## search GO for 'tgn'
olsQuery("tgn") ## search all ontologies
olsQuery("ESI", "MS")
olsQuery("ESI", "MS", exact = TRUE)

Run the code above in your browser using DataLab