Learn R Programming

GSNA (version 0.1.4.2)

gsnFilterGeneSetCollectionList: gsnFilterGeneSetCollectionList

Description

Given a vector of gene symbols and a gene set collection, filter the gene set collection to include only gene symbols present in the background.

Usage

gsnFilterGeneSetCollectionList(bg, geneSetCollection)

Value

A filtered gene set as a list of vectors of gene symbols in which the list names correspond to gene set IDs.

Arguments

bg

A character vector representing gene symbols in a background of observable genes.

geneSetCollection

A list of gene sets, in which the gene sets are character vectors containing gene symbols, and the list names are the corresponding gene set identifiers. NOTE: This must be a list, not a tmod object. It is trivial to extract such a list from a tmod object, however. The $MODULES2GENES field of the tmod object contains a suitable list.

Details

This function is used in gsnORAtest_cpp to automatically filter the gene set provided. It may be used manually during GSNA analysis.

Examples

Run this code

library(GSNA)

# Get the background of observable genes set from
# expression data:
gene_background <- toupper(rownames( Bai_empty_expr_mat ))

# Generate a gene set collection as a list of vectors from
# **Bai_gsc.tmod**, included in sample data:
Bai.gsc <- tmod2gsc( Bai_gsc.tmod )

# Using the sample gene set collection **Bai_gsc.tmod**,
# generate a gene set collection filtered for the bg of
# observable genes:
Bai.filt.gsc <- gsnFilterGeneSetCollectionList( bg = gene_background,
                                         geneSetCollection = Bai.gsc )

Run the code above in your browser using DataLab