Commit be579cbe authored by Leon-Charles Tranchevent's avatar Leon-Charles Tranchevent
Browse files

Bug correction in preprocessing (inversion correction / no correction)

parent 30af472b
......@@ -97,7 +97,10 @@ preprocess_data_affymetrix_gcrma <- function(input_data_dir, output_data_files,
}
# We save the eset data as TSV file.
utils::write.table(Biobase::exprs(eset), file = output_data_files[1], sep = "\t", quote = FALSE)
utils::write.table(Biobase::exprs(eset),
file = output_data_files[1],
sep = "\t",
quote = FALSE)
if (batch_correction == "BOTH") {
utils::write.table(Biobase::exprs(eset_bc),
file = output_data_files[2],
......@@ -112,7 +115,7 @@ preprocess_data_affymetrix_gcrma <- function(input_data_dir, output_data_files,
# We return the created ESET(s).
if (batch_correction == "BOTH") {
return(list(eset_bc, eset))
return(list(eset, eset_bc))
} else {
return(eset)
}
......
......@@ -34,7 +34,7 @@ preprocess_data_affymetrix_scan <- function(input_data_dir, output_data_files,
# We run the SCAN pre-processing method on the data.
# We do not run the fast analysis (by default).
input_data_regexp <- paste0(raw_data_input_dir, "*")
eset <- SCAN.UPC::SCAN(input_data_regexp, outFilePath = output_data_files[1])
eset <- SCAN.UPC::SCAN(input_data_regexp)
# We clean up and log information.
rm(raw_data_input_dir, input_data_regexp)
......@@ -96,7 +96,11 @@ preprocess_data_affymetrix_scan <- function(input_data_dir, output_data_files,
}
}
# We save the eset_bc data as TSV file. ESET was already done as part of SCAN.
# We save the eset data as TSV file.
utils::write.table(Biobase::exprs(eset),
file = output_data_files[1],
sep = "\t",
quote = FALSE)
if (batch_correction == "BOTH") {
utils::write.table(Biobase::exprs(eset_bc),
file = output_data_files[2],
......@@ -111,7 +115,7 @@ preprocess_data_affymetrix_scan <- function(input_data_dir, output_data_files,
# We return the created ESET(s).
if (batch_correction == "BOTH") {
return(list(eset_bc, eset))
return(list(eset, eset_bc))
} else {
return(eset)
}
......
......@@ -145,7 +145,7 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_files,
# We return the created ESET(s).
if (batch_correction == "BOTH") {
return(list(eset_bc, eset))
return(list(eset, eset_bc))
} else {
return(eset)
}
......
......@@ -166,7 +166,7 @@ preprocess_data_illumina_beadarray <- function(input_data_dir, output_data_files
# We return the created ESET(s).
if (batch_correction == "BOTH") {
return(list(eset_bc, eset))
return(list(eset, eset_bc))
} else {
return(eset)
}
......
......@@ -255,7 +255,8 @@ run_limma <- function(pheno_data, eset, limma_parameters,
tcplot_fn <- paste0(output_data_dir, file_prefix, "topconfects_",
limma_parameters$name, file_suffix, ".png")
grDevices::png(tcplot_fn)
p <- topconfects::confects_plot(confects, n = 50)
local_n <- min(50, nrow(confects_genes))
p <- topconfects::confects_plot(confects, n = local_n)
print(p)
grDevices::dev.off()
rm(p, tcplot_fn)
......@@ -282,7 +283,11 @@ run_limma <- function(pheno_data, eset, limma_parameters,
rrplot_fn <- paste0(output_data_dir, file_prefix, "topconfects_rrplot_limma_",
limma_parameters$name, file_suffix, ".png")
grDevices::png(rrplot_fn)
p <- topconfects::rank_rank_plot(confects_genes$name, rownames(limma_top), "TopConfects", "Limma", n = 50)
p <- topconfects::rank_rank_plot(confects_genes$name,
rownames(limma_top),
"TopConfects",
"Limma",
n = local_n)
print(p)
grDevices::dev.off()
rm(p, rrplot_fn)
......@@ -292,8 +297,8 @@ run_limma <- function(pheno_data, eset, limma_parameters,
limma_parameters$name, file_suffix, ".png")
grDevices::png(mdplot_fn)
p <- limma::plotMD(fit, legend = "bottomleft", status = paste0(
ifelse(rownames(fit) %in% rownames(limma_top)[1:50], "Limma ", ""),
ifelse(rownames(fit) %in% confects_genes$name[1:50], "TopConfects ", "")))
ifelse(rownames(fit) %in% rownames(limma_top), "Limma ", ""),
ifelse(rownames(fit) %in% confects_genes$name, "TopConfects ", "")))
print(p)
grDevices::dev.off()
rm(p, mdplot_fn)
......
Markdown is supported
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