Skip to content

Commit

Permalink
fix bam_aux_type problem
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgOz committed May 10, 2024
1 parent 9fb5a53 commit d00e222
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/fetch_data_from_bam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,18 @@ static int collectRegionData_Bisq(const bam1_t *hit, void *data) {
uint8_t* ydTag = bam_aux_get(hit, "YD");
char ydValue;
if (ydTag) {
// The first byte is the type identifier, followed by the value
char type = bam_aux_type(ydTag);
if (type == 'A') {
// Get value
ydValue = bam_aux2A(ydTag);

} else {
ydValue = bam_aux2A(ydTag);
if(ydValue == 0)
Rcpp::Rcout << "Unexpected type for YD tag" << std::endl;
}
// The first byte is the type identifier, followed by the value
// char type = bam_aux_type(ydTag);
// if (type == 'A') {
// // Get value
// ydValue = bam_aux2A(ydTag);
//
// } else {
// Rcpp::Rcout << "Unexpected type for YD tag" << std::endl;
// }

} else {
Rcpp::Rcout << "No YD tag found. Either BAM file is corrupted or generated not by BISCUIT." << std::endl;
Expand Down

0 comments on commit d00e222

Please sign in to comment.