Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GRIDSS somatic filter #187

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
11 changes: 11 additions & 0 deletions config/F16.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions config/F32.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions config/F72.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions config/M64.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ process {
}
}

withName: filter_sSV_GRIDSS {
cpus = 1
memory = 20.GB

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested to see how much memory this step uses with a variety of samples. Could there be an upper bound?
Also, did you consider this:
The Hartwig Medical Foundation has reimplemented gridss_somatic_filter in Java as [GRIPSS](https://github.com/hartwigmedical/hmftools/tree/master/gripss). GRIPSS is much faster, has additional features, and is the recommended tool for somatic filtering of GRIDSS output.

retry_strategy {
memory {
strategy = 'exponential'
operand = 2
}
}
}

withName: call_sSV_Delly {
cpus = 1
memory = 120.GB
Expand Down
5 changes: 5 additions & 0 deletions config/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions config/template.config
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
}
}
42 changes: 42 additions & 0 deletions module/gridss.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
}
1 change: 1 addition & 0 deletions test/config/ssv-all-tools.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions test/config/ssv-delly.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions test/config/ssv-manta.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
20 changes: 20 additions & 0 deletions test/configtest-F16.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
Loading