GeneSetCollection-class {GSEABase} | R Documentation

## Class "GeneSetCollection"

### Description

a `GeneSetCollection` is a collection of related `GeneSet`s. The collection can mix and match different types of gene sets. Members of the collection are refered to by the `setName`s of each gene set.

### Objects from the Class

Construct a `GeneSetCollection` with a `GeneSetCollection` method, e.g., from a list of gene sets or with several gene sets provided as argument to the constructor. See examples below.

### Slots

`.Data`:

  Object of class `"list"`, containing the gene sets.

### Extends

Class `"list"`, from data part. Class `"vector"`, by class "list", distance 2. Class `"AssayData"`, by class "list", distance 2.

### Methods

Gene set collection construction

GeneSetCollection

  See `GeneSetCollection` methods and `getBroadSets` for convenient construction methods.

Collection access (operations on lists, such as `length`, , `lapply` also work on `GeneSetCollection`).

geneIds

  `signature(object = "GeneSetCollection")`: return a list, with each member a character vector of gene identifiers from the gene set collection.

geneIds<-

  `signature(object="GeneSetCollection", value="list")`: assign character vectors in `value` to corresponding `geneIds` of `object`.

names

  `signature(x = "GeneSetCollection")`: return the `setName` of each gene set in the colloection.

Logical and subsetting operations

union

  `signature(x = "GeneSetCollection", y = "ANY")`, `signature(x = "ANY", y = "GeneSetCollection")`: ...

|

  `signature(e1 = "GeneSetCollection", e2 = "ANY")`, `signautre(e1 = "GeneSet", e2 = "GeneSetCollection")`, `signautre(e1 = "character", e2 = "GeneSetCollection")`, `signature(e1 = "ANY", e2 = "GeneSetCollection")`: calculate the logical 'or' (union) of all gene identifiers in an object over all members of the gene set collection.

intersect

  `signature(x = "GeneSetCollection", y = "ANY")`, `signature(x = "ANY", y = "GeneSetCollection")`: ...

&

  `signature(e1 = "GeneSetCollection", e2 = "ANY")`, `signautre(e1 = "character", e2 = "GeneSetCollection")`, `signautre(e1 = "GeneSet", e2 = "GeneSetCollection")`, `signature(e1 = "ANY", e2 = "GeneSetCollection")`: calculate the logical ‘and’ (intersection) of all gene identifiers in a gene set or character vector, over all members of the gene set collection.

setdiff

  `signature(x = "GeneSetCollection", y = "ANY")`: calculate the logical set difference betwen all gene sets in a collection and the gene identifiers of a gene set or character vector. A `setdiff` method must be available for `x="GeneSet"` and the type of `y`.

[<-

  `signature(x = "GeneSetCollection", i = "ANY", j = "ANY", value = "ANY")`, `signature(x = "GeneSetCollection", i = "ANY", j = "ANY", value = "GeneSet")`, `signature(x = "GeneSetCollection", i = "character", j = "ANY", value = "GeneSet")`: assign new sets to existing set members. To add entirely new sets, use a `GeneSetCollection` constructor.

[

  `signature(x = "GeneSetCollection", i = "logical")`, `signature(x = "GeneSetCollection", i = "numeric")`, `signature(x = "GeneSetCollection", i = "character")`: create a `GeneSetCollection` consisting of a subset of the current set. All indicies `i` must already be present in the set.

[[

  `signature(x = "GeneSetCollection", i = "character")`: Select a single gene set from the collection. Methods for `i="numeric"` are inherited from `list`.

[[<-

  `signature(x = "GeneSetCollection", i = "ANY", j = "ANY", value = "ANY")`, `signature(x = "GeneSetCollection", i = "numeric", j = "ANY", value = "GeneSet")`, `signature(x = "GeneSetCollection", i = "character", j = "ANY", value = "GeneSet")`: Replace a gene set in the collecton with another. `value = "ANY"` serves to stop invalid assignments.

Additional useful methods.

updateObject

  Objects created in previous versions of GSEABase may be incompatible with current object definitions. Usually this is singalled by an error suggesting that a slot is missing, and a recommnedation to use `updateObject`. Use `updateObject` to update a `GeneSetCollection` and all contained `GeneSets` to their current defintion.

mapIdentifiers

  Convert genes from one `GeneIdentifierType` to another. See `mapIdentifiers` and specific methods in `GeneIdentifierType` for additional detail.

incidence

  Summarize shared membership in genes across gene sets. See `incidence-methods`.

toGmt

  Export to 'GMT' format file. See `toGmt`.

show

  `signature(object="GeneSetCollection")`: provide a compact representation of `object`.

### Author(s)

Martin Morgan <Martin.Morgan@RoswellPark.org>

### See Also

`GeneSet`, `GeneColorSet`.

### Examples

    gs1 <- GeneSet(setName="set1", setIdentifier="101")
    gs2 <- GeneSet(setName="set2", setIdentifier="102")

    ## construct from indivdiual elements...
    gsc <- GeneSetCollection(gs1, gs2)
    ## or from a list
    gsc <- GeneSetCollection(list(gs1, gs2))

    ## 'names' are the setNames
    names(gsc)

    ## a collection of a single gene set
    gsc["set1"]
    ## a gene set
    gsc[["set1"]]

    ## set names must be unique
    try(GeneSetCollection(gs1, gs1))
    try(gsc[c("set1", "set1")])

[Package GSEABase version 1.54.0 Index]