GeneSet-methods: Methods to construct GeneSet instances

GeneSetR Documentation

Methods to construct GeneSet instances

Description

Use GeneSet to construct gene sets from ExpressionSet, character vector, or other objects.

Usage

GeneSet(type, ..., setIdentifier=.uniqueIdentifier())

Arguments

type

An argument determining how the gene set will be created, as described in the Methods section.

setIdentifier

A ScalarCharacter or length-1 character vector uniquely identifying the set.

...

Additional arguments for gene set construction. Methods have required arguments, as outlined below; additional arguments correspond to slot names GeneSet.

Methods

signature(type = "missing", ..., setIdentifier=.uniqueIdentifier())

Construct an empty gene set.

signature(type = "character", ..., setIdentifier=.uniqueIdentifier())

Construct a gene set using identifiers type.

signature(type = "GeneIdentifierType", ..., setIdentifier=.uniqueIdentifier())

Construct an empty gene set. The gene set has geneIdType created from the GeneIdentifierType of type.

signature(type = "ExpressionSet", ..., setIdentifier=.uniqueIdentifier())

Construct a gene set from an ExpressionSet. geneIdType is set to AnnotationIdentifier; the annotation field and annotation package of the ExpressionSet are consulted to determine organism, if possible. Short and long descriptions from the ExpressionSet experimentData title and abstract; pub med ids, urls, and contributor are also derived from experimentData.

signature(type = "GOCollection", ..., geneIdType, setIdentifier=.uniqueIdentifier())

Use genes contained in type to create a GeneSet . The required arugment geneIdType must include a package for which an appropriate map (to GO) exists, e.g., EntrezIdentifier('org.Hs.eg.db').

signature(type = "BroadCollection", ..., urls = character(0), setIdentifier=.uniqueIdentifier())

Read XML following the Broad Institute schema and located at urls to create a gene set. The url can be a local file or internet connection, but must contain just a single gene set. See getBroadSets for details.

See Also

GeneSet-class GeneColorSet-class

Examples

## Empty gene set
GeneSet()

## Gene set from ExpressionSet
data(sample.ExpressionSet)
gs1 <- GeneSet(sample.ExpressionSet[100:109])

## GeneSet from Broad XML; 'fl' could be a url
fl <- system.file("extdata", "Broad.xml", package="GSEABase")
gs2 <- getBroadSets(fl)[[1]] # actually, a list of two gene sets

## GeneSet from list of gene identifiers
geneIds <- geneIds(gs2) # any character vector would do
gs3 <- GeneSet(geneIds)
## unspecified set type, so...
is(geneIdType(gs3), "NullIdentifier") == TRUE
## update set type to match encoding of identifiers
geneIdType(gs2)
geneIdType(gs3) <- SymbolIdentifier()
## other ways of accomplishing the same
gs4 <- GeneSet(geneIds, geneIdType=SymbolIdentifier())
gs5 <- GeneSet(SymbolIdentifier(), geneIds=geneIds)

Bioconductor/GSEABase documentation built on April 29, 2022, 12:04 p.m.