subsetByOntology: Ontology-based subsetting of BugSigDB signatures

View source: R/ontology.R

subsetByOntologyR Documentation

Ontology-based subsetting of BugSigDB signatures

Description

This function facilitates ontology-based queries for experimental factors and body sites.

Usage

subsetByOntology(df, column = c("Body site", "Condition"), term, ontology)

Arguments

df

data.frame storing BugSigDB data. Typically obtained via importBugSigDB.

column

character. Column of df on which subsetting should be performed. Should be either "Body site" (default) or "Condition".

term

character. A valid term of ontology. Subsetting by this term then involves subsetting column to this term and all descendants of that term in the the chosen ontology and that are present in the chosen column of df.

ontology

an object of class ontology_index as defined in the ontologyIndex package. Typically obtained via getOntology.

Value

a data.frame with the chosen column restricted to descendants of the chosen term in the chosen ontology.

References

EFO: https://www.ebi.ac.uk/ols/ontologies/efo

UBERON: https://www.ebi.ac.uk/ols/ontologies/uberon

See Also

importBugSigDB, getOntology

Examples


 # (1) Obtain BugSigDB data
 df <- importBugSigDB()

 # (2) Obtain ontology of interest as an R object
 uberon <- getOntology("uberon")

 # (3) High-level query on body site
 sdf <- subsetByOntology(df, 
                         column = "Body site",
                         term = "digestive system element",
                         ontology = uberon)
 table(sdf[,"Body site"])


waldronlab/bugsigdbr documentation built on Oct. 31, 2024, 3:43 a.m.