Skip to content

Commit 6c7457c

Browse files
Merge pull request #244 from smithlabcode/adding-functions-for-bam-records
Adding helper functions for mates in BAM records
2 parents facf274 + cc7a207 commit 6c7457c

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/common/bam_record_utils.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@ get_pos(const bamxx::bam_rec &b) {
205205
return b.b->core.pos;
206206
}
207207

208+
inline int32_t
209+
get_mtid(const bamxx::bam_rec &b) {
210+
return b.b->core.mtid;
211+
}
212+
213+
inline hts_pos_t
214+
get_mpos(const bamxx::bam_rec &b) {
215+
return b.b->core.mpos;
216+
}
217+
208218
inline uint32_t
209219
get_n_cigar(const bamxx::bam_rec &b) {
210220
return b.b->core.n_cigar;
@@ -253,7 +263,8 @@ equivalent_end_and_strand(const bamxx::bam_rec &a, const bamxx::bam_rec &b) {
253263
return bam_endpos(a.b) == bam_endpos(b.b) && bam_is_rev(a) == bam_is_rev(b);
254264
}
255265

256-
template<typename T> int
266+
template <typename T>
267+
int
257268
bam_aux_update_int(bamxx::bam_rec &b, const char tag[2], T val) {
258269
return bam_aux_update_int(b.b, tag, val);
259270
}

0 commit comments

Comments
 (0)