From 00f215b16b1c03d9a79108493293935796b3d606 Mon Sep 17 00:00:00 2001 From: borauyar Date: Wed, 6 Sep 2017 10:26:08 +0200 Subject: [PATCH] changed quiet argument to debug in importBed function and updated relevant documentation, examples, and functions --- R/meta_analysis_functions.R | 6 +++--- R/report_functions.R | 10 +++++----- man/importBed.Rd | 4 ++-- man/importBedFiles.Rd | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/R/meta_analysis_functions.R b/R/meta_analysis_functions.R index 1d4798d..771f7f7 100644 --- a/R/meta_analysis_functions.R +++ b/R/meta_analysis_functions.R @@ -17,15 +17,15 @@ #' # when importing multiple bed files with different column names, it #' # is required to pass the common column names to be parsed from the #' # bed files -#' bedData <- importBedFiles(filePaths = c(input1, input2), quiet = TRUE, -#' colnames = c('chrom', 'start', 'end', 'strand')) +#' bedData <- importBedFiles(filePaths = c(input1, input2), +#' colnames = c('chrom', 'start', 'end', 'strand')) #' #' @importFrom GenomicRanges GRangesList #' @importFrom pbapply pbsapply #' @export importBedFiles <- function(filePaths, ...) { bedData <- GenomicRanges::GRangesList(pbapply::pbsapply(filePaths, function(f) { - RCAS::importBed(filePath = f, quiet = TRUE, ...) + RCAS::importBed(filePath = f, debug = FALSE, ...) }, USE.NAMES = TRUE)) names(bedData) <- gsub(pattern = '.bed$', replacement = '', diff --git a/R/report_functions.R b/R/report_functions.R index e863288..57e3fd9 100644 --- a/R/report_functions.R +++ b/R/report_functions.R @@ -96,7 +96,7 @@ importGtf <- function (filePath, saveObjectAsRds = TRUE, readFromRds = TRUE, #' convert the \code{seqlevelsStyle} to 'UCSC' and apply #' \code{keepStandardChromosomes} function to only keep data from the standard #' chromosomes -#' @param quiet TRUE/FALSE (default:FALSE). Set to TRUE to turn off messages +#' @param debug TRUE/FALSE (default:TRUE). Set to FALSE to turn off messages #' @param ... Other arguments passed to rtracklayer::import.bed function #' @return A \code{GRanges} object containing the coordinates of the intervals #' from an input BED file @@ -109,23 +109,23 @@ importGtf <- function (filePath, saveObjectAsRds = TRUE, readFromRds = TRUE, #' @importFrom GenomeInfoDb seqlevelsStyle #' @importFrom GenomeInfoDb keepStandardChromosomes #' @export -importBed <- function (filePath, sampleN = 0, keepStandardChr = TRUE, quiet = FALSE, ...) { +importBed <- function (filePath, sampleN = 0, keepStandardChr = TRUE, debug = TRUE, ...) { if (file.exists(filePath)) { data = rtracklayer::import.bed(filePath, ...) - if(quiet == FALSE) { + if(debug == TRUE) { cat('Processing',filePath,'\n') } if (keepStandardChr == TRUE) { GenomeInfoDb::seqlevelsStyle(data) <- 'UCSC' - if(quiet == FALSE) { + if(debug == TRUE) { cat('Keeping standard chromosomes only\n') } data <- GenomeInfoDb::keepStandardChromosomes(data, pruning.mode = 'coarse') } if (sampleN > 0 && sampleN < length(data)) { - if(quiet == FALSE) { + if(debug == TRUE) { cat ('Downsampling intervals to size:',sampleN,'\n') } data <- data[sample(x = 1:length(data), size = sampleN)] diff --git a/man/importBed.Rd b/man/importBed.Rd index 50af924..2c555e6 100644 --- a/man/importBed.Rd +++ b/man/importBed.Rd @@ -4,7 +4,7 @@ \alias{importBed} \title{importBed} \usage{ -importBed(filePath, sampleN = 0, keepStandardChr = TRUE, quiet = FALSE, +importBed(filePath, sampleN = 0, keepStandardChr = TRUE, debug = TRUE, ...) } \arguments{ @@ -20,7 +20,7 @@ convert the \code{seqlevelsStyle} to 'UCSC' and apply \code{keepStandardChromosomes} function to only keep data from the standard chromosomes} -\item{quiet}{TRUE/FALSE (default:FALSE). Set to TRUE to turn off messages} +\item{debug}{TRUE/FALSE (default:TRUE). Set to FALSE to turn off messages} \item{...}{Other arguments passed to rtracklayer::import.bed function} } diff --git a/man/importBedFiles.Rd b/man/importBedFiles.Rd index a56e512..78979f0 100644 --- a/man/importBedFiles.Rd +++ b/man/importBedFiles.Rd @@ -28,7 +28,7 @@ keepStandardChr = TRUE) # when importing multiple bed files with different column names, it # is required to pass the common column names to be parsed from the # bed files -bedData <- importBedFiles(filePaths = c(input1, input2), quiet = TRUE, - colnames = c('chrom', 'start', 'end', 'strand')) +bedData <- importBedFiles(filePaths = c(input1, input2), + colnames = c('chrom', 'start', 'end', 'strand')) }