Questions tagged [htslib]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
74 views

Use Htslib to extract specific region of vcf file

I am working in c++ using the htslib library to parse different vcf files as well as fasta files. My goal is to read in a specific region from a fastafile and then extract all the VCF sites within ...
0
votes
1answer
33 views

extract chimeric and multimap reads from bam file

I am trying to extract all chimeric and multi-map reads from either SAM/BAM file. Is there any simple command to do that? Can I use htslib for parsing sam/bam files ...
1
vote
1answer
45 views

How to print alternative allele from VCF with htslib c++

I would like to print the alternative allele from a vcf file which i load in with htslib. The description of some functions: https://github.com/samtools/htslib/blob/develop/htslib/vcf.h I have used ...
1
vote
0answers
146 views

How to troubleshoot access to tabix file via http or https?

I have some BED files that I have compressed with bgzip and indexed with tabix. I am using version ...
2
votes
1answer
96 views

SAM format: Does the BAM “Integer or numeric array” field no longer exist? Why?

The SAM file format specification makes clear that optional fields must follow the format TAG:TYPE:VALUE ...
7
votes
2answers
433 views

How does htslib/samtools access optional BAM fields?

I am confused regarding how various software libraries deal with optional fields in a BAM: Based upon the BAM specification, there are 11 mandatory fields to a BAM: ...
3
votes
1answer
468 views

How to use C++ htslib to read VCF contig name and size?

A typical VCF file has: ##contig=<ID=chr1,length=248956422> ##contig=<ID=chr2,length=242193529> I would like to use ...
4
votes
2answers
1k views

bcftools output vs. bgzip

I've got what seems like it should be a simple question, but I can't seem to figure it out from google. bcftools has 4 output options: ...
12
votes
1answer
3k views

What's the difference between VCF spec versions 4.1 and 4.2?

What are the key differences between VCF versions 4.1 and 4.2? It looks like v4.3 contains a changelog (specs available here) but earlier specifications do not. This biostar post points out one ...