HTSlib is an implementation of a unified C library for accessing common file formats, such as SAM, CRAM and VCF, used for high-throughput sequencing data, and is the core library used by samtools and bcftools.

Documentation

General documentation on htslib and samtools
Source code

The sample programs included in the distribution have copied to /mnt/nasapps/production/htslib/samples/.

Slurm script

Using the package under srun. A batch script can also be used.

$ module load htslib
$ htsfile --view colons.bam
@SQ	SN:chr1	LN:1000
@SQ	SN:chr1:100	LN:1000
@SQ	SN:chr1:100-200	LN:1000
@SQ	SN:chr2:100-200	LN:1000
@SQ	SN:chr3	LN:1000
@SQ	SN:chr1,chr3	LN:1000
chr1	0	chr1	1	0	10M	*	0	0	AACCGCGGTT	*
chr1b	0	chr1	111	0	10M	*	0	0	AACCGCGGTT	*
chr1:100	0	chr1:100	100	0	10M	*	0	0	AACCGCGGTT	*
chr1:100-200	0	chr1:100-200	100	0	10M	*	0	0	AACCGCGGTT	*
chr2:100-200	0	chr2:100-200	100	0	10M	*	0	0	AACCGCGGTT	*
chr1,chr3	0	chr1,chr3	100	0	10M	*	0	0	AACCGCGGTT	*

 

Build instructions for those who are curious

git clone https://github.com/samtools/htslib.git
cd htslib
./configure --prefix=/mnt/nasapps/production/htslib/1.21 --enable-libcurl --enable-gcs --enable-s3
make -j4 && make install
cd samples
make -j4 && make install
cd .. && mv samples /mnt/nasapps/production/htslib/1.21/