samtools / htslib

C library for high-throughput sequencing data formats
Other
783 stars 447 forks source link

How to control the version of htslib? #1790

Closed xmy1990 closed 2 weeks ago

xmy1990 commented 2 weeks ago

Hi, I use below method to install samtools,

conda install -c bioconda samtools=1.11

then, samtools was installed as : Version: 1.11 (using htslib 1.12)

But i need Version: 1.11 (using htslib 1.11)

How to control the version of htslib, when i install samtools wtih conda install -c bioconda samtools=1.11

Thanks

dlaehnemann commented 2 weeks ago

As you are installing via bioconda, this is more a bioconda issue, than a samtools / htslib issue. So let me try to point you to some things:

  1. Are you sure you want to use such an old version? If you use the latest version of samtools available via bioconda (currently v.1.20), this will nowadays ensure that the versions of samtools and the htslib used match up, see here: https://bioconda.github.io/recipes/samtools/README.html?highlight=samtools#package-package%20'samtools' And I think, based on this PR, that this version matching should at least work since samtools version 1.18 (maybe also some earlier versions, but I haven't checked and don't fully grasp the intricacies of the run_exports involved): https://github.com/bioconda/bioconda-recipes/pull/43476
  2. If you absolutely need this old version, you could try fixing htslib during the installation, as well. The following worked for me:
    $ mamba create -n test samtools=1.11 htslib=1.11
    $ mamba activate test
    $ samtools --version
    samtools 1.11
    Using htslib 1.11
    Copyright (C) 2020 Genome Research Ltd.
daviesrob commented 2 weeks ago

Yes, this is a question for bioconda-recipes. The samtools developers are not involved in packaging samtools for conda.

And please, unless you have a good reason not to, try to use the latest version (currently 1.20). It includes a number of bug fixes that have gone in since 1.11, and will be much more reliable.

xmy1990 commented 2 weeks ago

Thank you so much for your prompt and professional response, which helped me solve the problem. @https://github.com/dlaehnemann@https://github.com/daviesrob