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

Adapted Affymetric QC.

parent 056b87fa
......@@ -21,6 +21,8 @@
#' @param output_data_dir A string representing the folder that contains the output data.
#' @param platform A string representing the array platform among Affymetrix and Agilent.
#' Default to Affymetrix.
#' @param use_oligo A Boolean indicating whether the oligo package must be used to read the
#' Affymetrix raw data. Alternatively, the affy package is used. Default to FALSE.
#' @param compressed A boolean representing whether the raw data are compressed or not. This is
#' FALSE by default.
#' @param phenotype_groups A list of phenotype factor names that can be used to highlight the
......@@ -31,6 +33,7 @@
run_quality_control_on_raw <- function(input_data_dir,
output_data_dir,
platform = "Affymetrix",
use_oligo = FALSE,
compressed = FALSE,
phenotype_groups = vector(),
verbose = FALSE) {
......@@ -40,6 +43,7 @@ run_quality_control_on_raw <- function(input_data_dir,
run_quality_control_on_raw_affymetrix(input_data_dir,
output_data_dir,
compressed = compressed,
use_oligo = use_oligo,
phenotype_groups = phenotype_groups,
verbose = verbose)
} else if (platform == "Agilent") {
......
......@@ -11,6 +11,8 @@
#'
#' @param input_data_dir A string representing the folder that contains the input data.
#' @param output_data_dir A string representing the folder that contains the output data.
#' @param use_oligo A Boolean indicating whether the oligo package must be used to read the
#' raw data. Alternatively, the affy package is used. Default to FALSE.
#' @param compressed A boolean representing whether the raw data are compressed or not. This is
#' FALSE by default.
#' @param phenotype_groups A list of phenotype factor names that can be used to highlight the
......@@ -20,6 +22,7 @@
#' @return NULL
run_quality_control_on_raw_affymetrix <- function(input_data_dir,
output_data_dir,
use_oligo = FALSE,
compressed = FALSE,
phenotype_groups = vector(),
verbose = FALSE) {
......@@ -32,8 +35,14 @@ run_quality_control_on_raw_affymetrix <- function(input_data_dir,
# We load the CEL files to create the affyBatch object and then attach the clinical data.
raw_file_list <- affy::list.celfiles(raw_data_input_dir, full.names = TRUE)
batch <- affy::ReadAffy(filenames = raw_file_list, compress = compressed, verbose = verbose)
Biobase::phenoData(batch) <- pheno_data
batch <- NULL
if (use_oligo) {
batch <- oligo::read.celfiles(filenames = raw_file_list, phenoData = pheno_data,
verbose = verbose)
} else {
batch <- affy::ReadAffy(filenames = raw_file_list, compress = compressed, verbose = verbose)
Biobase::phenoData(batch) <- pheno_data
}
# We clean up and log information.
rm(raw_file_list, pheno_data, raw_data_input_dir)
......
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