Skip to content

Commit

Permalink
consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Sep 24, 2024
1 parent 1b40aa2 commit 2b05284
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/merge.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,12 +450,12 @@ void _outputSelectedIntervals(MergeConfig& c, TGenomeIntervals const& iSelected,
float srAlignQuality = 0;
if (bcf_get_info_float(hdr[idx], rec[idx], "SRQ", &srq, &nsrq) > 0) srAlignQuality = *srq;

std::string consensus;
std::string consStr;
float ceVal = 0;
int32_t consBpVal = 0;
if (precise) {
if (bcf_get_info_float(hdr[idx], rec[idx], "CE", &ce, &nce) > 0) ceVal = *ce;
if (bcf_get_info_string(hdr[idx], rec[idx], "CONSENSUS", &cons, &ncons) > 0) consensus = boost::to_upper_copy(std::string(cons));
if (bcf_get_info_string(hdr[idx], rec[idx], "CONSENSUS", &cons, &ncons) > 0) consStr = boost::to_upper_copy(std::string(cons));
if (bcf_get_info_int32(hdr[idx], rec[idx], "CONSBP", &consbp, &nconsbp) > 0) consBpVal = *consbp;
}

Expand Down Expand Up @@ -508,8 +508,8 @@ void _outputSelectedIntervals(MergeConfig& c, TGenomeIntervals const& iSelected,
bcf_update_info_int32(hdr_out, rout, "HOMLEN", &homlenVal, 1);
bcf_update_info_int32(hdr_out, rout, "SR", &srSupport, 1);
bcf_update_info_float(hdr_out, rout, "SRQ", &srAlignQuality, 1);
if (consensus.size()) {
bcf_update_info_string(hdr_out, rout, "CONSENSUS", consensus.c_str());
if (consStr.size()) {
bcf_update_info_string(hdr_out, rout, "CONSENSUS", consStr.c_str());
bcf_update_info_float(hdr_out, rout, "CE", &ceVal, 1);
bcf_update_info_int32(hdr_out, rout, "CONSBP", &consBpVal, 1);
}
Expand Down
4 changes: 2 additions & 2 deletions src/modvcf.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace torali
{


void _remove_info_tag(bcf_hdr_t* hdr, bcf1_t* rec, std::string const& tag) {
void _remove_info_tag(bcf_hdr_t const* hdr, bcf1_t* rec, std::string const& tag) {
bcf_update_info(hdr, rec, tag.c_str(), NULL, 0, BCF_HT_INT); // Type does not matter for n = 0
}

void _remove_format_tag(bcf_hdr_t* hdr, bcf1_t* rec, std::string const& tag) {
void _remove_format_tag(bcf_hdr_t const* hdr, bcf1_t* rec, std::string const& tag) {
bcf_update_format(hdr, rec, tag.c_str(), NULL, 0, BCF_HT_INT); // Type does not matter for n = 0
}

Expand Down
2 changes: 1 addition & 1 deletion src/split.h
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ namespace torali

template<typename TConfig>
inline bool
alignConsensus(TConfig const& c, bam_hdr_t* hdr, char const* seq, char const* sndSeq, StructuralVariantRecord& sv, bool const realign) {
alignConsensus(TConfig const& c, bam_hdr_t const* hdr, char const* seq, char const* sndSeq, StructuralVariantRecord& sv, bool const realign) {
if ( (int32_t) sv.consensus.size() < (2 * c.minimumFlankSize + sv.insLen)) return false;

// Get reference slice
Expand Down

0 comments on commit 2b05284

Please sign in to comment.