table(OzHi = Ozone > 80, Month, useNA = "ifany"))
with(airquality,
table(OzHi = Ozone > 80, Month, useNA = "always"))
with(airquality,
table(OzHi = Ozone > 80, addNA(Month)))
b <- factor(rep(c("A","B","C"), 10))
table(b)
d <- factor(rep(c("A","B","C"), 10), levels = c("A","B","C","D","E"))
table(d, exclude = "B")
print(table(b, d), zero.print = ".")
str(res)
str(tab)
dimnames(tab)
dimnames(tab)$[[1]]
dimnames(tab)[[1]]
dimnames(tab)[[2]]
padjFiltForComparison = rep(1, length(resNoFilt$padj))
padjFiltForComparison[pass] = resFilt$padj
tab = table('no filtering' = resNoFilt$padj < 0.1,
'with filtering' = padjFiltForComparison < 0.1)
dimnames(tab)[[1]] = dimnames(tab)[[2]] = c("no significant", "significant")
addmargins(tab)
?comb
tab
tab = addmargins(tab)
tab
tab[3,3]
?rowSums
??rowVars
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")
source("http://bioconductor.org/biocLite.R")
biocLite("RnaSeqTutorial")
source("http://bioconductor.org/biocLite.R")
biocLite("RnaSeqTutorial")
library("pasilla", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
head(samples)
data("pasillaGenes")
head(samples)
ls()
tab = data.frame(
file = c("treated1fb", "treated2fb", "treated3fb", "untreated1fb", "untreated2fb", "untreated3fb", "untreated4fb"),
type = c("single-read", "paired-end", "paired-end", "single-read", "single-read", "paired-end", "paired-end"),
"number of lanes" = as.integer(c(5,2,2,2,6,2,2)),
"total number of reads" = c("35158667", "12242535 (x2)", "12443664 (x2)", "17812866", "34284521", "10542625 (x2)", "12214974 (x 2)"),
"exon counts" = as.integer(c(15679615, 15620018, 12733865, 14924838, 20764558, 10283129, 11653031)),
stringsAsFactors = TRUE,
check.names = FALSE)
tab
setwd("~/Projets/Formation_ARNseq/ARNseq_TP/Data_TP")
write.table
?write.table
write.table(tab, "pasillaDesign.txt", sep = "\t")
write.table(tab, "pasillaDesign.txt", sep = "\t", row.names = FALSE)
library("mixOmics", lib.loc="/media/Stock/tools/R-latest/lib/R/library")
require(rgl)
## Not run:
## plot3d of individuals for objects of class 'rcc'
data(nutrimouse)
X <- nutrimouse$lipid
Y <- nutrimouse$gene
nutri.res <- rcc(X, Y, ncomp = 3, lambda1 = 0.064, lambda2 = 0.008)
col = nutrimouse$diet
font = c(rep(1, 20), rep(3, 20))
plot3dIndiv(nutri.res, ind.names = nutrimouse$diet,
axes.box = "box", font = font, col = col)
pch = c(rep("s", 20), rep("t", 20))
plot3dIndiv(nutri.res, ind.names = FALSE, axes.box = "both",
col = col, cex = 1.5, pch = pch)
