R/qc_unzip.R

Defines functions qc_unzip

Documented in qc_unzip

#' @include utilities.R
NULL
#' Unzip Files in the FastQC Result Directory
#' @description Unzip all files in the FastQC result directory. Default is the
#'   current working directory.
#' @param qc.dir Path to the FastQC result directory.
#' @param rm.zip logical. If TRUE, remove zipped files after extraction. Default
#'   is TRUE.
#' @examples
#' \dontrun{
#' qc_unzip("FASTQC")
#' }
#' @export
qc_unzip <- function(qc.dir = ".", rm.zip = TRUE){
  zipped.files <- list.files(qc.dir, pattern = ".zip",
                             full.names = TRUE)
  for(zipped.file in zipped.files){
    utils::unzip(zipped.file, exdir = qc.dir)
    if(rm.zip) .remove(zipped.file)
  }
}

Try the fastqcr package in your browser

Any scripts or data that you put into this service are public.

fastqcr documentation built on March 7, 2023, 8:16 p.m.