Git Product home page Git Product logo

goheatmap's Introduction

Goheatmap

Heatmap with GO Terms

Installation

The development version can be installed from GitHub using:

devtools::install_github("ilwookkim/GOheatmap")

Usage

library(GOheatmap)

Load example data selected STAD-TCGA RNAseq data (50 patients from TP53 wildtype and 50 from mutation; 275 genes selected by top significant DEGs) mat: RSEM countdata of RNAseq, samples_df: samples annotation data frame

mat.file <- system.file("extdata", "mat.Rdata", package="GOheatmap")
load(mat.file)
ls()
[1] "mat"        "mat.file"   "samples_df"

Pre-treatment

Remove NA, if necessary.

mat <- data.frame(na.omit(mat))
knitr::kable(head(mat[, 1:4], 3), "simple")

# column: samples, row: genes (HGNC symbol)

         TCGA.CD.8536.01   TCGA.BR.8077.01   TCGA.HU.A4G3.01   TCGA.HU.A4H4.01
------  ----------------  ----------------  ----------------  ----------------
ACTC1                 31               104               349                37
ACTG2               4385              2080              6012              1236
ACTN2                  1                 6                 0                 1

Run goheatmap

goheatmap function needs the following parameters. RNAseq countdata (column: samples ID, row: HGNC gene symbol), anno (samples annotation data frame, Default to NULL) ,Parameters k (number of clustering, Default to 3), n_go (number of terms to display, Default to 3), sources details here, cor (TRUE for spearman's correlation coefficient, FALSE for vst scaled matrix, Default to TRUE), title (Title of heatmap, Default to GOheatmap)

# For the spearman's correlation coefficient matrix

goheatmap(mat, k = 3, n_go = 3, sources = "GO:BP", cor.s = TRUE, title = "GOheatmap")
goheatmap(mat, k = 3, n_go = 3, sources = "KEGG", cor.s = TRUE, title = "GOheatmap")

When sources = "", goheatmap function uses all possible sources ("GO:MF","GO:CC","GO:BP","KEGG","REAC","WP","TF","MIRNA","HPA","CORUM","HP")

goheatmap(mat, k = 3, n_go = 3, sources = "", cor.s = TRUE, title = "GOheatmap")

When cor.s = FALSE, then countdata needs to be normalized for visualization.

# For the normalized count matrix by DESeq2

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("DESeq2")

library(DESeq2)
dds <- DESeqDataSetFromMatrix(countData = mat,
                              colData = samples_df,
                              design = ~ condition)

dds <- DESeq(dds)
mat <- as.data.frame(counts(dds, normalized=T))

If a sample annotation data frame exists, provide it into anno parameter. Default to NULL

knitr::kable(head(samples_df[, 1:2], 3), "simple")
samples           condition 
----------------  ----------
TCGA.CD.8536.01   TP53wt    
TCGA.BR.8077.01   TP53mut   
TCGA.HU.A4G3.01   TP53wt    
goheatmap(mat, anno = samples_df, k = 3, n_go = 3, sources = "GO:BP", cor.s = FALSE, title = "GOheatmap")

goheatmap's People

Contributors

ilwookkim avatar sfzero2 avatar

Watchers

 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.