Year 2019: Difference between revisions

From QiuLab
Jump to navigation Jump to search
imported>Lab
imported>Lab
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
# Map gene names
# Map gene names
# Cluster and show by interactive heatmaps in R
# Cluster and show by interactive heatmaps in R
<syntaxhighlight lang="bash">
# Quantile normalization
library(preprocessCore)
w2.mat <- as.matrix(w2[,3:17]) #convert original data to matrix
w2.mat.norm <- normalize.quantiles.robust(w2.mat, copy = TRUE, use.log2 = TRUE)
rownames(w2.mat.norm) <- w2$Geneid
# linear model
fits <- lmList(log.counts ~ group | geneID, data=w2.norm.melt)
lm.sum <- lapply(fits, function(x){
  out<-summary(x);
  fstat <- out$fstatistic;
  pf(fstat[1], fstat[2], fstat[3], lower.tail=F)
})
p.df <- data.frame(gene=names(fits), p.val=as.numeric(lm.sum))
w2.out <- cbind(w2[,1:2], w2.mat.norm, p.df[,1:2])
# heatmap
heatmaply(td.mat, scale = "none" , cexRow = 0.50, colors = colorspace::diverge_hsv(16), branches_lwd = 0.3)
</syntaxhighlight>
* Results
* Results
# [http://diverge.hunter.cuny.edu/~weigang/heatmap_td.html Heatmap 1. Scaled by gene]
# [http://diverge.hunter.cuny.edu/~weigang/heatmap_td.html Heatmap 1. p<1e-5, showing Fold Change over mean of wild type]
# [http://diverge.hunter.cuny.edu/~weigang/heatmap_td.html heatmap of top differentiately expressed genes (p<0.001, 1e-3). Values are Fold Change over mean Wild Type]

Latest revision as of 17:24, 8 February 2019

TD Project

  • Credit: Christopher Panlasigui
  • Brief computational/statistical steps:
  1. Quantile normalization between all replicates (with log2 transformatuon)
  2. Linear model among the 3 groups
  3. Select top significant genes
  4. Map gene names
  5. Cluster and show by interactive heatmaps in R
# Quantile normalization
library(preprocessCore)
w2.mat <- as.matrix(w2[,3:17]) #convert original data to matrix
w2.mat.norm <- normalize.quantiles.robust(w2.mat, copy = TRUE, use.log2 = TRUE)
rownames(w2.mat.norm) <- w2$Geneid

# linear model
fits <- lmList(log.counts ~ group | geneID, data=w2.norm.melt)
lm.sum <- lapply(fits, function(x){
  out<-summary(x);
  fstat <- out$fstatistic;
  pf(fstat[1], fstat[2], fstat[3], lower.tail=F)
})
p.df <- data.frame(gene=names(fits), p.val=as.numeric(lm.sum))
w2.out <- cbind(w2[,1:2], w2.mat.norm, p.df[,1:2])

# heatmap
heatmaply(td.mat, scale = "none" , cexRow = 0.50, colors = colorspace::diverge_hsv(16), branches_lwd = 0.3)
  • Results
  1. Heatmap 1. p<1e-5, showing Fold Change over mean of wild type