This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there any C API documentation for HTSLIB?

I couldn't find any API documentation for HTSLIB C implementation. And I even failed to find tutorials for using HTSLIB C library to read BAM/BCF or other files.

Does anyone know where is its doc?

htslib api doc bam

The library is actually built with Doxygen-friendly API formatting. I was able to generate a much more user-friendly API with Doxygen.

1 answer

The documentation is mostly just the header files in the htslib/ subdirectory. If you have any questions on usage, you can probably get decently quick replies here (at least I've made fairly heavy use of the API over the years, though I've never needed to deal with the BCF side).

Ok, thanks.

Do you share code on github?

Cool, studying now...

Dear Devon I have problem with its compilation. Would you please tell me how I should start? In a simple case, I want to use #include "htslib/sam.h". Should I build samtools and htslib beforehand? when I want to compile, should I add the address using -I and -L ? thank you in advance.

You don't need samtools, yes you will want to compile and install htslib so you can link against it.

Log in to answer this question.