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

Don't run samtools mpileup when only tools mpileup is selected #1104

Closed
FriederikeHanssen opened this issue Jun 13, 2023 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@FriederikeHanssen
Copy link
Contributor

Description of the bug

currently samtools mielup and bcftools mpileup are both run when tools mpileup is selected, however only run bcftools then + fix the output docs if this is done

Command used and terminal output

No response

Relevant files

No response

System information

No response

@FriederikeHanssen FriederikeHanssen added the bug Something isn't working label Jun 13, 2023
@asp8200
Copy link
Contributor

asp8200 commented Jun 13, 2023

This whole things seems very delicate, and we should probably be very careful when changing the current setup.

The rather puzzling usage of both samtools mpileup and bcftools mpileup seems to be due to problems with getting the mpileup-subworkflow to play nicely with controllfreec :

#832 (comment)

@FriederikeHanssen
Copy link
Contributor Author

so basically samtolls mpileup should be run for controlfreec. But when people select mpileup in tools, bcftools should be used

@asp8200
Copy link
Contributor

asp8200 commented Jun 13, 2023

so basically samtolls mpileup should be run for controlfreec. But when people select mpileup in tools, bcftools should be used

That sounds like one way (and probably the right way) of fixing this.

However, 'i'd say that Amin's immediate problem is that when Sarek runs with intervals no vcf-file (just mpileup-file) is published, and that happens even though BAM_VARIANT_CALLING_MPILEUP:GATK4_MERGEVCFS is called :


[bb/93ce90] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_MPILEUP:BCFTOOLS_MPILEUP (testT)            [100%] 4 of 4 ✔
[ab/e1ab50] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_MPILEUP:SAMTOOLS_MPILEUP (testT)            [100%] 4 of 4 ✔
[b7/18fc91] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_MPILEUP:CAT_MPILEUP (testT)                 [100%] 2 of 2 ✔
[11/a1d7aa] process > NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_MPILEUP:GATK4_MERGEVCFS (testT)             [100%] 2 of 2 ✔

A quick-fix for Amin might be to add a config for publishing from BAM_VARIANT_CALLING_MPILEUP:GATK4_MERGEVCFS.

@FriederikeHanssen
Copy link
Contributor Author

yep that sounds very reasonable. Do you have time to guide him through it?

@asp8200
Copy link
Contributor

asp8200 commented Jun 13, 2023

yep that sounds very reasonable. Do you have time to guide him through it?

I'll try as best I can

@asp8200
Copy link
Contributor

asp8200 commented Jun 13, 2023

So in conf/modules/mpileup.config, I added

withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_MPILEUP:GATK4_MERGEVCFS' {
    ext.when   = { (meta.num_intervals > 1) && params.tools && params.tools.split(',').contains('mpileup') }
    publishDir = [
        mode: params.publish_dir_mode,
        path: { "${params.outdir}/variant_calling/mpileup/${meta.id}/" },
        pattern: "*{vcf.gz,vcf.gz.tbi}"
    ]
}

And, with that, I get testN.normal.mpileup.gz, testN.vcf.gz and testN.vcf.gz.tbi in results/variant_calling/mpileup/testN/ when running

nextflow run main.nf -profile test,targeted,docker --input ./tests/csv/3.0/mapped_joint_bam.csv --tools mpileup --step variant_calling --outdir results

Disclaimer: This quick-fix hasn't been tested with controllfreec.

@ Amin : Let me know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants