Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion containers/metadataparser/create-aggregate-qc-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)]
##
Expand Down
5 changes: 3 additions & 2 deletions modules/process/Aggregate/QcBamAggregate.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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}
"""
}
2 changes: 1 addition & 1 deletion modules/subworkflow/AggregateFromProcess.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion modules/subworkflow/AggregateFromResult.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down