qs
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:7/7))
qs
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:7/7))
qs
bins = cut(resNoFilt$baseMean, qs)
bins
?cut
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > 0], qs)
bins
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
bins
ratios = tapply(resNoFilt$pval, bins, function(p) mean(p < 0.01, na.rm = TRUE))
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > 0], bins, function(p) mean(p < 0.01, na.rm = TRUE))
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
## Create bins using the quantile function
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > -1], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > -1]], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > -1]], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
## Create bins using the quantile function
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > -1], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > -1]], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > -1]], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
bins
rm(bins)
## Create bins using the quantile function
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > -1], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > -1]], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > -1]], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
## Create bins using the quantile function
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > -1], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > -1], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > -1]], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > -1], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > -1], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > -1], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > -1], qs)
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:7/7))
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > 0], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
bins
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > 0], bins, function(p) mean(p < 0.01, na.rm = TRUE))
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
qs
## Create bins using the quantile function
qs = quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:7/7)
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > 0], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > 0], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
## Create bins using the quantile function
qs = quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:10/10)
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > 0], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > 0], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
qs = quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:10/10)
qs
qs = quantile(resNoFilt$baseMean, 0:10/10)
qs
## Create bins using the quantile function
qs = quantile(resNoFilt$baseMean, 0:10/10)
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean, qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval, bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
## Create bins using the quantile function
qs = quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:10/10)
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > 0], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[resNoFilt$baseMean > 0], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:10/10)
quantile(resNoFilt$baseMean, 0:10/10)
bins = cut(resNoFilt$baseMean[resNoFilt$baseMean > 0], qs)
bins = cut(resNoFilt$baseMean, qs)
bins
resNoFilt$baseMean
qs = quantile(resNoFilt$baseMean, 0:10/10)
qs
bins = cut(resNoFilt$baseMean, qs)
bins
qs = quantile(resNoFilt$baseMean, 0:10/10)
bins = cut(resNoFilt$baseMean, qs)
bins
qs = quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:10/10)
qs
qs = quantile(resNoFilt$baseMean, 0:10/10)
qs
cut(resNoFilt$baseMean, qs)
## Create bins using the quantile function
pos = (resNoFilt$baseMean > 0)
qs = quantile(resNoFilt$baseMean[pos], 0:10/10)
## "cut" the genes into the bins
bins = cut(resNoFilt$baseMean[pos], qs)
## Rename the levels of the bins using the middle point
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
## Calculate the ratio of p values less than 0.01 for each bin
ratios = tapply(resNoFilt$pval[pos], bins, function(p) mean(p < 0.01, na.rm = TRUE))
## Plot these ratios
barplot(ratios, xlab = "mean normalized count", ylab = "ratio of small p-values")
bins
library("ggbio", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
?results
?result
library("DESeq2", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
?results
library("metabolomics", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
data(treated)
treated.log <- LogTransform(treated)$output
HeatMap(treated.log, scale = "row", dendrogram = "col", colramp=gradcol(75, "red", "green"))
data(treated)
treated.log <- LogTransform(treated, base = 2)$output
results <- TwoGroup(treated.log)$output
pval <- results[, 2]
fc <- results[, 4]
VolcanoPlot(fc, pval, cexlab = 0.8)
data(treated)
treated.log <- LogTransform(treated, base = 2)$output
results <- TwoGroup(treated.log)$output
pval <- results[, 2]
fc <- results[, 4]
VolcanoPlot(fc, pval, cexlab = 0.8)
VolcanoPlot
resEdgeR
library(edgeR)
library(ggplot2)
library(reshape)
library(RColorBrewer)
library(matrixStats)
library(gplots)
source('~/Tutorial_Rnw/Fonctions/simulCountsFun.R')
source('~/Tutorial_Rnw/Fonctions/simulPoisCountsFun.R')
source("~/Tutorial_Rnw/Fonctions/plotMeanVarEdgeR.R")
source("/home/igonzalez/Projets/Formation_ARNseq/Support/Diff_Expression/estmateTagwiseDisp.R")
## Simulated data in the DESeq2 analysis example
set.seed(1)
y <- makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
group <- colData(y)$condition
y <- counts(y)
## edgeR analysis
y <- DGEList(counts = y, group = group)
y <- estimateCommonDisp(y)
y <- estimateTagwiseDisp(y)
resEdgeR <- exactTest(y)
library(DESeq2)
## Simulated data
set.seed(1)
dds <- makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
## DESeq2 analysis
dds <- DESeq(dds)
resDESeq2 <- results(dds)
conditions = colData(dds)$condition
cds = counts(dds)
library(DESeq)
cds = newCountDataSet(cds, conditions)
cds = estimateSizeFactors(cds)
cds = estimateDispersions(cds)
resDESeq = nbinomTest(cds, "A", "B")
## Simulated data in the DESeq2 analysis example
set.seed(1)
y <- makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
group <- colData(y)$condition
y <- counts(y)
## edgeR analysis
y <- DGEList(counts = y, group = group)
y <- estimateCommonDisp(y)
y <- estimateTagwiseDisp(y)
resEdgeR <- exactTest(y)
resEdgeR
resEdgeR$table$logFC
fc
resEdgeR$table[, 1]
resEdgeR
library(metabolomics)
fc = resEdgeR$table$logFC
pval = resEdgeR$table$PValue
names(fc) = names(pval) = rownames(resEdgeR$table)
VolcanoPlot(fc, pval, cexlab = 0.8)
resEdgeR
gene.list = resEdgeR$table[, c(1, 3)]
head(gene.list)
plot(geneList$logFC, -log10(geneList$PValue),
xlab = expression(log[2]~fold~change), ylab="-log10 p-value")
geneList = resEdgeR$table[, c(1, 3)]
head(geneList)
plot(geneList$logFC, -log10(geneList$PValue),
xlab = expression(log[2]~fold~change), ylab="-log10 p-value")
plot(geneList$logFC, -log10(geneList$PValue), pch = 16, cex = 0.5,
xlab = expression(log[2]~fold~change), ylab="-log10 p-value")
plot(geneList$logFC, -log10(geneList$PValue), pch = 16, cex = 0.8,
xlab = expression(log[2]~fold~change), ylab="-log10 p-value")
?mtext
?par
library(edgeR)
library(ggplot2)
library(reshape)
library(RColorBrewer)
library(matrixStats)
library(gplots)
source('~/Tutorial_Rnw/Fonctions/simulCountsFun.R')
source('~/Tutorial_Rnw/Fonctions/simulPoisCountsFun.R')
source("~/Tutorial_Rnw/Fonctions/plotMeanVarEdgeR.R")
source("/home/igonzalez/Projets/Formation_ARNseq/Support/Diff_Expression/estmateTagwiseDisp.R")
library(DESeq2)
## Simulated data
set.seed(1)
dds <- makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
## DESeq2 analysis
dds <- DESeq(dds)
resDESeq2 <- results(dds)
conditions = colData(dds)$condition
cds = counts(dds)
library(DESeq)
cds = newCountDataSet(cds, conditions)
cds = estimateSizeFactors(cds)
cds = estimateDispersions(cds)
resDESeq = nbinomTest(cds, "A", "B")
## Simulated data in the DESeq2 analysis example
set.seed(1)
y <- makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
group <- colData(y)$condition
y <- counts(y)
## edgeR analysis
y <- DGEList(counts = y, group = group)
y <- estimateCommonDisp(y)
y <- estimateTagwiseDisp(y)
resEdgeR <- exactTest(y)
geneList = data.frame(logFC = resEdgeR$table[, 1], negLogPval = resEdgeR$table[, 3])
head(geneList)
par(mar = c(5, 4, 4, 4))
plot(geneList, pch = 16, cex = 0.6,
xlab = expression(log[2]~fold~change), ylab = expression(-log[10]~p-value))
geneList = data.frame(logFC = resEdgeR$table[, 1], negLogPval = -log10(resEdgeR$table[, 3]))
head(geneList)
par(mar = c(5, 4, 4, 4))
plot(geneList, pch = 16, cex = 0.6,
xlab = expression(log[2]~fold~change), ylab = expression(-log[10]~p-value))
lfc = 2
pval = 0.01
## Selecting interest genes
signGenes = (abs(geneList$logFC) > lfc & geneList$PValue > -log10(pval))
points(geneList[signGenes, ], pch = 16, cex = 0.8, col = "red")
abline(h = -log10(pval), col = "green3", lty = 2)
abline(v = c(-lfc, lfc), col = "green3", lty = 2)
mtext(paste("pval =", pval), side = 4, at = -log10(pval), cex = 0.8, line = 0.5, las = 1)
mtext(c(paste("-", lfc, "fold"), paste("+", lfc, "fold")), side = 3, at = c(-lfc, lfc),
cex = 0.8, line = 0.5)
signGenes = (abs(geneList$logFC) > lfc & geneList$negLogPval > -log10(pval))
## Identifying the selected genes in the plot
points(geneList[signGenes, ], pch = 16, cex = 0.8, col = "red")
library(DESeq2)
## Simulated data
set.seed(1)
dds = makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
## DESeq2 analysis
dds = DESeq(dds)
resDESeq2 = results(dds)
counts(dds)
rawCounts = counts(dds)
rawCounts
rld = rlog(dds)
rld
assays(rld)
assays(rld)[[1]]
head(assays(rld)[[1]])
rld = rlog(rawCounts)
head(assays(rld))
?rlog
de = (resDESeq2$padj < 0.01)
de[is.na(de)] = FALSE
de
library(mixOmics)
?cim
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE,
col = colorRampPalette(brewer.pal(9, "Blues"))(255))
library(DESeq2)
## Simulated data
set.seed(1)
dds = makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
colData(dds)$condition = c(paste0("A_", 1:3), paste0("B_", 1:3))
## DESeq2 analysis
dds = DESeq(dds)
resDESeq2 = results(dds)
c(paste0("A_", 1:3), paste0("B_", 1:3))
dds = makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
colData(dds)$condition
dds
library(DESeq2)
## Simulated data
set.seed(1)
dds = makeExampleDESeqDataSet(n = 1000, m = 6, betaSD = 1)
colnames(dds) = c(paste0("A_", 1:3), paste0("B_", 1:3))
## DESeq2 analysis
dds = DESeq(dds)
resDESeq2 = results(dds)
rld = rlog(dds)
head(assays(rld)[[1]])
de = (resDESeq2$padj < 0.01)
de[is.na(de)] = FALSE
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE,
col = colorRampPalette(brewer.pal(9, "Blues"))(255))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255))
scaleyellowred <- colorRampPalette(c("lightyellow", "red"), space = "rgb")(100)
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = scaleyellowred)
#colorRampPalette(brewer.pal(9, "Blues"))(255)
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 2))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 3))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 4))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 6))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 8))
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 6), keysize = 1)
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 5), keysize = 1)
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(3, 5), keysize = 0.5)
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255))#, lhei = c(3, 5), keysize = 0.5)
cim(t(assay(rld)[de, ]), dendrogram = "column", symkey = FALSE, xlab = "Genes", ylab = "Samples",
col = colorRampPalette(brewer.pal(9, "Blues"))(255), lhei = c(1, 3))
?hclust
resDESeq2
as.data.frame(resDESeq2)
dir()
write.csv(as.data.frame(resDESeq2), file = "results_DESeq2.csv")
library("ggplot2", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
?dir
directory = "/home/igonzalez/Projets/Formation_ARNseq/RNA-seq_DE_Lab/lab_data/count_table_files"
dir(directory)
directory = "/home/igonzalez/Projets/Formation_ARNseq/RNA-seq_DE_Lab/lab_data/count_table_files"
dir(directory)
?read.table
library(edgeR)
directory = "~/Projets/Formation_ARNseq/RNA-seq_DE_Lab/lab_data/count_table_files/"
setwd(directory)
rawCountTable = read.table("count_table.tsv", header = TRUE, sep = "\t", row.names = 1)
sampleInfo = read.table("pasilla_design.txt", header = TRUE, row.names = 1)
Idx = match(rownames(sampleInfo), colnames(rawCountTable))
rawCountTable = rawCountTable[, Idx]
condition = c("treated", "treated", "treated",
"control", "control", "control", "control")
sampleInfo = data.frame(sampleInfo, condition)
sampleInfo
dgeFull = DGEList(counts = rawCountTable, group = sampleInfo$condition)
dgeFull
dgeFull$sampleInfo = sampleInfo
dgeFull
pairedSamples = (dgeFull$sampleInfo$type == "paired-end")
dge = dgeFull[, pairedSamples]
dge$sampleInfo = dgeFull$sampleInfo[pairedSamples, ]
dge = dge[rowSums(dge$counts) > 0, ]
dge = calcNormFactors(dge)
dge = estimateCommonDisp(dge)
dge = estimateTagwiseDisp(dge)
dgeTest = exactTest(dge)
dgeTest
library(HTSFilter)
dgeTestFilt = HTSFilter(dgeTest, DGEList = dge, plot = FALSE)
dgeTestFilt
hed(dgeTestFilt)
head(dgeTestFilt)
names(dgeTestFilt)
clas(dgeTestFilt)
class(dgeTestFilt)
dgeTestFilt$filteredData
resNoFilt = topTags(dgeTest, n = nrow(dgeTest))
resFilt = topTags(dgeTestFilt, n = nrow(dgeTestFilt))
library(HTSFilter)
dgeTestFilt = HTSFilter(dgeTest, DGEList = dge, plot = FALSE)$filteredData
resNoFilt = topTags(dgeTest, n = nrow(dgeTest))
resFilt = topTags(dgeTestFilt, n = nrow(dgeTestFilt))
resNoFilt
head(resNoFilt)
resNoFilt$FDR
resNoFilt
resNoFilt[, 4]
class(resNoFilt)
?topTags
resNoFilt
resNoFilt = topTags(dgeTest, n = nrow(dgeTest))$table
resFilt = topTags(dgeTestFilt, n = nrow(dgeTestFilt))$table
resNoFilt
resNoFilt$FDR
sum(resNoFilt$FDR < 0.01)
sum(resFilt$FDR < 0.01)
head(resNoFilt)
alpha = 0.05
sigDownReg = resFilt[resFilt$FDR < alpha, ]
sigDownReg
head(resNoFilt)
sigDownReg = resFilt[resFilt$FDR < alpha, ]
sigDownReg = sigDownReg[order(sigDownReg$logFC), ]
head(sigDownReg)
?plotSmear
y <- matrix(rnbinom(10000,mu=5,size=2),ncol=4)
d <- DGEList(counts=y, group=rep(1:2,each=2), lib.size=colSums(y))
rownames(d$counts) <- paste("tag",1:nrow(d$counts),sep=".")
d <- estimateCommonDisp(d)
plotSmear(d)
de <- exactTest(d)
# highlighting the top 500 most DE tags
de.tags <- rownames(topTags(de, n=500)$table)
plotSmear(d, de.tags=de.tags)
plotSmear(dgeTestFilt)
resFilt[resFilt$FDR < 0.01, ]
de.genes = rownames(topTags(resFilt[resFilt$FDR < 0.01, ]))
plotSmear(dgeTestFilt, de.tags = de.genes)
de.genes = rownames(resFilt[resFilt$FDR < 0.01, ])
plotSmear(dgeTestFilt, de.tags = de.genes)
sum(is.na(resFilt$FDR))
?tab
resFilt$logFC
resFilt$FDR
tab = data.frame(logFC = resFilt$logFC, negLogPval = -log10(resFilt$FDR))
plot(tab, pch = 16, cex = 0.6)
?cpm
cpm.mat = cpm(dgeTestFilt, prior.count = 1, log = TRUE)
dgeTestFilt
cpm.mat = cpm(dge, prior.count = 1, log = TRUE)
abs(resFilt$logFC)
deg.idx = (abs(resFilt$logFC) > 2 & resFilt$FDR < 0.01)
deg = rownames(resFilt)[deg.idx]
deg
deg.idx = (abs(resFilt$logFC) > 2 & resFilt$FDR < 0.05)
deg = rownames(resFilt)[deg.idx]
deg
deg.idx = (abs(resFilt$logFC) > 1 & resFilt$FDR < 0.01)
deg = rownames(resFilt)[deg.idx]
deg
cpm.mat
cpm.mat = cpm.mat[deg, ]
deg.idx = (abs(resFilt$logFC) > 1 & resFilt$FDR < 0.01)
deg = rownames(resFilt)[deg.idx]
cpm.mat = cpm.mat[deg, ]
## For sequential colour schemes
library(RColorBrewer)
cimColor = colorRampPalette(brewer.pal(9, "Blues"))(255)
cim(t(cpm.mat), dendrogram = "column", col = cimColor, symkey = FALSE, margins = c(7, 7))
library(mixOmics)
cim(t(cpm.mat), dendrogram = "column", col = cimColor, symkey = FALSE, margins = c(7, 7))
deg.idx = (abs(resFilt$logFC) > 1.5 & resFilt$FDR < 0.01)
deg = rownames(resFilt)[deg.idx]
cpm.mat = cpm.mat[deg, ]
## For sequential colour schemes
library(RColorBrewer)
cimColor = colorRampPalette(brewer.pal(9, "Blues"))(255)
cim(t(cpm.mat), dendrogram = "column", col = cimColor, symkey = FALSE)
dge
splitstr
?splitstr
?strsplit
unlist(strsplit("a b c", " "))
paste(unlist(strsplit("a b c", " ")), collapse = "-")
paste(unlist(strsplit("a b c", " ")), collapse = "")
?plot
?cim
