Commit a76b20c4 authored by Celine Noirot's avatar Celine Noirot
Browse files

debug if 2 library

parent 6907d0b4
......@@ -10,7 +10,7 @@ packages <- c("optparse", # to read arguments from a command line
for(package in packages){
# if package is installed locally, load
if (!(package %in% rownames(installed.packages()))) {
install.packages(package)
install.packages(package, repos="http://cran.univ-paris1.fr")
}
do.call('library', list(package))
}
......@@ -100,14 +100,16 @@ ggsave(filename = normalizePath(file.path(opt$out, "rawcount_boxplot.svg"),
mustWork = FALSE), width = 11, height = 7)
## MDS
MDS_PC <- data.frame(plotMDS(PC_before_log)$cmdscale.out)
ggplot(MDS_PC, aes(x = X1, y = X2, label = rownames(MDS_PC))) +
geom_point(size=4) + geom_text(hjust=0.5, vjust=-0.5) + theme_bw() +
xlab(label = "Dimension 1") + ylab(label = "Dimension 2") +
ggtitle("PCA plot on raw pseudo-counts")
ggsave(filename = normalizePath(file.path(opt$out, "rawcount_MDS.svg"),
mustWork = FALSE), width = 11, height = 7)
if (ncol(PC_before) > 2){
MDS_PC <- data.frame(plotMDS(PC_before_log)$cmdscale.out)
ggplot(MDS_PC, aes(x = X1, y = X2, label = rownames(MDS_PC))) +
geom_point(size=4) + geom_text(hjust=0.5, vjust=-0.5) + theme_bw() +
xlab(label = "Dimension 1") + ylab(label = "Dimension 2") +
ggtitle("PCA plot on raw pseudo-counts")
ggsave(filename = normalizePath(file.path(opt$out, "rawcount_MDS.svg"),
mustWork = FALSE), width = 11, height = 7)
}
## density
ggplot(PC_before_log_long, aes(x=log2CPM, colour=lib)) + geom_density() +
......@@ -124,9 +126,12 @@ write.table(PC_before_log_long, file = normalizePath(file.path(opt$out,
"raw_boxplot_density.csv"),
mustWork = FALSE), sep = "\t",
row.names = TRUE, quote = FALSE)
write.table(MDS_PC, file = normalizePath(file.path(opt$out, "raw_MDS.csv"),
if (ncol(PC_before) > 2){
write.table(MDS_PC, file = normalizePath(file.path(opt$out, "raw_MDS.csv"),
mustWork = FALSE), sep = "\t",
row.names = TRUE, quote = FALSE)
}
#######################################
......@@ -209,10 +214,12 @@ normalization <- function(dge, method) {
paste0(method, "_boxplot_density.csv")),
mustWork = FALSE), sep = "\t",
row.names = TRUE, quote = FALSE)
write.table(MDS_PC, file = normalizePath(file.path(opt$out,
if (ncol(PC_before) > 2){
write.table(MDS_PC, file = normalizePath(file.path(opt$out,
paste0(method, "_MDS.csv")),
mustWork = FALSE), sep = "\t",
row.names = TRUE, quote = FALSE)
}
}
normalization(dge, "upperquartile")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment