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 1 commit
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
Prev Previous commit
Next Next commit
update ped filter subwf
  • Loading branch information
nvnieuwk committed Jan 23, 2025
commit 5af2749a0b3e2ea6b0f15e2627d502eab51d7c17
4 changes: 2 additions & 2 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,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 @@ -257,7 +257,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
11 changes: 7 additions & 4 deletions subworkflows/local/vcf_ped_rtgtools/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ workflow VCF_PED_RTGTOOLS {

def ch_annotate_input = ch_vcfs
.join(RTGTOOLS_PEDFILTER.out.output, failOnDuplicate:true, failOnMismatch:true)
.map { meta, vcf, _tbi, ped_vcf ->
[ meta, vcf, [], [], [], ped_vcf ]
.map { meta, vcf, tbi, ped_vcf ->
[ meta, vcf, tbi, [], [], ped_vcf ]
}

BCFTOOLS_ANNOTATE(
ch_annotate_input
)
ch_versions = ch_versions.mix(BCFTOOLS_ANNOTATE.out.versions.first())

def ch_ped_vcfs = BCFTOOLS_ANNOTATE.out.vcf
.join(BCFTOOLS_ANNOTATE.out.tbi, failOnDuplicate:true, failOnMismatch:true)

emit:
ped_vcfs = BCFTOOLS_ANNOTATE.out.vcf // [ val(meta), path(vcf) ]
versions = ch_versions // [ path(versions) ]
ped_vcfs = ch_ped_vcfs // [ val(meta), path(vcf), path(tbi) ]
versions = ch_versions // [ path(versions) ]
}
33 changes: 3 additions & 30 deletions workflows/germline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,8 @@ workflow GERMLINE {
)
ch_versions = ch_versions.mix(BCFTOOLS_NORM.out.versions.first())

TABIX_NORMALIZE(
BCFTOOLS_NORM.out.vcf
)
ch_versions = ch_versions.mix(TABIX_NORMALIZE.out.versions.first())

ch_normalized_variants = BCFTOOLS_NORM.out.vcf
.join(TABIX_NORMALIZE.out.tbi, failOnDuplicate:true, failOnMismatch:true)
.join(BCFTOOLS_NORM.out.tbi, failOnDuplicate:true, failOnMismatch:true)
} else {
ch_normalized_variants = ch_filtered_variants
}
Expand Down Expand Up @@ -633,7 +628,6 @@ workflow GERMLINE {
// Annotation of the variants and creation of Gemini-compatible database files
//

def ch_annotation_output = Channel.empty()
if (annotate) {
VCF_ANNOTATION(
ch_ped_vcfs,
Expand All @@ -652,32 +646,11 @@ workflow GERMLINE {
ch_versions = ch_versions.mix(VCF_ANNOTATION.out.versions)
ch_reports = ch_reports.mix(VCF_ANNOTATION.out.reports)

ch_annotation_output = VCF_ANNOTATION.out.annotated_vcfs
ch_final_vcfs = VCF_ANNOTATION.out.annotated_vcfs
} else {
ch_annotation_output = ch_ped_vcfs
ch_final_vcfs = ch_ped_vcfs
}

//
// Tabix the resulting VCF
//

def ch_ann_tabix = ch_annotation_output.branch { meta, vcf, tbi=[] ->
indexed: tbi
return [ meta, vcf, tbi ]
not_indexed: !tbi
return [ meta, vcf ]
}

TABIX_FINAL(
ch_ann_tabix.not_indexed
)
ch_versions = ch_versions.mix(TABIX_FINAL.out.versions.first())

ch_final_vcfs = ch_ann_tabix.indexed
.mix(
ch_ann_tabix.not_indexed.join(TABIX_FINAL.out.tbi, failOnDuplicate:true, failOnMismatch:true)
)

//
// Validate the found variants
//
Expand Down