How To Install libhts-dev on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
3 minutes • 450 words
Introduction
In this tutorial we learn how to install libhts-dev on Ubuntu.
What is libhts-dev
libhts-dev is:
HTSlib is an implementation of a unified C library for accessing common file formats, such as SAM (Sequence Alignment/Map), CRAM and VCF (Variant Call Format), used for high-throughput sequencing data, and is the core library used by samtools and bcftools. HTSlib only depends on zlib. It is known to be compatible with gcc, g++ and clang.
HTSlib implements a generalized BAM (binary SAM) index, with file extension ‘csi’ (coordinate-sorted index). The HTSlib file reader first looks for the new index and then for the old if the new index is absent.
This package contains development files for the HTSlib: headers, static library, manual pages, etc.
For compatibility with sambamba, the internal routine cram_to_bam was exported, hereto adopting a patch found in guix.
There are three methods to install libhts-dev on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install libhts-dev Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install libhts-dev using apt-get by running the following command:
sudo apt-get -y install libhts-dev
Install libhts-dev Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install libhts-dev using apt by running the following command:
sudo apt -y install libhts-dev
Install libhts-dev Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install libhts-dev using aptitude by running the following command:
sudo aptitude -y install libhts-dev
How To Uninstall libhts-dev on Ubuntu
To uninstall only the libhts-dev package we can use the following command:
sudo apt-get remove libhts-dev
Uninstall libhts-dev And Its Dependencies
To uninstall libhts-dev and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove libhts-dev
Remove libhts-dev Configurations and Data
To remove libhts-dev configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge libhts-dev
Remove libhts-dev configuration, data, and all of its dependencies
We can use the following command to remove libhts-dev configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge libhts-dev
Dependencies
libhts-dev have the following dependencies:
References
Summary
In this tutorial we learn how to install libhts-dev package on Ubuntu using different package management tools: apt, apt-get and aptitude.