Giter Site home page Giter Site logo

geneset's Introduction

Build Status codecov

geneset

Gene sets and functions for working with them.

data sets

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/ddw288
  • stress: Gene expression levels in blood found as signatures of stress in five different studies. See the in-package description ?stress for details.

examples

installation

devtools::install_github("3inar/geneset")

load .gmt files

If 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
## $names
## [1] "set1"         "set2"         "name w space"
## 
## $descriptions
## [1] "description 1" "description 2" "description3" 
## 
## $genesets
## $genesets[[1]]
## [1] "a" "b" "c"
## 
## $genesets[[2]]
## [1] "d" "e" "f"
## 
## $genesets[[3]]
## [1] "a" "b" "c" "d" "e" "f" "g"
## 
## 
## attr(,"class")
## [1] "gset"

subset gset objects

You 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]
## $names
## [1] "set2"
## 
## $descriptions
## [1] "description 2"
## 
## $genesets
## $genesets[[1]]
## [1] "d" "e" "f"
## 
## 
## attr(,"class")
## [1] "gset"
geneset[c(T, F, T)]
## $names
## [1] "set1"         "name w space"
## 
## $descriptions
## [1] "description 1" "description3" 
## 
## $genesets
## $genesets[[1]]
## [1] "a" "b" "c"
## 
## $genesets[[2]]
## [1] "a" "b" "c" "d" "e" "f" "g"
## 
## 
## attr(,"class")
## [1] "gset"
length(geneset)
## [1] 3

remove genes that aren't in your data

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
## $names
## [1] "set1"         "set2"         "name w space"
## 
## $descriptions
## [1] "description 1" "description 2" "description3" 
## 
## $genesets
## $genesets[[1]]
## [1] "a" "b"
## 
## $genesets[[2]]
## [1] "d" "e" "f"
## 
## $genesets[[3]]
## [1] "a" "b" "d" "e" "f"
## 
## 
## attr(,"class")
## [1] "gset"

filter out gene sets that are too small or large

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
## $names
## [1] "set2"         "name w space"
## 
## $descriptions
## [1] "description 2" "description3" 
## 
## $genesets
## $genesets[[1]]
## [1] "d" "e" "f"
## 
## $genesets[[2]]
## [1] "a" "b" "d" "e" "f"
## 
## 
## attr(,"class")
## [1] "gset"

geneset's People

Contributors

3inar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.