From cc7a207d3d34dabfc86cb4a9f8332ae1da2f5017 Mon Sep 17 00:00:00 2001 From: Andrew D Smith Date: Fri, 18 Oct 2024 11:07:31 -0700 Subject: [PATCH] src/common/bam_record_utils.hpp: Adding some helper functions for the mates of BAM records --- src/common/bam_record_utils.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/bam_record_utils.hpp b/src/common/bam_record_utils.hpp index 74792ede..f9306f38 100644 --- a/src/common/bam_record_utils.hpp +++ b/src/common/bam_record_utils.hpp @@ -205,6 +205,16 @@ get_pos(const bamxx::bam_rec &b) { return b.b->core.pos; } +inline int32_t +get_mtid(const bamxx::bam_rec &b) { + return b.b->core.mtid; +} + +inline hts_pos_t +get_mpos(const bamxx::bam_rec &b) { + return b.b->core.mpos; +} + inline uint32_t get_n_cigar(const bamxx::bam_rec &b) { return b.b->core.n_cigar; @@ -253,7 +263,8 @@ equivalent_end_and_strand(const bamxx::bam_rec &a, const bamxx::bam_rec &b) { return bam_endpos(a.b) == bam_endpos(b.b) && bam_is_rev(a) == bam_is_rev(b); } -template int +template +int bam_aux_update_int(bamxx::bam_rec &b, const char tag[2], T val) { return bam_aux_update_int(b.b, tag, val); }