1
  1. List item

I tried adding the F_MISSING tag using bcftools 1.16. When I run this command: bcftools +fill-tags input.vcf.gz -- -t 'F_MISSING' | bcftools view -i 'INFO/F_MISSING<0.25' -Oz -o output.vcf.gz

I get the following error: Error parsing "--tags F_MISSING": the tag "F_MISSING" is not supported

This command runs fine using bcftools 1.15. However, version 1.15 gives complications with other packages I use in my snakefile. Do you maybe know alternatives for how to add F_MISSING using bcftls 1.16?

I installed bcftools1.16 in a newly created conda env using conda install -c bioconda bcftools as indicated on https://anaconda.org/bioconda/bcftools

When I type bcftools +fill-tags --version:

bcftools 1.9 using htslib 1.9

plugin at 1.9 using htslib 1.9

##SOLUTION##

Indeed the issue was that I was not installing the most recent version of Conda. I solved it by changing the .condarc file to solelely include the following lines:

channels:
    - conda-forge
    - bioconda
    - defaults

The order is crucial as well.

ra23mik
  • 11
  • 2
  • Please don't [cross-post](https://bioinformatics.stackexchange.com/q/20054/298) to multiple sites of the SE network as this is [against the rules](https://meta.stackexchange.com/q/64068/203101). Either delete one of the two, or edit them so each question is targeted to the specific community you are asking. – terdon Nov 21 '22 at 14:16
  • Srry, will delete this one and I will keep the one on https://bioinformatics.stackexchange.com/questions/20054/bcftools-1-16-able-to-add-f-missing-tag as this question fits better there – ra23mik Nov 21 '22 at 14:20
  • Thanks. But if you delete this, please include the answer you were given here in your question on [bioinformatics.se]. Say that you tried this, it fixes part of the problem but you need more. Also, if you do that, that will make the questions different so you don't even need to delete this one. – terdon Nov 21 '22 at 14:26
  • Okay :) Then I will edit the question on https://bioinformatics.stackexchange.com/ just as you suggest. – ra23mik Nov 21 '22 at 14:32

1 Answers1

0

I'm only giving a partial answer here:

However, version 1.15 gives complications with other packages I use in my snakefile.

You could work around this by making snakemake use a dedicated conda environment for the rule(s) needing bcftools 1.15. E.g.:

rule fill_tags:
    input:
        ...
    output:
        ...
    conda:
        "envs/bcftools-1.15.yaml"
    shell:
        r"""
        bcftools +fill-tags {input.vcf} -- -t 'F_MISSING' \
        | bcftools view -i 'INFO/F_MISSING<0.25' -Oz -o {output.vcf}
        """

Where envs/bcftools-1.15.yaml contains something like:

dependencies:
  - bcftools=1.15

then run snakemake with flag --use-conda

dariober
  • 8,240
  • 3
  • 30
  • 47
  • Thank you :), this is indeed what I tried before and then the package incompatibilities arose. I will also focus on fixing these incompatibilities, so I can use your solution. But apart from that I was wondering if it was somehow possible to still add the F_MISSING tag with bcftools 1.16. – ra23mik Nov 21 '22 at 09:42
  • Fixing bcftools would be preferable of course. You may get better answers on biostars.org or bioinformatics.stackexchange. Regarding snakemake and the package incompatibilities try to give more detail if you want to fix that. – dariober Nov 21 '22 at 09:49
  • Okay, thank you! I will look there, and indeed, if people want to help me with package incompatibilities, they would need a lot of information. :) – ra23mik Nov 21 '22 at 09:53
  • One more clarification... The hypothetical rule `fill_tags`, does it need other programs in addition to bcftools? And are these programs incompatible with bcftools 1.15? If not, then `fill_tags` would run in its own conda env and it shouldnlt be a problem with the rest of the pipeline. But maybe things are way more complicated on your side (and that may be a hint of something to be improved?)... – dariober Nov 21 '22 at 10:00
  • Your example snakemake rule 'fill_tags' is indeed applicable to my case. I don't need any other program besides bcftools for this rule. In every rule I load the conda environment applicable for the shell command of that rule. My conda envs only contain 1 program to avoid incompatibility issues and activating time when using conda on Ubuntu. – ra23mik Nov 21 '22 at 14:13