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

Cosmetic changes to satisfy lintR.

parent 79e9bae7
...@@ -73,7 +73,8 @@ preprocess_data <- function(input_data_dir, output_data_file, ...@@ -73,7 +73,8 @@ preprocess_data <- function(input_data_dir, output_data_file,
clean_samples = clean_samples, clean_samples = clean_samples,
verbose = verbose) verbose = verbose)
} else { } else {
message(paste0("[", Sys.time(), "] Platform ", platform, " not yet supported (no preprocessing done).")) message(paste0("[", Sys.time(), "] Platform ", platform,
" not yet supported (no preprocessing done)."))
} }
# We return the created ESET. # We return the created ESET.
......
...@@ -41,7 +41,8 @@ preprocess_data_affymetrix_rma <- function(input_data_dir, output_data_file, ...@@ -41,7 +41,8 @@ preprocess_data_affymetrix_rma <- function(input_data_dir, output_data_file,
# If necessary, we remove the samples that do not have clinical data. # If necessary, we remove the samples that do not have clinical data.
if (clean_samples) { if (clean_samples) {
# We load the clinical data as to get the samples to keep. # We load the clinical data as to get the samples to keep.
samples <- rownames(pData(ArrayUtils::load_clinical_data(input_data_dir, verbose = FALSE))) samples <- rownames(Biobase::pData(ArrayUtils::load_clinical_data(input_data_dir,
verbose = FALSE)))
# We only keep the samples with clinical data. # We only keep the samples with clinical data.
eset <- eset[, samples] eset <- eset[, samples]
} }
......
...@@ -39,7 +39,7 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_file, ...@@ -39,7 +39,7 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_file,
path = raw_data_input_dir, path = raw_data_input_dir,
green.only = TRUE, green.only = TRUE,
verbose = TRUE) verbose = TRUE)
batch_data = log2(batch$E) batch_data <- log2(batch$E)
remove(raw_data_input_dir, batch) remove(raw_data_input_dir, batch)
# We run the LIMMA pre-processing method on the data. # We run the LIMMA pre-processing method on the data.
...@@ -55,7 +55,8 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_file, ...@@ -55,7 +55,8 @@ preprocess_data_agilent_limma <- function(input_data_dir, output_data_file,
# If necessary, we remove the samples that do not have clinical data. # If necessary, we remove the samples that do not have clinical data.
if (clean_samples) { if (clean_samples) {
# We load the clinical data as to get the samples to keep. # We load the clinical data as to get the samples to keep.
samples <- rownames(pData(ArrayUtils::load_clinical_data(input_data_dir, verbose = FALSE))) samples <- rownames(Biobase::pData(ArrayUtils::load_clinical_data(input_data_dir,
verbose = FALSE)))
# We only keep the samples with clinical data. # We only keep the samples with clinical data.
batch_data_norm <- batch_data_norm[, samples] batch_data_norm <- batch_data_norm[, samples]
} }
......
...@@ -68,17 +68,17 @@ preprocess_data_illumina_beadarray <- function(input_data_dir, output_data_file, ...@@ -68,17 +68,17 @@ preprocess_data_illumina_beadarray <- function(input_data_dir, output_data_file,
# Additional cleaning (after normalization - also Illumina specific). # Additional cleaning (after normalization - also Illumina specific).
ids <- as.character(Biobase::featureNames(gse_data_norm)) ids <- as.character(Biobase::featureNames(gse_data_norm))
#qual <- unlist(mget(ids, illuminaHumanv3.db::illuminaHumanv3PROBEQUALITY, ifnotfound = NA))
qual <- unlist(mget(ids, get("illuminaHumanv3PROBEQUALITY"), ifnotfound = NA)) qual <- unlist(mget(ids, get("illuminaHumanv3PROBEQUALITY"), ifnotfound = NA))
rem <- qual == "No match" | qual == "Bad" | is.na(qual) rem <- qual == "No match" | qual == "Bad" | is.na(qual)
gse_data_filt <- Biobase::exprs(gse_data_norm[!rem,]) gse_data_filt <- Biobase::exprs(gse_data_norm[!rem, ])
rm(gse_data, gse_data_norm) rm(gse_data, gse_data_norm)
} }
# If necessary, we remove the samples that do not have clinical data. # If necessary, we remove the samples that do not have clinical data.
if (clean_samples) { if (clean_samples) {
# We load the clinical data as to get the samples to keep. # We load the clinical data as to get the samples to keep.
samples <- rownames(pData(ArrayUtils::load_clinical_data(input_data_dir, verbose = FALSE))) samples <- rownames(Biobase::pData(ArrayUtils::load_clinical_data(input_data_dir,
verbose = FALSE)))
# We only keep the samples with clinical data. # We only keep the samples with clinical data.
gse_data_filt <- gse_data_filt[, samples] gse_data_filt <- gse_data_filt[, samples]
} }
......
...@@ -36,8 +36,8 @@ run_quality_control_on_raw_agilent <- function(input_data_dir, ...@@ -36,8 +36,8 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
path = raw_data_input_dir, path = raw_data_input_dir,
green.only = TRUE, green.only = TRUE,
verbose = TRUE) verbose = TRUE)
batch$targets <- pheno_data batch$targets <- pheno_data
batch_log_data = log2(batch$E) batch_log_data <- log2(batch$E)
# We clean up and log information. # We clean up and log information.
rm(raw_file_list, raw_data_input_dir, pheno_data_raw) rm(raw_file_list, raw_data_input_dir, pheno_data_raw)
...@@ -47,7 +47,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir, ...@@ -47,7 +47,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
# We do some kind of quality control (ourselves - no external packages). # We do some kind of quality control (ourselves - no external packages).
dir.create(output_data_dir) dir.create(output_data_dir)
# A- heatmap. # A- sample heatmap with dendograms.
# Compute correlations. # Compute correlations.
cor_mat <- round(cor(batch_log_data, method = "pearson"), 2) cor_mat <- round(cor(batch_log_data, method = "pearson"), 2)
# Create the heatmap. # Create the heatmap.
...@@ -76,7 +76,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir, ...@@ -76,7 +76,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
dev.off() dev.off()
pca_gd_filename <- paste0(output_data_dir, "pca_gender.png") pca_gd_filename <- paste0(output_data_dir, "pca_gender.png")
png(pca_gd_filename) png(pca_gd_filename)
pca_plot_gd <- ggplot2::autoplot(pca, colour = gd_colors, size=5) pca_plot_gd <- ggplot2::autoplot(pca, colour = gd_colors, size = 5)
print(pca_plot_gd) print(pca_plot_gd)
dev.off() dev.off()
# We clean up. # We clean up.
...@@ -113,7 +113,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir, ...@@ -113,7 +113,7 @@ run_quality_control_on_raw_agilent <- function(input_data_dir,
i <- (rows - 1) * ncols + cols i <- (rows - 1) * ncols + cols
# We now plot the arrays one by one. # We now plot the arrays one by one.
for (j in seq_len(dim(batch_log_data)[2])) { for (j in seq_len(dim(batch_log_data)[2])) {
array_data[i] <- batch_log_data[ ,j] array_data[i] <- batch_log_data[, j]
array_filename <- paste0(output_data_dir, "array_", j, ".png") array_filename <- paste0(output_data_dir, "array_", j, ".png")
png(array_filename) png(array_filename)
limma::imageplot(array_data, limma::imageplot(array_data,
......
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