Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleUsage for Plot Generation
#Within R
#Install and Load libraries
install.packages("gplots")
install.packages("pheatmap")
library("DESeq2")
library("RColorBrewer")
library("gplots")
library( "genefilter" )
library("pheatmap")
 
#I've already run DESEQ2 on this experiment for you. Just load the results
load("deseq2.kallisto.RData")

#Regularized log transformation
rld <- rlog( dds )

#Get 25 top varying genes
topVarGenes <- head( order( rowVars( assay(rld) ), decreasing=TRUE ), 25)
 
#Use heatmap.2 function to draw a heatmap
#INCLUDE NEXT LINE IF YOU WANT TO SAVE THE FIGURE IN A FILE
#png#pdf(file="gene.heatmap.pngpdf",width=500,height=500,res=72)
heatmap.2( assay(rld)[ topVarGenes, ], scale="row",trace="none", dendrogram="column",col = colorRampPalette( rev(brewer.pal(9, "RdBu")) )(255))
#INCLUDE NEXT LINE IF YOU WANT TO SAVE THE FIGURE IN A FILE
#dev.off()
 
#PLOT PCA
#INCLUDE NEXT LINE IF YOU WANT TO SAVE THE FIGURE IN A FILE
#png#pdf(file="pca.pngpdf",width=400,height=350,res=72)
print(plotPCA(rld, intgroup=c("condition")))
#INCLUDE NEXT LINE IF YOU WANT TO SAVE THE FIGURE IN A FILE
#dev.off()

...