nGenes {AUCell} | R Documentation

## GeneSet methods

### Description

Functions to manipulate GeneSet and GeneSetCollection objects (from package GSEABase)

### Usage

    nGenes(geneSet)

    ## S4 method for signature 'GeneSet'
    nGenes(geneSet)

    ## S4 method for signature 'GeneSetCollection'
    nGenes(geneSet)

    subsetGeneSets(geneSets, geneNames)

    ## S4 method for signature 'GeneSetCollection'
    subsetGeneSets(geneSets, geneNames)

    setGeneSetNames(geneSets, newNames)

    ## S4 method for signature 'GeneSetCollection'
    setGeneSetNames(geneSets, newNames)

### Arguments

`geneSet` | One gene-set (`GeneSet`)
`geneSets` | Gene-set collection (`GeneSetCollection`)
`geneNames` | Gene names (for subset)
`newNames` | New names (to assign to the gene sets)

### Value

- **nGenes()**: provides the number of genes in the gene-set, or each of the gene-sets in a collection

- **subsetGeneSets()**: Subsets each of the gene-sets in a collection to contain only the genes inthe given list. Equivalent to intersect(), but keeping the original gene-set name.

- **setGeneSetNames()**: Modifies the name of each gene-set in a collection

### Examples

    library(GSEABase)
    genes_1 <- GeneSet(paste("Gene", 1:20, sep=""), setName="geneSet1")
    genes_2 <- GeneSet(paste("Gene", 18:22, sep=""), setName="geneSet2")
    geneSets <- GeneSetCollection(genes_1, genes_2)

    nGenes(genes_1)
    nGenes(geneSets)

    subsetGeneSets(geneSets, paste("Gene", 15:20, sep=""))

    geneSets_newNames <- setGeneSetNames(geneSets, c("one", "two"))
    names(geneSets_newNames)

[Package AUCell version 1.14.0 Index]