I've normal-tumor human FASTQ file(s). Currently, I work with only one sample (both normal and tumor fastq R1 and R2), only.
I have alignment gatk mark duplicates, setupnmdtags, applybqsr, recalibrate steps before calling mutect2.
My input files are:
tiny_tumor_R1.fastq.gz
tiny_tumor_R2.fastq.gz
tiny_normal_R1.fastq.gz
tiny_normal_R2.fastq.gz
The expected output from the mutect2 is tiny.mutect2out.vcf that is ${sample_name}".mutect2out.vcf"
I split tiny_normal
using nextflow split and take first element of the split array, that is tiny.
However, I get error as:
Caused by: Missing value declared as output parameter: sample_name
I understand that the variable was defined in the script step. How do I retrieve at the output level?
Below is code of the mutect2_process.nf
process mutect2 {
maxForks 3
debug true
memory '15 GB'
input:
tuple val(sample_id_tumor),path(bqsrbam_tumor)
tuple val(sample_id_normal),path(bqsrbam_normal)
output:
tuple val(sample_name),path(${sample_name}".mutect2out.vcf")
script:
def avail_mem = task.memory ? task.memory.toGiga() : 0
def java_options = [
avail_mem ? "-Xmx${avail_mem}G" : "",
"-XX:+UseSerialGC",
]
def sample_name=sample_id_normal.split('_normal')[0]
"""
ml gatk/4.1.3.0
gatk --java-options "${java_options.join(' ')}" Mutect2 -L $params.target -I ${bqsrbam_tumor} -I ${bqsrbam_normal} -normal ${sample_name} -tumor ${sample_name} --output ${sample_name}".mutect2out.vcf" -R $params.hg38genome
"""
}