cds
counts(cds)
badfilter = rowSums(counts(cds))
#plot(rank(badfilter)/length(badfilter), -log10(res$pvalue), pch=16, cex=0.45)
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
?rowDiffs
library(matrixStats)
?rowDiffs
?rowMads
badfilter = rowMads(counts(cds))
#plot(rank(badfilter)/length(badfilter), -log10(res$pvalue), pch=16, cex=0.45)
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
?rowRanges
badfilter = rowMins(counts(cds))
#plot(rank(badfilter)/length(badfilter), -log10(res$pvalue), pch=16, cex=0.45)
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
badfilter = rowMaxs(counts(cds))
#plot(rank(badfilter)/length(badfilter), -log10(res$pvalue), pch=16, cex=0.45)
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
?rowMins
?min
library("HTSFilter", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
badfilter = rowMeans(counts(cds)[, 1:3])
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
badfilter = rowMeans(counts(cds)[, 1:6])
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
condition
conditions
badfilter = rowMeans(counts(cds)[, conditions == "A")
badfilter = rowMeans(counts(cds)[, conditions == "A"])
rank.scaled = rank(badfilter)/length(badfilter)
plot(rank.scaled, -log10(resNoFilt$pval), pch = 16, cex = 0.45, ylim = c(0, 30),
xlab = "rank scaled to [0, 1]", ylab = expression(-log[10](p-value)))
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean > 0], 0:7/7))
qs
bins = cut(resNoFilt$baseMean, qs)
bins
levels(bins) = paste0("~", round(0.5 * qs[-1] + 0.5 * qs[-length(qs)]))
bins
resNoFilt$baseMean
resNoFilt$baseMean[resNoFilt$baseMean > 0]
resNoFilt$baseMean[resNoFilt$baseMean != 0]
qs = c(0, quantile(resNoFilt$baseMean[resNoFilt$baseMean != 0], 0:7/7))
## "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")
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", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
?DGEList
directory = "~/Projets/Formation_ARNseq/RNA-seq_DE_Lab/lab_data/count_table_files/"
setwd(directory)
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
?readDGE
readDGE
?readTargets
readTargets
setwd(directory)
sampleInfo = read.table("pasilla_design.txt", header = TRUE)
sampleInfo
sampleInfo
setwd(directory)
sampleInfo = read.table("pasilla_design.txt", header = TRUE)
sampleInfo
directory = "~/Projets/Formation_ARNseq/RNA-seq_DE_Lab/lab_data/separate_files/"
setwd(directory)
sampleInfo = read.table("pasilla_design.txt", header = TRUE)
sampleInfo
?list
?$
?data.frame
dgeFull$samples
dge
pairedSamples = (dgeFull$sampleInfo$type == "paired-end")
dge = dgeFull[, pairedSamples]
dge$sampleInfo = dgeFull$sampleInfo[pairedSamples, ]
dge
dgeFull$sampleInfo = sampleInfo
dgeFull
pairedSamples = (dgeFull$sampleInfo$type == "paired-end")
dge = dgeFull[, pairedSamples]
dge$sampleInfo = dgeFull$sampleInfo[pairedSamples, ]
dge
counts(dge)
pseudoCount = log2(dge$counts + 1)
?cpm
?plotMDS
pseudoCount = cpm(dge, log = TRUE)
dge$sampleInfo$group
dge$samplesInfo$group
dge
dge$samples$group
plotMDS(pseudoCount, intgroup = dge$samples$group)
plotMDS(pseudoCount)
warnings()
rowSums(dge$counts)
dge =  dge[rowSums(dge$counts) > 0, ]
dge
?exactTest
