The GOSets class extends the Sets class to implement a container that also describes relations between genes and sets using the Gene Ontology controlled vocabulary. Refer to GOOntologyCodes and GOEvidenceCodes for valid vocabulary.

GOSets(relations = DataFrame(element = character(0), set = character(0),
  ontology = factor(character(0), names(GOOntologyCodes)), evidence =
  factor(character(0), names(GOEvidenceCodes))), ...)

Arguments

relations

DataFrame. At least 3 columns that provide mapping relationships between "element" and "set", with "membership" function in the range [0,1]. Additional columns are taken as relation metadata.

...

Arguments passed to the Sets() constructor and other functions.

Value

A GOSets object.

See also

Examples

# Constructor ---- # Fetch a sample of GO annotations library(org.Hs.eg.db)
#> Loading required package: AnnotationDbi
#> Loading required package: Biobase
#> Welcome to Bioconductor #> #> Vignettes contain introductory material; view with #> 'browseVignettes()'. To cite Bioconductor, see #> 'citation("Biobase")', and for packages 'citation("pkgname")'.
#> Loading required package: IRanges
#>
go_sets <- import(org.Hs.egGO)
#> Loading required namespace: GO.db
#>
#> 'select()' returned 1:1 mapping between keys and columns
#> Coercing evidence to factor
#> Coercing ontology to factor
relations <- as.data.frame(head(go_sets)) gs <- GOSets(relations) # Subsetting ---- gs1 <- subset(gs, element == "1" & ontology == "BP" & evidence == "TAS") relations(gs1)
#> GOHits object with 2 hits and 2 metadata columns: #> from to | evidence ontology #> <integer> <integer> | <factor> <factor> #> [1] 1 1 | TAS BP #> [2] 1 2 | TAS BP #> ------- #> nLnode: 1 / nRnode: 2
# Getters/Setters ---- evidence(gs)
#> [1] TAS ND TAS IDA TAS TAS #> 26 Levels: EXP IDA IPI IMP IGI IEP HTP HDA HMP HGI HEP IBA IBD IKR IRD ... IEA
#> [1] BP BP BP BP BP BP #> Levels: BP MF CC
gs1 <- gs evidence(gs1)[1] <- "EXP" gs1 <- gs ontology(gs1)[1] <- "CC"