Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding helper functions for mates in BAM records #244

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading