/htslib_howto

Collection of simple C scripts for parsing vcf or bam files using the htslib C library. These scripts can be used as the starting point for more complex scripts

Primary LanguageCApache License 2.0Apache-2.0

htslib_howto

Collection of C scripts for parsing VCF/BCF, BAM/CRAM or FASTQ files using the HTSLIB C library

This repo contains a set of small C scripts showing how to use the htslib C library for parsing VCF/BCF, BAM/CRAM and FASTQ files. The htslib library is, as fas as I know, the most efficient and fastest way of parsing these kind of files, but unfortunately it is difficult to find examples of how to use it. The simple scripts found in this repo try to address this and can be used as a starting point for more complex programs.

The repo is divided in three directories, VCF contains all the scripts dealing with files in the VCF format, whereas the BAM directory contains the scripts to work with files in the BAM format or any of its variants. Finally, the FASTQ directory contains scripts to parse files in the FASTQ format . The instructions on how to compile each of the scripts are contained in its comments.