Posts

Showing posts from December, 2015

R TIPs: How to get venn diagram in PDF format using VennDiagram?

Image
1. Download  VennDiagram_1.6.16.tar.gz wget https://cran.r-project.org/src/contrib/VennDiagram_1.6.16.tar.gz 2. Uncompress tar zxvf VennDiagram_1.6.16.tar.gz 3. Enter into VennDiagram cd VennDiagram 4. Open R/venn.diagram.R 5. Insert the codes below in line 486.                  # PDF image type specified                 else if('pdf' == imagetype) {                         pdf(                                 filename = filename,                                 height = height,                                 width = width                                 );                         }

R Tips: How to normalize data?

When I was analyzing RNA-seq data, I usually need to normalize the gene expression value (FPKM). Packages "recommenderlab" can easily help us to do this.  Here is an example:  setwd("Y:/conte/x/xie186/DrZhaoChunzhao/project_CBF_RNA-seq/results/RNA-seq_cdf_151202/cuffdiff/cdf_regulon_genes") library(gplots) cc<-read.table("cbf_regulon_gene_fc1_fc1_heat.txt") library(recommenderlab) r <- as(as.matrix(log2(cc + 0.001)), "realRatingMatrix") r_norm <- normalize(r, method="Z-score", row=TRUE) dat <- as(r_norm, "matrix")