diff --git a/conf/modules.config b/conf/modules.config index c519fb6a..6790ff63 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -236,4 +236,12 @@ process { ] } + withName: 'VCF2MAF' { + publishDir = [ + path: { "${params.outdir}" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : "${meta.key}/vcf2maf/${filename}" }, + ] + } + } diff --git a/modules/local/vcf2maf/main.nf b/modules/local/vcf2maf/main.nf new file mode 100644 index 00000000..707f7510 --- /dev/null +++ b/modules/local/vcf2maf/main.nf @@ -0,0 +1,50 @@ +process VCF2MAF { + tag "${meta.id}" + label 'process_medium' + + container 'quay.io/biocontainers/vcf2maf:1.6.22--hdfd78af_0' + + input: + tuple val(meta), path(vcf) + path genome_fasta + + + output: + tuple val(meta), path("*.maf"), emit: maf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + gunzip -c ${vcf} > ${meta.id}-temp.vcf + + vcf2maf.pl \\ + --inhibit-vep \\ + --input-vcf ${meta.id}-temp.vcf \\ + --output-maf ${meta.id}.maf \\ + --ref-fasta ${genome_fasta} \\ + --tumor-id ${meta.tumor_id} \\ + --normal-id ${meta.normal_id} \\ + --ncbi-build "GRCh38" \\ + ${args} + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcf2maf: \$(vcf2maf.pl --help | grep -o 'vcf2maf [0-9.]*' | sed 's/vcf2maf //' || echo "1.6.22") + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.maf + + echo -e '${task.process}:\\n stub: noversions\\n' > versions.yml + END_VERSIONS + """ +} diff --git a/workflows/sash.nf b/workflows/sash.nf index 45f907ce..82944eff 100644 --- a/workflows/sash.nf +++ b/workflows/sash.nf @@ -49,6 +49,8 @@ include { BOLT_SV_SOMATIC_PRIORITISE } from '../modules/local/bolt/sv_somatic/pr include { PAVE_SOMATIC } from '../modules/local/pave/somatic/main' include { SIGRAP_HRDETECT } from '../modules/local/sigrap/hrdetect/main' include { SIGRAP_MUTPAT } from '../modules/local/sigrap/mutpat/main' +include { VCF2MAF } from '../modules/local/vcf2maf/main' + include { ESVEE_CALL } from '../modules/local/esvee/call/main' include { LINX_ANNOTATION } from '../subworkflows/local/linx_annotation' @@ -193,6 +195,34 @@ workflow SASH { + // + // Convert somatic VCF to MAF format + // + + // channel: [ meta_vcf2maf, smlv_somatic_vcf ] + ch_vcf2maf_inputs = ch_smlv_somatic_out.map { meta, vcf -> + def meta_vcf2maf = [ + key: meta.id, + id: meta.id, + tumor_id: meta.tumor_id, + normal_id: meta.normal_id, + ] + return [meta_vcf2maf, vcf] + } + + VCF2MAF( + ch_vcf2maf_inputs, + genome.fasta + ) + + ch_versions = ch_versions.mix(VCF2MAF.out.versions) + + // channel: [ meta, somatic_maf ] + ch_vcf2maf_out = VCF2MAF.out.maf + + + + // // Germline small variants //