Solution

library(RnaSeqTutorial)
counts <- readAbundance("~/share/leaf",
                        pattern = "*\\.sf",
                        type = "salmon")
nonExpressed(counts)
rawDataMeanPlot(counts)
rawDataSamplePlot(counts)
samples <- read.csv("~/share/leaf/doc/samples.csv")
dds <- createDESeqDataSet(counts,samples,design = ~DevStage)
reportSizeFactors(dds)
plotUnTransformed(dds)
vst <- transform(dds)
validateVST(vst)
palette <- brewer.pal(length(levels(samples$DevStage)),"Dark2")
plotPca(vst,samples,color=palette[as.integer(samples$DevStage)])
dds <- DESeq(dds)
resultsNames(dds)
alpha=0.01
log2FC=0.5
res <- results(dds,contrast = list("DevStage_Dminus3_vs_D0","DevStage_Dminus4_vs_D0"))
res[abs(res$log2FoldChange) >= log2FC &
        ! is.na(res$padj) &
        res$padj <= alpha,]
plotMA(as(res,"DataFrame"),
       alpha=alpha,
       log2FC=log2FC)
volcanoPlot(res,alpha=alpha,log2FC=log2FC)


UPSCb/RnaSeqTutorial documentation built on Nov. 24, 2020, 12:40 a.m.