Source codes: https://github.com/markziemann/tohidul_rnaseq

Background

Generate a heatmap of expression:

suppressPackageStartupMessages({
    library("gplots")
})

Load data

Here we load the data produced by earlier analysis We use the Kallisto transcript quantifications and summarise these to gene level.

de1 <- read.table("de1.tsv",header=TRUE,row.names=1,sep="\t",fill=TRUE)
de1_up <- subset(de1,log2FoldChange>1.5 & padj < 0.05)$GeneID
writeLines(de1_up,con="de1up.txt")

Then I searched in the eFP browser. Here's a list of Genes Not Found in the Database:

At1g07985, At1g29100, At1g47395, At1g53610, At1g58320, At2g36255, At4g11393, At4g25433, At4g36850, At5g46610, At5g54165

# numeric data first
datfile="exprss_text_unsorted_25077.txt"
efp <- read.table(datfile, header=TRUE, row.names=1, sep="\t", comment.char="#")
genenames <- efp[,1,drop=FALSE]
efp[,1]=NULL

# sample info data next
dat <- readLines(datfile)
dat <- dat[grep('#',dat)]
datlist <- strsplit(dat,"\t")
sampleinfo <- as.data.frame(do.call(rbind, datlist))
sampleinfo[1:5,1:6]
##          V1 V2          V3          V4          V5          V6
## 1 #category    Cold Stress Cold Stress Cold Stress Cold Stress
## 2      #age           1.02        1.02        1.02        1.02
## 3   #tissue          Shoot        Root       Shoot        Root
## 4  #control            Yes         Yes         Yes         Yes
## 5   #mutant             Wt          Wt          Wt          Wt
sampleinfo$V2=NULL
rownames(sampleinfo) <- gsub("#","",sampleinfo$V1)
sampleinfo$V1=NULL
sampleinfo <- as.data.frame(t(sampleinfo))
str(sampleinfo)
## 'data.frame':    236 obs. of  7 variables:
##  $ category  : chr  "Cold Stress" "Cold Stress" "Cold Stress" "Cold Stress" ...
##  $ age       : chr  "1.02" "1.02" "1.02" "1.02" ...
##  $ tissue    : chr  "Shoot" "Root" "Shoot" "Root" ...
##  $ control   : chr  "Yes" "Yes" "Yes" "Yes" ...
##  $ mutant    : chr  "Wt" "Wt" "Wt" "Wt" ...
##  $ timecourse: chr  "0.5 h" "0.5 h" "1.0 h" "1.0 h" ...
##  $ alias     : chr  "Col-0" "Col-0" "Col-0" "Col-0" ...

Filtering

# Shoot

cols <- which(
  sampleinfo$timecourse =="1.0 h" &
  sampleinfo$control =="No" &
  sampleinfo$tissue =="Shoot" &
  sampleinfo$age =="1.02" )

shoot <- efp[,cols]

shootsampleinfo <- sampleinfo[cols,]
shootsampleinfo
##              category  age tissue control mutant timecourse alias
## V17       Cold Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V41    Osmotic Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V65       Salt Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V93    Drought Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V117 Genotoxic Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V141 Oxidative Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V169      UV-B Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V197  Wounding Stress 1.02  Shoot      No     Wt      1.0 h Col-0
## V227      Heat Stress 1.02  Shoot      No     Wt      1.0 h Col-0
colnames(shoot) <- gsub(" Stress","",shootsampleinfo$category)


# Root

cols <- which(
  sampleinfo$timecourse =="1.0 h" &
  sampleinfo$control =="No" &
  sampleinfo$tissue =="Root" &
  sampleinfo$age =="1.02" )


root <- efp[,cols]

rootsampleinfo <- sampleinfo[cols,]
rootsampleinfo
##              category  age tissue control mutant timecourse alias
## V18       Cold Stress 1.02   Root      No     Wt      1.0 h Col-0
## V42    Osmotic Stress 1.02   Root      No     Wt      1.0 h Col-0
## V66       Salt Stress 1.02   Root      No     Wt      1.0 h Col-0
## V94    Drought Stress 1.02   Root      No     Wt      1.0 h Col-0
## V118 Genotoxic Stress 1.02   Root      No     Wt      1.0 h Col-0
## V142 Oxidative Stress 1.02   Root      No     Wt      1.0 h Col-0
## V170      UV-B Stress 1.02   Root      No     Wt      1.0 h Col-0
## V198  Wounding Stress 1.02   Root      No     Wt      1.0 h Col-0
## V228      Heat Stress 1.02   Root      No     Wt      1.0 h Col-0
colnames(root) <- gsub(" Stress","",rootsampleinfo$category)

# osmoroot

cols <- which(
  sampleinfo$control =="No" &
  sampleinfo$category =="Osmotic Stress" &
  sampleinfo$tissue =="Root" )

osmoroot <- efp[,cols]

osmorootsampleinfo <- sampleinfo[cols,]
osmorootsampleinfo
##           category  age tissue control mutant timecourse alias
## V40 Osmotic Stress 1.02   Root      No     Wt      0.5 h Col-0
## V42 Osmotic Stress 1.02   Root      No     Wt      1.0 h Col-0
## V44 Osmotic Stress 1.02   Root      No     Wt      3.0 h Col-0
## V46 Osmotic Stress 1.02   Root      No     Wt      6.0 h Col-0
## V48 Osmotic Stress 1.02   Root      No     Wt     12.0 h Col-0
## V50 Osmotic Stress 1.02   Root      No     Wt     24.0 h Col-0
colnames(osmoroot) <- gsub(" Stress","",osmorootsampleinfo$timecourse)


# root12h

cols <- which(
  sampleinfo$control =="No" &
  sampleinfo$timecourse =="12.0 h" &
  sampleinfo$tissue =="Root" )

root12h <- efp[,cols]

root12hsampleinfo <- sampleinfo[cols,]
root12hsampleinfo
##              category  age tissue control mutant timecourse alias
## V24       Cold Stress 1.02   Root      No     Wt     12.0 h Col-0
## V48    Osmotic Stress 1.02   Root      No     Wt     12.0 h Col-0
## V72       Salt Stress 1.02   Root      No     Wt     12.0 h Col-0
## V100   Drought Stress 1.02   Root      No     Wt     12.0 h Col-0
## V124 Genotoxic Stress 1.02   Root      No     Wt     12.0 h Col-0
## V148 Oxidative Stress 1.02   Root      No     Wt     12.0 h Col-0
## V176      UV-B Stress 1.02   Root      No     Wt     12.0 h Col-0
## V204  Wounding Stress 1.02   Root      No     Wt     12.0 h Col-0
## V236      Heat Stress 1.02   Root      No     Wt     12.0 h Col-0
colnames(root12h) <- gsub(" Stress","",root12hsampleinfo$category)

# root24h

cols <- which(
  sampleinfo$control =="No" &
  sampleinfo$timecourse =="24.0 h" &
  sampleinfo$tissue =="Root" )

root24h <- efp[,cols]

root24hsampleinfo <- sampleinfo[cols,]
root24hsampleinfo
##              category  age tissue control mutant timecourse alias
## V26       Cold Stress 1.02   Root      No     Wt     24.0 h Col-0
## V50    Osmotic Stress 1.02   Root      No     Wt     24.0 h Col-0
## V74       Salt Stress 1.02   Root      No     Wt     24.0 h Col-0
## V102   Drought Stress 1.02   Root      No     Wt     24.0 h Col-0
## V126 Genotoxic Stress 1.02   Root      No     Wt     24.0 h Col-0
## V150 Oxidative Stress 1.02   Root      No     Wt     24.0 h Col-0
## V178      UV-B Stress 1.02   Root      No     Wt     24.0 h Col-0
## V206  Wounding Stress 1.02   Root      No     Wt     24.0 h Col-0
## V238      Heat Stress 1.02   Root      No     Wt     24.0 h Col-0
colnames(root24h) <- gsub(" Stress","",root24hsampleinfo$category)

# shoot12h

cols <- which(
  sampleinfo$control =="No" &
  sampleinfo$timecourse =="12.0 h" &
  sampleinfo$tissue =="Shoot" )

shoot12h <- efp[,cols]

shoot12hsampleinfo <- sampleinfo[cols,]
shoot12hsampleinfo
##              category  age tissue control mutant timecourse alias
## V23       Cold Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V47    Osmotic Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V71       Salt Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V99    Drought Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V123 Genotoxic Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V147 Oxidative Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V175      UV-B Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V203  Wounding Stress 1.02  Shoot      No     Wt     12.0 h Col-0
## V235      Heat Stress 1.02  Shoot      No     Wt     12.0 h Col-0
colnames(shoot12h) <- gsub(" Stress","",shoot12hsampleinfo$category)

# root24h

cols <- which(
  sampleinfo$control =="No" &
  sampleinfo$timecourse =="24.0 h" &
  sampleinfo$tissue =="Shoot" )

shoot24h <- efp[,cols]

shoot24hsampleinfo <- sampleinfo[cols,]
shoot24hsampleinfo
##              category  age tissue control mutant timecourse alias
## V25       Cold Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V49    Osmotic Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V73       Salt Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V101   Drought Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V125 Genotoxic Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V149 Oxidative Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V177      UV-B Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V205  Wounding Stress 1.02  Shoot      No     Wt     24.0 h Col-0
## V237      Heat Stress 1.02  Shoot      No     Wt     24.0 h Col-0
colnames(shoot24h) <- gsub(" Stress","",shoot24hsampleinfo$category)

Heatmap

Scale off

#colour palette
colfunc <- colorRampPalette(c("blue", "white", "red"))

# shoot
heatmap.2( as.matrix(shoot), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Shoot")

# with proper names
shoot2 <- shoot
rownames(shoot2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(shoot2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Shoot")

# root
heatmap.2( as.matrix(root), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root")

# with proper names
root2 <- root
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root")

# osmoroot
heatmap.2( as.matrix(osmoroot), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root osmotic stress")

# with proper names
root2 <- osmoroot
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root osmotic stress")

#root12h
heatmap.2( as.matrix(root12h), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root 12 hrs")

root2 <- root12h
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root 12 hrs")

#root24h
heatmap.2( as.matrix(root24h), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root 24 hrs")

root2 <- root24h
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root 24 hrs")

#shoot12h
heatmap.2( as.matrix(shoot12h), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Shoot 12 hrs")

shoot2 <- shoot12h
rownames(shoot2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(shoot2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Shoot 12 hrs")

#root24h
heatmap.2( as.matrix(shoot24h), col=colfunc(25),scale="none",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Shoot 24 hrs")

shoot2 <- shoot24h
rownames(shoot2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="none",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Shoot 24 hrs")

Scale on

#colour palette
colfunc <- colorRampPalette(c("blue", "white", "red"))

# shoot
heatmap.2( as.matrix(shoot), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Shoot")

# with proper names
shoot2 <- shoot
rownames(shoot2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(shoot2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Shoot")

# root
heatmap.2( as.matrix(root), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root")

# with proper names
root2 <- root
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root")

# osmoroot
heatmap.2( as.matrix(osmoroot), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root osmotic stress")

# with proper names
root2 <- osmoroot
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root osmotic stress")

#root12h
heatmap.2( as.matrix(root12h), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root 12 hrs")

root2 <- root12h
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root 12 hrs")

#root24h
heatmap.2( as.matrix(root24h), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Root 24 hrs")

root2 <- root24h
rownames(root2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Root 24 hrs")

#shoot12h
heatmap.2( as.matrix(shoot12h), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Shoot 12 hrs")

shoot2 <- shoot12h
rownames(shoot2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(shoot2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Shoot 12 hrs")

#root24h
heatmap.2( as.matrix(shoot24h), col=colfunc(25),scale="row",
trace="none",margins = c(6,20), cexRow=.6, cexCol=.8,  main="Shoot 24 hrs")

shoot2 <- shoot24h
rownames(shoot2) <- paste(rownames(genenames),genenames$NAME)
heatmap.2( as.matrix(root2), col=colfunc(25),scale="row",
trace="none",margins = c(6,25), cexRow=.6, cexCol=.8,  main="Shoot 24 hrs")

Session information

So you know what version of R and packages was used.

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.5 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] gplots_3.1.0
## 
## loaded via a namespace (and not attached):
##  [1] gtools_3.8.2       digest_0.6.27      bitops_1.0-6       magrittr_1.5      
##  [5] evaluate_0.14      KernSmooth_2.23-18 rlang_0.4.8        stringi_1.5.3     
##  [9] rmarkdown_2.5      tools_4.0.3        stringr_1.4.0      xfun_0.19         
## [13] yaml_2.2.1         compiler_4.0.3     caTools_1.18.0     htmltools_0.5.0   
## [17] knitr_1.30