knitr::opts_chunk$set(echo = TRUE)
Gene sets and functions for working with them.
This package contains the following data sets:
smoking: Blood transcriptome gene signatures that associate with cigarette
smoking from the Huan et al. 2016 meta-analysis http://dx.doi.org/10.1093/hmg/ddw288stress: Gene expression levels in blood found as signatures of
stress in five different studies. See the in-package description ?stress for
details.devtools::install_github("3inar/geneset")
.gmt filesIf you're working with gene sets from MSigDB, it's quite likely that you have files
in the Gene Matrix Transposed format; the load_gmt() function will read a .gmt
file into a gset object:
library(geneset) geneset <- load_gmt("tests/testthat/testgmt.gmt") # dummy .gmt file for testing geneset
gset objectsYou can subset gsets like you would a vector. There is also a lenght function
for them that returns the number of sets in the gset:
geneset[2] geneset[c(T, F, T)] length(geneset)
Inevitably some gene sets will contain symbols that for one reason or another
aren't present in the data set you're investigating. These can be removed by
gsintersect():
mygenes <- c("a", "b", "d", "e", "f") geneset <- gsintersect(geneset, mygenes); geneset
Perhaps a two-gene set is too small to be taken seriously for whatever reason,
gsfilter() will remove gene sets with cardinality outside of provided limits:
geneset <- gsfilter(geneset, min=3); geneset
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.