From 8eb8466cc9d50ced555d95228988e1d3502cbcea Mon Sep 17 00:00:00 2001 From: Shixiang Wang Date: Tue, 9 Jun 2020 22:37:00 +0800 Subject: [PATCH] :bookmark: v2.0.0 --- DESCRIPTION | 2 +- NEWS.md | 5 + R/DoAbsolute.R | 305 ++++++++++++++++++++++++++----------------------- 3 files changed, 170 insertions(+), 142 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e2061d8..4bb1668 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: DoAbsolute Title: Automate Absolute Copy Number Calling -Version: 1.1.0 +Version: 2.0.0 Authors@R: person("Shixiang", "Wang", email = "w_shixiang@163.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-9855-7357")) diff --git a/NEWS.md b/NEWS.md index 9eb5ecc..696c106 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# DoAbsolute 2.0.0 + +* Formated code. +* Fixed potential bugs when processing multiple projects in a same temp directory. + # DoAbsolute 1.0.1 * Kept chromosome X diff --git a/R/DoAbsolute.R b/R/DoAbsolute.R index 89f0cde..d3ec8e2 100644 --- a/R/DoAbsolute.R +++ b/R/DoAbsolute.R @@ -43,33 +43,33 @@ #' @export #' @references Carter, Scott L., et al. "Absolute quantification of somatic DNA alterations in human cancer." Nature biotechnology 30.5 (2012): 413. #' -DoAbsolute = function(Seg, Maf = NULL, - sigma.p = 0, max.sigma.h = 0.2, min.ploidy = 0.5, max.ploidy = 10, - primary.disease = NA, platform = c("SNP_6.0", "Illumina_WES", "SNP_250K_STY"), - temp.dir = file.path(tempdir(), "Absolute"), clean.temp = FALSE, - results.dir = getwd(), max.as.seg.count = 1500, - max.non.clonal = 0.05, max.neg.genome = 0.005, copy.num.type = c("total", "allelic"), - min.mut.af = 0.1, min.no.mut = 5, verbose = FALSE, nThread = 1L, keepAllResult=TRUE, - recover=FALSE){ +DoAbsolute <- function(Seg, Maf = NULL, + sigma.p = 0, max.sigma.h = 0.2, min.ploidy = 0.5, max.ploidy = 10, + primary.disease = NA, platform = c("SNP_6.0", "Illumina_WES", "SNP_250K_STY"), + temp.dir = file.path(tempdir(), "Absolute"), clean.temp = FALSE, + results.dir = getwd(), max.as.seg.count = 1500, + max.non.clonal = 0.05, max.neg.genome = 0.005, copy.num.type = c("total", "allelic"), + min.mut.af = 0.1, min.no.mut = 5, verbose = FALSE, nThread = 1L, keepAllResult = TRUE, + recover = FALSE) { # if (dir.exists(temp.dir) & length(dir(path = temp.dir)) != 0) { # stop("Your 'temp.dir' is not empty, please reset it.") # } - if (!suppressMessages(requireNamespace("ABSOLUTE"))){ + if (!suppressMessages(requireNamespace("ABSOLUTE"))) { stop("Find no package called 'ABSOLUTE', please install it...") } - if (!suppressMessages(requireNamespace("foreach"))){ + if (!suppressMessages(requireNamespace("foreach"))) { warning("Find no package called 'foreach', try to install it...") install.packages("foreach", dependencies = TRUE) } - if (!suppressMessages(requireNamespace("doParallel"))){ + if (!suppressMessages(requireNamespace("doParallel"))) { warning("Find no package called 'doParallel', try to install it...") install.packages("doParallel", dependencies = TRUE) } - if (!suppressMessages(requireNamespace("data.table"))){ + if (!suppressMessages(requireNamespace("data.table"))) { warning("Find no package called 'data.table', try to install it...") install.packages("data.table", dependencies = TRUE) } @@ -77,116 +77,123 @@ DoAbsolute = function(Seg, Maf = NULL, if (verbose) cat("-> Loading segmentation data...\n") if (is.character(Seg)) { if (file.exists(Seg)) { - Seg = data.table::fread(input = Seg) + Seg <- data.table::fread(input = Seg) } else { stop("file ", Seg, " does not exist") } - - }else { + } else { if (inherits(Seg, "data.frame")) { data.table::setDT(Seg) - }else{ + } else { Stop("Unsupport Segmentation Format!") } - } - if (!is.null(Maf)){ + if (!is.null(Maf)) { if (verbose) cat("-> Loading Maf data...\n") if (is.character(Maf)) { if (file.exists(Maf)) { - Maf = data.table::fread(input = Maf) + Maf <- data.table::fread(input = Maf) } else { stop("file ", Maf, " does not exist") } - } else { if (inherits(Maf, "data.frame")) { data.table::setDT(Maf) - }else{ + } else { Stop("Unsupport Maf Format!") - }}} + } + } + } if (verbose) cat("-> Checking data format of segmentation file...\n") #-- check Seg data - seg_cols = c("Sample", "Chromosome", "Start", "End", "Num_Probes", "Segment_Mean") - if (!all(seg_cols %in% colnames(Seg))){ - stop("Columns ",paste(seg_cols, collapse = " "), " are should in file.") - }else{ - Seg = Seg[, c("Sample", "Chromosome", "Start", "End", "Num_Probes", "Segment_Mean")] + seg_cols <- c("Sample", "Chromosome", "Start", "End", "Num_Probes", "Segment_Mean") + if (!all(seg_cols %in% colnames(Seg))) { + stop("Columns ", paste(seg_cols, collapse = " "), " are should in file.") + } else { + Seg <- Seg[, c("Sample", "Chromosome", "Start", "End", "Num_Probes", "Segment_Mean")] } - Seg$Chromosome = as.character(Seg$Chromosome) - Seg$Chromosome = gsub(pattern = "chr", replacement = "", Seg$Chromosome, ignore.case = TRUE) - Seg$Chromosome = gsub(pattern = "X", replacement = "23", Seg$Chromosome, ignore.case = TRUE) + Seg$Chromosome <- as.character(Seg$Chromosome) + Seg$Chromosome <- gsub(pattern = "chr", replacement = "", Seg$Chromosome, ignore.case = TRUE) + Seg$Chromosome <- gsub(pattern = "X", replacement = "23", Seg$Chromosome, ignore.case = TRUE) if (verbose) cat("-> Keeping only chr 1-23 for CNV data...\n") - autosome = as.character(seq(1,23)) - Seg = Seg[Chromosome %in% autosome, ] + autosome <- as.character(seq(1, 23)) + Seg <- Seg[Chromosome %in% autosome, ] #-- check Maf data - if(!is.null(Maf)) { - maf_cols = c("Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_position", "dbSNP_Val_Status", - "t_ref_count", "t_alt_count") - maf_cols2 = c("Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_Position", "dbSNP_Val_Status", - "t_ref_count", "t_alt_count") + if (!is.null(Maf)) { + maf_cols <- c( + "Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_position", "dbSNP_Val_Status", + "t_ref_count", "t_alt_count" + ) + maf_cols2 <- c( + "Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_Position", "dbSNP_Val_Status", + "t_ref_count", "t_alt_count" + ) if (all(maf_cols %in% colnames(Maf))) { - Maf = Maf[, c("Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_position", "dbSNP_Val_Status", - "t_ref_count", "t_alt_count")] + Maf <- Maf[, c( + "Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_position", "dbSNP_Val_Status", + "t_ref_count", "t_alt_count" + )] } else if (all(maf_cols2 %in% colnames(Maf))) { - Maf = Maf[, c("Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_Position", "dbSNP_Val_Status", - "t_ref_count", "t_alt_count")] - colnames(Maf) = maf_cols + Maf <- Maf[, c( + "Tumor_Sample_Barcode", "Hugo_Symbol", "Chromosome", "Start_Position", "dbSNP_Val_Status", + "t_ref_count", "t_alt_count" + )] + colnames(Maf) <- maf_cols } else { stop("Necessary columns for Maf file: \n ", paste(maf_cols, collapse = " "), "\n") } - Maf$Chromosome = as.character(Maf$Chromosome) - Maf$Chromosome = gsub(pattern = "chr", replacement = "", Maf$Chromosome, ignore.case = TRUE) - Maf$Chromosome = gsub(pattern = "X", replacement = "23", Maf$Chromosome, ignore.case = TRUE) + Maf$Chromosome <- as.character(Maf$Chromosome) + Maf$Chromosome <- gsub(pattern = "chr", replacement = "", Maf$Chromosome, ignore.case = TRUE) + Maf$Chromosome <- gsub(pattern = "X", replacement = "23", Maf$Chromosome, ignore.case = TRUE) if (verbose) cat("-> Keeping only chr 1-23 for Maf data...\n") - Maf = Maf[Chromosome %in% autosome, ] + Maf <- Maf[Chromosome %in% autosome, ] } #-- create temp files to generate input for RunAbsolute - samples = unique(Seg$Sample) - SAMPLES = samples - seg_filepath = vector(mode = "character", length = length(samples)) - maf_filepath = vector(mode = "character", length = length(samples)) + samples <- unique(Seg$Sample) + SAMPLES <- samples + seg_filepath <- vector(mode = "character", length = length(samples)) + maf_filepath <- vector(mode = "character", length = length(samples)) if (verbose) cat("-> Creating temp directory ...\n") - if(!dir.exists(temp.dir)) { + if (!dir.exists(temp.dir)) { dir.create(temp.dir, recursive = TRUE, showWarnings = FALSE) } if (verbose) cat("-> Spliting seg data of samples to different files...\n") for (i in seq_along(samples)) { if (verbose) cat("--> Processing sample ", samples[i], "...\n") - seg = Seg[Sample == samples[i], ] - seg_filepath[i] = file.path(temp.dir, paste0(samples[i], ".seg")) + seg <- Seg[Sample == samples[i], ] + seg_filepath[i] <- file.path(temp.dir, paste0(samples[i], ".seg")) data.table::fwrite(x = seg, file = seg_filepath[i], sep = "\t") - if (is.null(Maf)){ - maf_filepath[i] = NA_character_ + if (is.null(Maf)) { + maf_filepath[i] <- NA_character_ } else { - maf = Maf[Tumor_Sample_Barcode == samples[i], ] + maf <- Maf[Tumor_Sample_Barcode == samples[i], ] if (nrow(maf) == 0) { if (verbose) cat("---> This sample has not Maf data, skipping...\n") - maf_filepath[i] = NA_character_ + maf_filepath[i] <- NA_character_ } else { if (verbose) cat("---> Filtering mutations which vaf<", min.mut.af, "...\n") - maf = maf[(t_alt_count / (t_ref_count + t_alt_count)) >= min.mut.af,] + maf <- maf[(t_alt_count / (t_ref_count + t_alt_count)) >= min.mut.af, ] if (verbose) cat("---> Filtering Maf which count<", min.no.mut, "...\n") if (nrow(maf) < min.no.mut) { if (verbose) cat("---> This sample has not Maf data (after filtering), skipping...\n") - maf_filepath[i] = NA_character_ + maf_filepath[i] <- NA_character_ } else { if (verbose) cat("---> Outputing corresponding Maf file...\n") - maf_filepath[i] = file.path(temp.dir, paste0(samples[i], ".maf")) + maf_filepath[i] <- file.path(temp.dir, paste0(samples[i], ".maf")) data.table::fwrite(x = maf, file = maf_filepath[i], sep = "\t") - #write.csv(x = maf, file = maf_filepath[i], sep = "\t", quote = FALSE, row.names = FALSE) + # write.csv(x = maf, file = maf_filepath[i], sep = "\t", quote = FALSE, row.names = FALSE) } } } @@ -194,23 +201,23 @@ DoAbsolute = function(Seg, Maf = NULL, if (verbose) cat("-> Spliting seg data of samples done.\n") #-- match options - platform = match.arg(platform) - copy_num_type = match.arg(copy.num.type) + platform <- match.arg(platform) + copy_num_type <- match.arg(copy.num.type) - cache.dir = file.path(temp.dir, "cache") - if (!dir.exists(cache.dir)){ + cache.dir <- file.path(temp.dir, "cache") + if (!dir.exists(cache.dir)) { dir.create(cache.dir, recursive = TRUE, showWarnings = FALSE) } # foreach loop - nCores = detectCores(logical = FALSE) + nCores <- detectCores(logical = FALSE) if (nThread > nCores) { warning("Number of real physical core is ", nCores, " while user set ", nThread, "\nUse ", nCores, " Cores.") - nThread = nCores + nThread <- nCores } - if(Sys.info()[['sysname']] == 'Windows') { - cl = makeCluster(nThread) + if (Sys.info()[["sysname"]] == "Windows") { + cl <- makeCluster(nThread) registerDoParallel(cl) } else { registerDoParallel(cores = nThread) @@ -219,25 +226,25 @@ DoAbsolute = function(Seg, Maf = NULL, if (recover) { cat("-> recover mode is TRUE, checking samples have been called...\n") - not_called = c() - maf_filepath = c() - seg_filepath = c() + not_called <- c() + maf_filepath <- c() + seg_filepath <- c() for (i in seq_along(samples)) { - if(!file.exists(file.path(cache.dir,paste0(samples[i], ".ABSOLUTE.RData")))) { + if (!file.exists(file.path(cache.dir, paste0(samples[i], ".ABSOLUTE.RData")))) { cat("--> ", samples[i], "is not called.\n") - not_called = c(not_called, samples[i]) + not_called <- c(not_called, samples[i]) if (!file.exists(file.path(temp.dir, paste0(samples[i], ".seg")))) { stop("Something wrong with splitted files.") } - seg_filepath = c(seg_filepath, file.path(temp.dir, paste0(samples[i], ".seg"))) + seg_filepath <- c(seg_filepath, file.path(temp.dir, paste0(samples[i], ".seg"))) if (!file.exists(file.path(temp.dir, paste0(samples[i], ".maf")))) { - maf_filepath = c(maf_filepath, NA_character_) + maf_filepath <- c(maf_filepath, NA_character_) } else { - maf_filepath = c(maf_filepath, file.path(temp.dir, paste0(samples[i], ".maf"))) + maf_filepath <- c(maf_filepath, file.path(temp.dir, paste0(samples[i], ".maf"))) } } } - samples = not_called + samples <- not_called if (length(not_called) != 0) { cat("-> ABSOLUTE calling for above samples will be recovered.\n") @@ -250,40 +257,46 @@ DoAbsolute = function(Seg, Maf = NULL, if (verbose) cat("-> Running RunAbsolute...\n") if (nThread == 1) { - for(i in seq_along(samples)){ + for (i in seq_along(samples)) { if (is.na(maf_filepath[i])) { - maf_fn = NULL } else { - maf_fn = maf_filepath[i] - } - seg_fn = seg_filepath[i] + maf_fn <- NULL + } else { + maf_fn <- maf_filepath[i] + } + seg_fn <- seg_filepath[i] if (verbose) cat("--> Processing sample ", samples[i], "...\n") - suppressWarnings(ABSOLUTE::RunAbsolute(seg.dat.fn = seg_fn, maf.fn = maf_fn, # output.fn.base = output.fn.base, - sample.name = samples[i], - sigma.p = sigma.p, max.sigma.h = max.sigma.h, - min.ploidy = min.ploidy, max.ploidy = max.ploidy, - primary.disease = primary.disease, platform = platform, - results.dir = cache.dir, max.as.seg.count = max.as.seg.count, - max.non.clonal = max.non.clonal, max.neg.genome = max.neg.genome, - copy_num_type = copy_num_type, - min.mut.af = min.mut.af, verbose = verbose)) + suppressWarnings(ABSOLUTE::RunAbsolute( + seg.dat.fn = seg_fn, maf.fn = maf_fn, # output.fn.base = output.fn.base, + sample.name = samples[i], + sigma.p = sigma.p, max.sigma.h = max.sigma.h, + min.ploidy = min.ploidy, max.ploidy = max.ploidy, + primary.disease = primary.disease, platform = platform, + results.dir = cache.dir, max.as.seg.count = max.as.seg.count, + max.non.clonal = max.non.clonal, max.neg.genome = max.neg.genome, + copy_num_type = copy_num_type, + min.mut.af = min.mut.af, verbose = verbose + )) } } else { foreach(i = seq_along(samples)) %dopar% { if (is.na(maf_filepath[i])) { - maf_fn = NULL } else { - maf_fn = maf_filepath[i] - } - seg_fn = seg_filepath[i] + maf_fn <- NULL + } else { + maf_fn <- maf_filepath[i] + } + seg_fn <- seg_filepath[i] if (verbose) cat("--> Processing sample ", samples[i], "...\n") - suppressWarnings(ABSOLUTE::RunAbsolute(seg.dat.fn = seg_fn, maf.fn = maf_fn, # output.fn.base = output.fn.base, - sample.name = samples[i], - sigma.p = sigma.p, max.sigma.h = max.sigma.h, - min.ploidy = min.ploidy, max.ploidy = max.ploidy, - primary.disease = primary.disease, platform = platform, - results.dir = cache.dir, max.as.seg.count = max.as.seg.count, - max.non.clonal = max.non.clonal, max.neg.genome = max.neg.genome, - copy_num_type = copy_num_type, - min.mut.af = min.mut.af, verbose = verbose)) + suppressWarnings(ABSOLUTE::RunAbsolute( + seg.dat.fn = seg_fn, maf.fn = maf_fn, # output.fn.base = output.fn.base, + sample.name = samples[i], + sigma.p = sigma.p, max.sigma.h = max.sigma.h, + min.ploidy = min.ploidy, max.ploidy = max.ploidy, + primary.disease = primary.disease, platform = platform, + results.dir = cache.dir, max.as.seg.count = max.as.seg.count, + max.non.clonal = max.non.clonal, max.neg.genome = max.neg.genome, + copy_num_type = copy_num_type, + min.mut.af = min.mut.af, verbose = verbose + )) } } if (verbose) cat("-> RunAbsolute done. Retrieving results...\n") @@ -291,12 +304,12 @@ DoAbsolute = function(Seg, Maf = NULL, ## This will make problem when iteration computation with same temp dir # absolute_files = file.path(cache.dir, grep("RData", dir(cache.dir), value = TRUE)) - absolute_files = file.path(cache.dir, paste0(SAMPLES, ".ABSOLUTE.RData")) + absolute_files <- file.path(cache.dir, paste0(SAMPLES, ".ABSOLUTE.RData")) if (verbose) cat("-> Checking result files...\n") for (f in absolute_files) { if (!file.exists(f)) { warning("--> Result file ", f, " does not exist, drop it.", immediate. = TRUE) - absolute_files = setdiff(absolute_files, f) + absolute_files <- setdiff(absolute_files, f) } } if (length(absolute_files) < 1) { @@ -305,34 +318,38 @@ DoAbsolute = function(Seg, Maf = NULL, if (verbose) cat("-> Checked.\n") - review.dir = file.path(cache.dir, "review") + review.dir <- file.path(cache.dir, "review") if (dir.exists(review.dir)) { if (verbose) cat("-> Removed previous temp review result directory.\n") unlink(review.dir, recursive = TRUE) } if (verbose) cat("-> Running Absolute summarize...\n") - suppressWarnings(ABSOLUTE::CreateReviewObject(obj.name = "DoAbsolute", - absolute.files = absolute_files, - indv.results.dir = review.dir, - copy_num_type = copy_num_type, - plot.modes = TRUE, verbose = verbose)) + suppressWarnings(ABSOLUTE::CreateReviewObject( + obj.name = "DoAbsolute", + absolute.files = absolute_files, + indv.results.dir = review.dir, + copy_num_type = copy_num_type, + plot.modes = TRUE, verbose = verbose + )) if (verbose) cat("\n-> Absolute summarize done. Prepare auto-reviewing...\n") # pp_call_fn = file.path(review.dir, grep("PP-calls_tab.txt", dir(review.dir), value = TRUE)) # modes_fn = file.path(review.dir, grep("PP-modes.data.RData", dir(review.dir), value = TRUE)) - pp_call_fn = file.path(review.dir, "DoAbsolute.PP-calls_tab.txt") - modes_fn = file.path(review.dir, "DoAbsolute.PP-modes.data.RData") - suppressWarnings(ABSOLUTE::ExtractReviewedResults(reviewed.pp.calls.fn = pp_call_fn, - analyst.id = "wsx", - modes.fn = modes_fn, - out.dir.base = review.dir, - obj.name = "DoAbsolute", - copy_num_type = copy_num_type, - verbose = verbose)) + pp_call_fn <- file.path(review.dir, "DoAbsolute.PP-calls_tab.txt") + modes_fn <- file.path(review.dir, "DoAbsolute.PP-modes.data.RData") + suppressWarnings(ABSOLUTE::ExtractReviewedResults( + reviewed.pp.calls.fn = pp_call_fn, + analyst.id = "wsx", + modes.fn = modes_fn, + out.dir.base = review.dir, + obj.name = "DoAbsolute", + copy_num_type = copy_num_type, + verbose = verbose + )) if (verbose) cat("-> Absolute Auto-reviewing done.\n") - reviewed.dir = file.path(review.dir, "reviewed") + reviewed.dir <- file.path(review.dir, "reviewed") if (verbose) cat("-> Outputing final results...\n") if (keepAllResult) { @@ -342,33 +359,39 @@ DoAbsolute = function(Seg, Maf = NULL, } - seg.dir = file.path(results.dir, "seg") - maf.dir = file.path(results.dir, "maf") + seg.dir <- file.path(results.dir, "seg") + maf.dir <- file.path(results.dir, "maf") dir.create(seg.dir, showWarnings = FALSE, recursive = TRUE) dir.create(maf.dir, showWarnings = FALSE, recursive = TRUE) - t = file.copy(file.path(reviewed.dir, grep("DoAbsolute", dir(reviewed.dir), value = TRUE)), results.dir) - files_seg = file.path(file.path(reviewed.dir, "SEG_MAF"), - grep("segtab.txt", dir(file.path(reviewed.dir, "SEG_MAF")), value = TRUE)) - t = file.copy(from = files_seg, to = seg.dir) - files_maf = file.path(file.path(reviewed.dir, "SEG_MAF"), - grep("ABS_MAF.txt", dir(file.path(reviewed.dir, "SEG_MAF")), value = TRUE)) - t = file.copy(from = files_maf, to = maf.dir) + t <- file.copy(file.path(reviewed.dir, grep("DoAbsolute", dir(reviewed.dir), value = TRUE)), results.dir) + files_seg <- file.path( + file.path(reviewed.dir, "SEG_MAF"), + grep("segtab.txt", dir(file.path(reviewed.dir, "SEG_MAF")), value = TRUE) + ) + t <- file.copy(from = files_seg, to = seg.dir) + files_maf <- file.path( + file.path(reviewed.dir, "SEG_MAF"), + grep("ABS_MAF.txt", dir(file.path(reviewed.dir, "SEG_MAF")), value = TRUE) + ) + t <- file.copy(from = files_maf, to = maf.dir) if (keepAllResult) { - call.dir = file.path(results.dir, "summary") - samples_before_call.dir = file.path(results.dir, "sample_before_summary") - samples_called.dir = file.path(results.dir, "sample_final_called") + call.dir <- file.path(results.dir, "summary") + samples_before_call.dir <- file.path(results.dir, "sample_before_summary") + samples_called.dir <- file.path(results.dir, "sample_final_called") dir.create(call.dir, showWarnings = FALSE, recursive = TRUE) dir.create(samples_before_call.dir, showWarnings = FALSE, recursive = TRUE) dir.create(samples_called.dir, showWarnings = FALSE, recursive = TRUE) - files_call = file.path(review.dir, grep("DoAbsolute", dir(review.dir), value = TRUE)) - t = file.copy(from = files_call, to = call.dir) - t = file.copy(from = absolute_files, to = samples_before_call.dir) - files_samplesCalled = file.path(file.path(reviewed.dir, "samples"), - dir(file.path(reviewed.dir, "samples"))) - t = file.copy(from = files_samplesCalled, samples_called.dir) + files_call <- file.path(review.dir, grep("DoAbsolute", dir(review.dir), value = TRUE)) + t <- file.copy(from = files_call, to = call.dir) + t <- file.copy(from = absolute_files, to = samples_before_call.dir) + files_samplesCalled <- file.path( + file.path(reviewed.dir, "samples"), + dir(file.path(reviewed.dir, "samples")) + ) + t <- file.copy(from = files_samplesCalled, samples_called.dir) } if (clean.temp) {