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

Fix intervals with dot #1403

Merged
merged 7 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1381](https://github.com/nf-core/sarek/pull/1381) - Swap NGSCheckMate bed file for GATK.GRCh37 to one without the `chr` prefix
- [#1383](https://github.com/nf-core/sarek/pull/1383) - Fix `--three_prime_clip_r{1,2}` parameter documentation
- [#1390](https://github.com/nf-core/sarek/pull/1390) - Fix badges in README
- [#1403](https://github.com/nf-core/sarek/pull/1403) - Fix intervals usage with dot in chromosome names

### Removed

Expand Down
2 changes: 1 addition & 1 deletion conf/modules/deepvariant.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ process {

withName: 'DEEPVARIANT' {
ext.args = { params.wes ? "--model_type WES" : "--model_type WGS" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.deepvariant" : "${meta.id}.deepvariant.${intervals.baseName}" }
ext.when = { params.tools && params.tools.split(',').contains('deepvariant') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/freebayes.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ process {
withName: 'FREEBAYES' {
ext.args = { '--min-alternate-fraction 0.1 --min-mapping-quality 1' }
//To make sure no naming conflicts ensure with module BCFTOOLS_SORT & the naming being correct in the output folder
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}.${target_bed.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}.${target_bed.baseName}" }
ext.when = { params.tools && params.tools.split(',').contains('freebayes') }
publishDir = [
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/haplotypecaller.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ process {

withName: 'GATK4_HAPLOTYPECALLER' {
ext.args = { params.joint_germline ? "-ERC GVCF" : "" }
ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" ) : ( params.joint_germline ? "${meta.id}.haplotypecaller.${intervals.simpleName}.g" :"${meta.id}.haplotypecaller.${intervals.simpleName}" ) }
ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.haplotypecaller.g" : "${meta.id}.haplotypecaller" ) : ( params.joint_germline ? "${meta.id}.haplotypecaller.${intervals.baseName}.g" :"${meta.id}.haplotypecaller.${intervals.baseName}" ) }
ext.when = { params.tools && params.tools.split(',').contains('haplotypecaller') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/mpileup.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process {
withName: 'BCFTOOLS_MPILEUP' {
ext.args2 = { '--multiallelic-caller' }
ext.args3 = { "-i 'count(GT==\"RR\")==0'" } // only report non homozygous reference variants
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.bcftools" : "${meta.id}_${intervals.simpleName}.bcftools" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.bcftools" : "${meta.id}_${intervals.baseName}.bcftools" }
ext.when = { params.tools && params.tools.split(',').contains('mpileup') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
4 changes: 2 additions & 2 deletions conf/modules/mutect2.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ process {

withName: 'GATK4_MUTECT2' {
ext.args = { params.ignore_soft_clipped_bases ? "--dont-use-soft-clipped-bases true --f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" : "--f1r2-tar-gz ${task.ext.prefix}.f1r2.tar.gz" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.baseName}" }
ext.when = { params.tools && params.tools.split(',').contains('mutect2') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -91,7 +91,7 @@ process {
}

withName: 'GETPILEUPSUMMARIES.*' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.mutect2" : "${meta.id}.mutect2.${intervals.baseName}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/" },
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/recalibrate.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
process {

withName: 'GATK4_APPLYBQSR|GATK4SPARK_APPLYBQSR' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.recal" : "${meta.id}_${intervals.simpleName}.recal" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.recal" : "${meta.id}_${intervals.baseName}.recal" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/preprocessing/" },
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/sentieon_dnascope.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
process {

withName: 'SENTIEON_DNASCOPE' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.dnascope" : "${meta.id}.dnascope.${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.dnascope" : "${meta.id}.dnascope.${intervals.baseName}" }
ext.when = { params.tools && params.tools.split(',').contains('sentieon_dnascope') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/sentieon_haplotyper.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
process {

withName: 'SENTIEON_HAPLOTYPER' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.haplotyper" : "${meta.id}.haplotyper.${intervals.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.haplotyper" : "${meta.id}.haplotyper.${intervals.baseName}" }
ext.when = { params.tools && params.tools.split(',').contains('sentieon_haplotyper') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/strelka.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ process {

withName: 'STRELKA_.*' {
ext.args = { params.wes ? '--exome' : '' }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.strelka" : "${meta.id}.strelka.${target_bed.simpleName}" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.strelka" : "${meta.id}.strelka.${target_bed.baseName}" }
ext.when = { params.tools && params.tools.split(',').contains('strelka') }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_GATK {
// Rename based on num_intervals, group all samples by their interval_name/interval_file and restructure for channel
// Group by [0, 3] to avoid a list of metas and make sure that any intervals
gendb_input = input
.map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.simpleName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] }
.map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.baseName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] }
.groupTuple(by:3) //join on interval file
.map{ meta_list, gvcf, tbi, intervals ->
// meta is now a list of [meta1, meta2] but they are all the same. So take the first element.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ workflow BAM_JOINT_CALLING_GERMLINE_SENTIEON {
versions = Channel.empty()

sentieon_input = input
.map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.simpleName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] }
.map{ meta, gvcf, tbi, intervals -> [ [ id:'joint_variant_calling', intervals_name:intervals.baseName, num_intervals:meta.num_intervals ], gvcf, tbi, intervals ] }
.groupTuple(by:[0, 3])

SENTIEON_GVCFTYPER(sentieon_input, fasta, fai, dbsnp, dbsnp_tbi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ workflow BAM_VARIANT_CALLING_HAPLOTYPECALLER {
cram_intervals = cram.combine(intervals)
// Move num_intervals to meta map
// Add interval_name to allow correct merging with interval files
.map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ interval_name:intervals.simpleName, num_intervals:num_intervals, variantcaller:'haplotypecaller' ], cram, crai, intervals, [] ] }
.map{ meta, cram, crai, intervals, num_intervals -> [ meta + [ interval_name:intervals.baseName, num_intervals:num_intervals, variantcaller:'haplotypecaller' ], cram, crai, intervals, [] ] }

GATK4_HAPLOTYPECALLER(cram_intervals, fasta, fasta_fai, dict.map{ meta, dict -> [ dict ] }, dbsnp, dbsnp_tbi)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ workflow BAM_VARIANT_CALLING_SENTIEON_HAPLOTYPER {
.map{ meta, cram, crai, intervals, num_intervals -> [
meta + [
num_intervals:num_intervals,
intervals_name:intervals.simpleName,
intervals_name:intervals.baseName,
variantcaller:'sentieon_haplotyper'],
cram,
crai,
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/prepare_genome/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ workflow PREPARE_GENOME {
hashtable = DRAGMAP_HASHTABLE.out.hashmap.map{ meta, index -> [index] }.collect() // path: dragmap/*
dbsnp_tbi = TABIX_DBSNP.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: dbsnb.vcf.gz.tbi
dict = GATK4_CREATESEQUENCEDICTIONARY.out.dict // path: genome.fasta.dict
fasta_fai = SAMTOOLS_FAIDX.out.fai.map{ meta, fai -> [fai] } // path: genome.fasta.fai
fasta_fai = SAMTOOLS_FAIDX.out.fai.map{ meta, fai -> [fai] }.flatten().first() // path: genome.fasta.fai
germline_resource_tbi = TABIX_GERMLINE_RESOURCE.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: germline_resource.vcf.gz.tbi
known_snps_tbi = TABIX_KNOWN_SNPS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi
known_indels_tbi = TABIX_KNOWN_INDELS.out.tbi.map{ meta, tbi -> [tbi] }.collect() // path: {known_indels*}.vcf.gz.tbi
Expand Down
2 changes: 1 addition & 1 deletion workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ workflow SAREK {
// Built from the fasta file:
dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:'dict'], it ] }.collect()
: PREPARE_GENOME.out.dict
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).collect()
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).first()
: PREPARE_GENOME.out.fasta_fai
bwa = params.bwa ? Channel.fromPath(params.bwa).collect()
: PREPARE_GENOME.out.bwa
Expand Down
Loading