Repository navigation
RFC: htslib header parser - #116
SamStudio8 wants to merge 1 commit into
Conversation
|
Minor note; I'll need to check https://www.gnu.org/software/gnulib/manual/gnulib.html for portability of the datetime handling. |
* Added bam_hdr_rg_entry struct to store metadata on each read group line * Added bam_hdr_pg_entry struct to store metadata on each program group line * bam_hdr_t stores pointer to next bam_hdr_[r|p]g_entry as rg, pg * process_bam_hdr_entries accepts bam_hdr_t* and populates linked list structure of bam_hdr_rg_entry and bam_hdr_pg_entry by parsing contents of h->text * bam_hdr_destroy frees rg and pg linked list structures via destroy functions bam_hdr_rg_entry_destroy and bam_hdr_pg_entry_destroy * sam_hdr_read, bam_hdr_read and bam_hdr_dup populates header data via call to process_bam_hdr_entries before returning bam_hdr_t* * Used by sister commit in samtools to drastically improve the performance of samtools merge command
|
Bump |
|
It's worth coming up with a series of requirements and evaluating the current implementations, as we have several. Nils Homer's I think was the first (I forget where it is, probably in a pull request or his fork), I have one in CRAM (https://github.com/samtools/htslib/blob/develop/cram/sam_header.h) and there is this. Obviously I'm biased so I'll leave that evaluation to others. :-) Likely some amalgamation of all of them is required. |
|
Presumably any such series of requirements need be defined by those steering the project so implementations can be tested empirically and finally merged. |
|
I'm now in the position where I need to parse and edit header information. |
|
Hi Jennifer, If desired, I'm happy to at least try and bring this previous Sam On Wed, Mar 9, 2016 at 9:13 AM, Jennifer Liddle [email protected]
|
|
On 09/03/16 14:30, Sam Nicholls wrote:
What I've decided to do at the moment is go with James's version in |
|
Implemented as #812 |
Following issue samtools/samtools#203 I have been experimenting with adding a BAM header parser in htslib and implementing use of its functionality in the reading in of BAM files for
samtools merge, replacing the heavy and inefficient use of regular expressions. Currently this only handles the @rg and @pg lines, whose fields are each stored in a struct, which in turn make up a linked list stored inbam_hdr_t.My C is a little rusty and I imagine my implementation could be simplified and polished somewhat, but I am happy to get some feedback on this as necessary so as I might be able to continue finishing this parser in the right direction.
See also samtools/samtools#259