Skip to content

Commit

Permalink
Merge pull request #244 from smithlabcode/adding-functions-for-bam-re…
Browse files Browse the repository at this point in the history
…cords

Adding helper functions for mates in BAM records
  • Loading branch information
andrewdavidsmith authored Oct 18, 2024
2 parents facf274 + cc7a207 commit 6c7457c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/common/bam_record_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<typename T> int
template <typename T>
int
bam_aux_update_int(bamxx::bam_rec &b, const char tag[2], T val) {
return bam_aux_update_int(b.b, tag, val);
}
Expand Down

0 comments on commit 6c7457c

Please sign in to comment.