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

Merge fast processes #259

Merged
merged 26 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 20 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
2 changes: 1 addition & 1 deletion .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ template:
skip_features:
- fastqc
- is_nfcore
version: 1.9.3
version: 1.10.0dev
65 changes: 23 additions & 42 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ process {
].join(" ")
}

withName: "^.*CRAM_PREPARE_SAMTOOLS_BEDTOOLS:FILTER_BEDS\$" {
withName: "^.*CRAM_PREPARE_SAMTOOLS_BEDTOOLS:PROCESS_BEDS\$" {
ext.prefix = { "${meta.id}.filter"}
ext.args = "-vE \"LOW_COVERAGE|NO_COVERAGE${params.keep_alt_contigs ? "" : "|alt|random|decoy|Un"}\""
ext.args2 = "-d 150"
}

withName: "^.*CRAM_PREPARE_SAMTOOLS_BEDTOOLS:BEDTOOLS_INTERSECT\$" {
ext.prefix = {"${meta.id}.intersect"}
ext.args = "-sorted"
ext.args3 = "-sorted"
}

/*
Expand Down Expand Up @@ -87,7 +83,7 @@ process {

withName: "^.*CRAM_CALL_GATK4:VCF_CONCAT_BCFTOOLS:BCFTOOLS_CONCAT\$" {
ext.prefix = { "${meta.id}.${meta.caller}.g" }
ext.args = '--allow-overlaps --output-type z'
ext.args = '--allow-overlaps --output-type z --write-index=tbi'
}

withName: "^.*CRAM_CALL_GATK4:BCFTOOLS_STATS\$" {
Expand All @@ -108,7 +104,7 @@ process {

withName: "^.*BAM_CALL_ELPREP:VCF_CONCAT_BCFTOOLS:BCFTOOLS_CONCAT\$" {
ext.prefix = { "${meta.id}.${meta.caller}.g" }
ext.args = '--allow-overlaps --output-type z'
ext.args = '--allow-overlaps --output-type z --write-index=tbi'
}

withName: "^.*BAM_CALL_ELPREP:BCFTOOLS_STATS\$" {
Expand Down Expand Up @@ -168,7 +164,7 @@ process {

withName: "^.*GVCF_JOINT_GENOTYPE_GATK4:VCF_CONCAT_BCFTOOLS:BCFTOOLS_CONCAT\$" {
ext.prefix = { "${meta.id}.concat" }
ext.args = "--allow-overlaps --output-type z"
ext.args = "--allow-overlaps --output-type z --write-index=tbi"
}

/*
Expand All @@ -194,14 +190,10 @@ process {
}

withName: "^.*BAM_CALL_VARDICTJAVA:VCF_CONCAT_BCFTOOLS:BCFTOOLS_CONCAT\$" {
ext.args = '--allow-overlaps --output-type z'
ext.args = '--allow-overlaps --output-type z --write-index=tbi'
ext.prefix = {"${meta.id}.concat"}
}

withName: "^.*BAM_CALL_VARDICTJAVA:TABIX_VCFANNO\$" {
ext.prefix = {"${meta.id}.vcfanno"}
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FILTER
Expand All @@ -210,28 +202,21 @@ process {

withName: "^.*VCF_FILTER_BCFTOOLS:FILTER_1\$" {
ext.prefix = { "${meta.id}.filtered1" }
ext.args = {
meta.caller == "vardict" ?
"-i 'QUAL >= 0${params.only_pass ? " && FILTER=\"PASS\"" : ""}' --output-type z":
meta.caller == "haplotypecaller" ?
"--output-type z --soft-filter 'GATKCutoffSNP' -e 'TYPE=\"snp\" && (MQRankSum < -12.5 || ReadPosRankSum < -8.0 || QD < 2.0 || FS > 60.0 || MQ < 30.0)' -m '+'":
meta.caller == "elprep" ?
"--output-type z --soft-filter 'GATKCutoffSNP' -e 'TYPE=\"snp\" && (MQRankSum < -12.5 || ReadPosRankSum < -8.0 || QD < 2.0 || FS > 60.0 || MQ < 30.0)' -m '+'":
""
}
ext.args = { [
meta.caller == "vardict" ? "-i 'QUAL >= 0${params.only_pass ? " && FILTER=\"PASS\"" : ""}'" : "",
meta.caller == "haplotypecaller" ? "--soft-filter 'GATKCutoffSNP' -e 'TYPE=\"snp\" && (MQRankSum < -12.5 || ReadPosRankSum < -8.0 || QD < 2.0 || FS > 60.0 || MQ < 30.0)' -m '+'" : "",
meta.caller == "elprep" ? "--output-type z --soft-filter 'GATKCutoffSNP' -e 'TYPE=\"snp\" && (MQRankSum < -12.5 || ReadPosRankSum < -8.0 || QD < 2.0 || FS > 60.0 || MQ < 30.0)' -m '+'" : "",
"--output-type z --write-index=tbi"
].findAll { arg -> arg != "" }.join(" ") }
}

withName: "^.*VCF_FILTER_BCFTOOLS:FILTER_2\$" {
ext.args = {
meta.caller == "vardict" ?
"--soft-filter 'LowFreqBias' --mode '+' -e 'FORMAT/AF[0:*] < 0.02 && FORMAT/VD[0] < 30 && INFO/SBF < 0.1 && INFO/NM >= 2.0' --output-type z" :
meta.caller == "haplotypecaller" ?
'--output-type z --soft-filter \'GATKCutoffIndel\' -e \'TYPE="indel" && (ReadPosRankSum < -20.0 || QD < 2.0 || FS > 200.0 || SOR > 10.0 )\' -m \'+\'' :
meta.caller == "elprep" ?
'--output-type z --soft-filter \'GATKCutoffIndel\' -e \'TYPE="indel" && (ReadPosRankSum < -20.0 || QD < 2.0 || FS > 200.0 || SOR > 10.0 )\' -m \'+\'' :
""

}
ext.args = { [
meta.caller == "vardict" ? "--soft-filter 'LowFreqBias' --mode '+' -e 'FORMAT/AF[0:*] < 0.02 && FORMAT/VD[0] < 30 && INFO/SBF < 0.1 && INFO/NM >= 2.0'" : "",
meta.caller == "haplotypecaller" ? '--soft-filter \'GATKCutoffIndel\' -e \'TYPE="indel" && (ReadPosRankSum < -20.0 || QD < 2.0 || FS > 200.0 || SOR > 10.0 )\' -m \'+\'' : "",
meta.caller == "elprep" ? '--soft-filter \'GATKCutoffIndel\' -e \'TYPE="indel" && (ReadPosRankSum < -20.0 || QD < 2.0 || FS > 200.0 || SOR > 10.0 )\' -m \'+\'' : "",
"--output-type z --write-index=tbi"
].findAll { arg -> arg != "" }.join(" ") }
ext.prefix = {"${meta.id}.filtered"}
}

Expand All @@ -243,7 +228,7 @@ process {

withName: "^.*GERMLINE:BCFTOOLS_NORM\$" {
ext.prefix = {"${meta.id}.normalized"}
ext.args = "-m-"
ext.args = "-m- --output-type z --write-index=tbi"
}

/*
Expand All @@ -264,7 +249,7 @@ process {

withName: "^.*VCF_PED_RTGTOOLS:BCFTOOLS_ANNOTATE\$" {
ext.prefix = { "${meta.id}.${meta.caller}.ped.annotated" }
ext.args = "--output-type z"
ext.args = "--output-type z --write-index=tbi"
}

/*
Expand Down Expand Up @@ -301,20 +286,16 @@ process {
].join(' ').trim()}
}

withName: "^.*VCF_ANNOTATION:VCF_ANNOTATE_ENSEMBLVEP:BCFTOOLS_CONCAT\$" {
withName: "^.*VCF_ANNOTATE_ENSEMBLVEP:BCFTOOLS_CONCAT\$" {
ext.prefix = {"${meta.id}_concat"}
ext.args = "--allow-overlaps --output-type z"
}

withName: "^.*VCF_ANNOTATION:VCF_ANNOTATE_ENSEMBLVEP:BCFTOOLS_SORT\$" {
withName: "^.*VCF_ANNOTATE_ENSEMBLVEP:BCFTOOLS_SORT\$" {
ext.prefix = {"${meta.id}.sorted"}
ext.args = "--write-index=tbi --output-type z"
}

withName: "^.*VCF_ANNOTATION:BGZIP_ANNOTATED_VCFS\$" {
ext.prefix = {"${meta.id}.vcfanno"}
}


/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VALIDATION
Expand Down
17 changes: 1 addition & 16 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"bedtools/intersect": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"bedtools/merge": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
Expand Down Expand Up @@ -191,16 +186,6 @@
"installed_by": ["modules"],
"patch": "modules/nf-core/somalier/relate/somalier-relate.diff"
},
"tabix/bgzip": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"tabix/bgziptabix": {
"branch": "master",
"git_sha": "f448e846bdadd80fc8be31fbbc78d9f5b5131a45",
"installed_by": ["modules"]
},
"tabix/tabix": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
Expand All @@ -225,7 +210,7 @@
},
"vcfanno": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"git_sha": "b1137e22798227331c9a9a12bd92bd6e865865c5",
"installed_by": ["modules"]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process FILTER_BEDS {
process PROCESS_BEDS {
tag "$meta.id"
label 'process_single'

Expand All @@ -8,21 +8,27 @@ process FILTER_BEDS {
'biocontainers/bedtools:2.31.0--hf5e1c6e_2' }"

input:
tuple val(meta), path(bed)
tuple val(meta), path(bed), path(roi)

output:
tuple val(meta), path('*.bed'), emit: bed
path "versions.yml" , emit: versions

script:
// Remove regions with no coverage from the callable regions BED file
// Remove regions with no coverage from the callable regions BED file and intersect with an optional ROI file
def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

def unzip = bed.extension == "gz" ? "zcat" : "cat"
def intersect = roi ? "| bedtools intersect -a ${roi} -b - ${args3}" : ""
"""
${unzip} ${bed} | grep ${args} | bedtools merge ${args2} > ${prefix}.bed
${unzip} ${bed} \\
| grep ${args} \\
| bedtools merge ${args2} \\
${intersect} \\
> ${prefix}.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
nextflow_process {

name "Test Process FILTER_BEDS"
name "Test Process PROCESS_BEDS"
script "../main.nf"
process "FILTER_BEDS"
process "PROCESS_BEDS"

tag "modules"
tag "modules_local"
tag "filter_beds"
tag "PROCESS_BEDS"

test("homo_sapiens - bed") {

Expand All @@ -17,7 +17,8 @@ nextflow_process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.bed, checkIfExists:true)
file(params.bed, checkIfExists:true),
file(params.split1, checkIfExists:true)
]
"""
}
Expand All @@ -42,7 +43,8 @@ nextflow_process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.bed, checkIfExists:true)
file(params.bed, checkIfExists:true),
file(params.split1, checkIfExists:true)
]
"""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@
"id": "test",
"single_end": false
},
"test.bed:md5,fa245abf8add7a80650566a1de67ec04"
"test.bed:md5,ffd6f70b7fa85ffb46fb66a4cf9afb70"
]
],
"1": [
"versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88"
"versions.yml:md5,c6be2bd45c01066eacc08f419bce67d6"
],
"bed": [
[
{
"id": "test",
"single_end": false
},
"test.bed:md5,fa245abf8add7a80650566a1de67ec04"
"test.bed:md5,ffd6f70b7fa85ffb46fb66a4cf9afb70"
]
],
"versions": [
"versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88"
"versions.yml:md5,c6be2bd45c01066eacc08f419bce67d6"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
"nextflow": "24.10.3"
},
"timestamp": "2024-11-13T17:12:06.470648263"
"timestamp": "2025-01-23T16:45:26.442970884"
},
"homo_sapiens - bed - stub": {
"content": [
Expand All @@ -47,7 +47,7 @@
]
],
"1": [
"versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88"
"versions.yml:md5,c6be2bd45c01066eacc08f419bce67d6"
],
"bed": [
[
Expand All @@ -59,14 +59,14 @@
]
],
"versions": [
"versions.yml:md5,38ea76fdc8d681b1e47415b195cccd88"
"versions.yml:md5,c6be2bd45c01066eacc08f419bce67d6"
]
}
],
"meta": {
"nf-test": "0.9.1",
"nextflow": "24.10.0"
"nextflow": "24.10.3"
},
"timestamp": "2024-11-13T17:09:43.531020092"
"timestamp": "2025-01-23T16:45:35.803097114"
}
}
5 changes: 0 additions & 5 deletions modules/nf-core/bedtools/intersect/environment.yml

This file was deleted.

59 changes: 0 additions & 59 deletions modules/nf-core/bedtools/intersect/main.nf

This file was deleted.

Loading
Loading