diff --git a/config/F16.config b/config/F16.config index 5d5b91d..87c78d7 100644 --- a/config/F16.config +++ b/config/F16.config @@ -37,6 +37,17 @@ process { } } + withName: filter_sSV_GRIDSS { + cpus = 1 + memory = 3.GB + retry_strategy { + memory { + strategy = 'exponential' + operand = 2 + } + } + } + withName: call_sSV_Delly { cpus = 1 memory = 16.GB diff --git a/config/F32.config b/config/F32.config index e44941d..7192170 100644 --- a/config/F32.config +++ b/config/F32.config @@ -37,6 +37,17 @@ process { } } + withName: filter_sSV_GRIDSS { + cpus = 1 + memory = 6.GB + retry_strategy { + memory { + strategy = 'exponential' + operand = 2 + } + } + } + withName: call_sSV_Delly { cpus = 1 memory = 30.GB diff --git a/config/F72.config b/config/F72.config index 0c01903..52613a0 100644 --- a/config/F72.config +++ b/config/F72.config @@ -37,6 +37,17 @@ process { } } + withName: filter_sSV_GRIDSS { + cpus = 1 + memory = 12.GB + retry_strategy { + memory { + strategy = 'exponential' + operand = 2 + } + } + } + withName: call_sSV_Delly { cpus = 1 memory = 30.GB diff --git a/config/M64.config b/config/M64.config index 01c71d6..6dee9a9 100644 --- a/config/M64.config +++ b/config/M64.config @@ -37,6 +37,17 @@ process { } } + withName: filter_sSV_GRIDSS { + cpus = 1 + memory = 20.GB + retry_strategy { + memory { + strategy = 'exponential' + operand = 2 + } + } + } + withName: call_sSV_Delly { cpus = 1 memory = 120.GB diff --git a/config/schema.yaml b/config/schema.yaml index e84434e..997d2c4 100644 --- a/config/schema.yaml +++ b/config/schema.yaml @@ -18,6 +18,11 @@ gridss_blacklist: mode: 'r' required: true help: 'Absolute path to GRIDSS2 blacklist BED file' +gridss_pon_dir: + type: 'Path' + mode: 'r' + required: true + help: 'Absolute path to directory containing Panel Of Normals BED and BEDPE files' exclusion_file: type: 'Path' mode: 'r' diff --git a/config/template.config b/config/template.config index 9bf6224..8a8bdfc 100755 --- a/config/template.config +++ b/config/template.config @@ -16,6 +16,7 @@ params { // GRCh38 blacklist - /hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/ENCFF356LFX.bed gridss_blacklist = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/ENCFF356LFX.bed" gridss_reference_fasta = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" + gridss_pon_dir = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/" // When GRIDSS errors OutOfMemory, update `other_jvm_heap`. Default is `4.GB` //other_jvm_heap = 4.GB diff --git a/main.nf b/main.nf index a47f59e..e7e3bf5 100644 --- a/main.nf +++ b/main.nf @@ -55,7 +55,7 @@ include { call_sSV_Delly; filter_sSV_Delly } from './module/delly' addParams( include { call_sSV_Manta } from './module/manta' addParams( workflow_output_dir: "${params.output_dir_base}/Manta-${params.manta_version}" ) -include { preprocess_BAM_GRIDSS; run_assembly_GRIDSS; call_sSV_GRIDSS } from './module/gridss' addParams( +include { preprocess_BAM_GRIDSS; run_assembly_GRIDSS; call_sSV_GRIDSS; filter_sSV_GRIDSS } from './module/gridss' addParams( workflow_output_dir: "${params.output_dir_base}/GRIDSS-${params.gridss_version}" ) include { generate_sha512 as generate_sha512_BCFtools } from './module/sha512' addParams( @@ -233,5 +233,11 @@ workflow { gridss_reference_files, params.gridss_blacklist ) + + filter_sSV_GRIDSS( + params.sample, + call_sSV_GRIDSS.out.gridss_vcf, + params.gridss_pon_dir + ) } } diff --git a/module/gridss.nf b/module/gridss.nf index ea6a5d6..631c5a1 100644 --- a/module/gridss.nf +++ b/module/gridss.nf @@ -188,3 +188,45 @@ process call_sSV_GRIDSS { ${tumor_bam} """ } + +process filter_sSV_GRIDSS { + container params.docker_image_gridss + + publishDir "${params.workflow_output_dir}/output/", + pattern: "*.vcf.bgz*", + mode: "copy" + + publishDir "${params.log_output_dir}/process-log", + pattern: ".command.*", + mode: "copy", + saveAs: { "${task.process.replace(':', '/')}/log${file(it).getName()}" } + + input: + val(tumor_id) + path(gridss_vcf) + path(gridss_pon_dir) + + output: + path "*vcf.bgz*", emit: gridss_filter_vcf_files + path ".command.*" + + script: + output_filename = generate_standard_filename( + "GRIDSS2-${params.gridss_version}", + params.dataset_id, + tumor_id, + [:] + ) + + """ + set -euo pipefail + /usr/local/share/gridss-2.13.2-1/gridss_somatic_filter \ + --pondir ${gridss_pon_dir} \ + --scriptdir /usr/local/share/gridss-2.13.2-1/ \ + --input ${gridss_vcf} \ + --output ${output_filename}_high-confidence-somatic.vcf \ + --fulloutput ${output_filename}_high-low-confidence-somatic.vcf \ + --normalordinal 1 \ + --tumourordinal 2 + """ + } diff --git a/test/config/ssv-all-tools.config b/test/config/ssv-all-tools.config index 38f49df..8591a2d 100644 --- a/test/config/ssv-all-tools.config +++ b/test/config/ssv-all-tools.config @@ -14,6 +14,7 @@ params { reference_fasta = "/hot/resource/reference-genome/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" gridss_reference_fasta = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" gridss_blacklist = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/ENCFF356LFX.bed" + gridss_pon_dir = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/" exclusion_file = "/hot/resource/tool-specific-input/Delly/hg38/human.hg38.excl.tsv" diff --git a/test/config/ssv-delly.config b/test/config/ssv-delly.config index ce3d297..9188f64 100644 --- a/test/config/ssv-delly.config +++ b/test/config/ssv-delly.config @@ -14,6 +14,7 @@ params { reference_fasta = "/hot/resource/reference-genome/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" gridss_reference_fasta = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" gridss_blacklist = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/ENCFF356LFX.bed" + gridss_pon_dir = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/" exclusion_file = "/hot/resource/tool-specific-input/Delly/hg38/human.hg38.excl.tsv" diff --git a/test/config/ssv-manta.config b/test/config/ssv-manta.config index dacabcc..5046d4d 100644 --- a/test/config/ssv-manta.config +++ b/test/config/ssv-manta.config @@ -14,6 +14,7 @@ params { reference_fasta = "/hot/resource/reference-genome/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" gridss_reference_fasta = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta" gridss_blacklist = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/ENCFF356LFX.bed" + gridss_pon_dir = "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/" exclusion_file = "/hot/resource/tool-specific-input/Delly/hg38/human.hg38.excl.tsv" diff --git a/test/configtest-F16.json b/test/configtest-F16.json index bb7012d..7eeb2c0 100644 --- a/test/configtest-F16.json +++ b/test/configtest-F16.json @@ -72,6 +72,7 @@ "exclusion_file": "/hot/resource/tool-specific-input/Delly/hg38/human.hg38.excl.tsv", "filter_condition": "FILTER=\\='PASS'", "gridss_blacklist": "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/ENCFF356LFX.bed", + "gridss_pon_dir": "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/", "gridss_reference_fasta": "/hot/resource/tool-specific-input/GRIDSS-2.13.2/GRCh38-BI-20160721/Homo_sapiens_assembly38.fasta", "gridss_version": "2.13.2", "input": { @@ -138,6 +139,16 @@ } } }, + "filter_sSV_GRIDSS": { + "cpus": "1", + "memory": "3 GB", + "retry_strategy": { + "memory": { + "operand": "2", + "strategy": "exponential" + } + } + }, "preprocess_BAM_GRIDSS": { "cpus": "4", "memory": "10 GB", @@ -304,6 +315,15 @@ "closure": "retry_updater(3 GB, exponential, 2, $task.attempt, memory)" } }, + "withName:filter_sSV_GRIDSS": { + "cpus": "1", + "memory": { + "1": "3 GB", + "2": "6 GB", + "3": "12 GB", + "closure": "retry_updater(3 GB, exponential, 2, $task.attempt, memory)" + } + }, "withName:preprocess_BAM_GRIDSS": { "cpus": "4", "memory": {