diff --git a/containers/metadataparser/create-aggregate-qc-file.R b/containers/metadataparser/create-aggregate-qc-file.R index 8a32d738..37c685a3 100755 --- a/containers/metadataparser/create-aggregate-qc-file.R +++ b/containers/metadataparser/create-aggregate-qc-file.R @@ -8,6 +8,13 @@ ## version = 0.2.1 ## status = Dev +install.packages("remotes", repos = "https://cloud.r-project.org", lib = "./") +library(remotes, lib = "./") +remotes::install_version("bit", version = "1.1-12", repos = "https://cloud.r-project.org", lib = "./") +remotes::install_version("bit64", version = "0.9-7", repos = "https://cloud.r-project.org", lib = "./") +library(bit, lib = "./") +library(bit64, lib = "./") + suppressPackageStartupMessages({ library(data.table) library(parallel) @@ -30,7 +37,7 @@ args = parser$parse_args() ## Parse Alfred output ---------------------------------------------------------------------------------------------- read_alfred_qc = function(file) { - input_file = fread(cmd = paste('zgrep ^ME', file, '| cut -f 2-')) + input_file = fread(cmd = paste('zgrep ^ME', file, '| cut -f 2-'), integer64 = "numeric") ## define column TotalReads input_file[, TotalReads := round(`#Mapped`/MappedFraction)] ## diff --git a/modules/process/Aggregate/QcBamAggregate.nf b/modules/process/Aggregate/QcBamAggregate.nf index e8aa6c4c..04bd3a34 100644 --- a/modules/process/Aggregate/QcBamAggregate.nf +++ b/modules/process/Aggregate/QcBamAggregate.nf @@ -5,7 +5,8 @@ process QcBamAggregate { input: tuple val(cohort), path(alfredIgnoreYTumor), path(alfredIgnoreYNormal), path(alfredIgnoreNTumor), path(alfredIgnoreNNormal), file(hsMetricsTumor), file(hsMetricsNormal) - + path(aggregate_qc_Rscript) + output: path('alignment_qc.txt'), emit: alignmentQcAggregatedOutput @@ -17,6 +18,6 @@ process QcBamAggregate { assayType = 'wgs' } """ - Rscript --no-init-file /usr/bin/create-aggregate-qc-file.R -n ${task.cpus} -a ${assayType} + Rscript --no-init-file ${aggregate_qc_Rscript} -n ${task.cpus} -a ${assayType} """ } diff --git a/modules/subworkflow/AggregateFromProcess.nf b/modules/subworkflow/AggregateFromProcess.nf index d4d9326a..d5abb0cc 100644 --- a/modules/subworkflow/AggregateFromProcess.nf +++ b/modules/subworkflow/AggregateFromProcess.nf @@ -279,7 +279,7 @@ workflow aggregateFromProcess .join(inputHsMetrics) .set{ inputQcBamAggregate } - QcBamAggregate(inputQcBamAggregate) + QcBamAggregate(inputQcBamAggregate, workflow.projectDir + "/containers/metadataparser/create-aggregate-qc-file.R") } if (conpair4Aggregate) { diff --git a/modules/subworkflow/AggregateFromResult.nf b/modules/subworkflow/AggregateFromResult.nf index 8a5a679b..cfdd205f 100644 --- a/modules/subworkflow/AggregateFromResult.nf +++ b/modules/subworkflow/AggregateFromResult.nf @@ -136,7 +136,7 @@ workflow aggregateFromResult inputAlfredIgnoreY.join(inputAlfredIgnoreN) .join(inputHsMetrics) .set{ inputQcBamAggregate } - QcBamAggregate(inputQcBamAggregate) + QcBamAggregate(inputQcBamAggregate, workflow.projectDir + "/containers/metadataparser/create-aggregate-qc-file.R") inputConpairConcord4Aggregate.join(inputConpairContami4Aggregate) .set{ inputQcConpairAggregate }