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

Minor modifications (based on coding style).

parent cd16e491
...@@ -218,7 +218,8 @@ create_design <- function(pheno_data, limma_parameters, ...@@ -218,7 +218,8 @@ create_design <- function(pheno_data, limma_parameters,
clinical_cofactor <- factor(pheno_data[[cofactor_name]]) # nolint clinical_cofactor <- factor(pheno_data[[cofactor_name]]) # nolint
batches <- factor(pheno_data[["Batch"]]) batches <- factor(pheno_data[["Batch"]])
genders <- factor(pheno_data[["Gender"]]) genders <- factor(pheno_data[["Gender"]])
design <- stats::model.matrix(~ 0 + clinical + batches + genders + clinical_cofactor) design <- stats::model.matrix(~ 0 + clinical + batches + genders +
clinical_cofactor)
colnames(design) <- c(levels(clinical), colnames(design) <- c(levels(clinical),
levels(batches)[2:length(levels(batches))], levels(batches)[2:length(levels(batches))],
levels(genders)[2:length(levels(genders))], levels(genders)[2:length(levels(genders))],
...@@ -254,7 +255,8 @@ create_design <- function(pheno_data, limma_parameters, ...@@ -254,7 +255,8 @@ create_design <- function(pheno_data, limma_parameters,
clinical_cofactor <- factor(pheno_data[[cofactor_name]]) # nolint clinical_cofactor <- factor(pheno_data[[cofactor_name]]) # nolint
ages <- as.numeric(pheno_data[["Age"]]) ages <- as.numeric(pheno_data[["Age"]])
genders <- factor(pheno_data[["Gender"]]) genders <- factor(pheno_data[["Gender"]])
design <- stats::model.matrix(~ 0 + clinical + ages + genders + clinical_cofactor) design <- stats::model.matrix(~ 0 + clinical + ages + genders +
clinical_cofactor)
colnames(design) <- c(levels(clinical), "Age", colnames(design) <- c(levels(clinical), "Age",
levels(genders)[2:length(levels(genders))], cofactor_name) levels(genders)[2:length(levels(genders))], cofactor_name)
...@@ -303,7 +305,8 @@ create_design <- function(pheno_data, limma_parameters, ...@@ -303,7 +305,8 @@ create_design <- function(pheno_data, limma_parameters,
# We log information. # We log information.
rm(clinical_cofactor, ages, batches, genders) rm(clinical_cofactor, ages, batches, genders)
if (verbose == TRUE) { if (verbose == TRUE) {
message(paste0("[", Sys.time(), "] Design matrix created (pairs, ages, batches, genders).")) message(paste0("[", Sys.time(),
"] Design matrix created (pairs, ages, batches, genders)."))
} }
} }
} }
......
...@@ -51,11 +51,8 @@ run_limma <- function(pheno_data, eset, limma_parameters, ...@@ -51,11 +51,8 @@ run_limma <- function(pheno_data, eset, limma_parameters,
verbose = FALSE) { verbose = FALSE) {
# We extract the limma analysis parameters # We extract the limma analysis parameters
clinical_factor <- limma_parameters[[1]]
coefficients <- limma_parameters[[2]] coefficients <- limma_parameters[[2]]
has_block <- !is.null(cofactor_name) has_block <- !is.null(cofactor_name)
clinical <- factor(pheno_data[[clinical_factor]])
rm(clinical_factor)
# We refine the prefix / suffic for the file names. # We refine the prefix / suffic for the file names.
if (file_prefix != "") { if (file_prefix != "") {
......
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