本文整理汇总了C++中Alignment::mapping_quality方法的典型用法代码示例。如果您正苦于以下问题:C++ Alignment::mapping_quality方法的具体用法?C++ Alignment::mapping_quality怎么用?C++ Alignment::mapping_quality使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alignment
的用法示例。
在下文中一共展示了Alignment::mapping_quality方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Alignment
/*PE Functions*/
pair<Alignment, Alignment> Filter::one_end_anchored_filter(Alignment& aln_first, Alignment& aln_second){
if (aln_first.mapping_quality() == 0 | aln_second.mapping_quality() == 0){
return inverse ? std::make_pair(Alignment(), Alignment()) : std::make_pair(aln_first, aln_second);
}
else{
return inverse ? std::make_pair(aln_first, aln_second) : std::make_pair(Alignment(), Alignment());
}
}
示例2: alignment_to_sam
string alignment_to_sam(const Alignment& alignment,
const string& refseq,
const int32_t refpos,
const string& cigar,
const string& mateseq,
const int32_t matepos,
const int32_t tlen) {
stringstream sam;
sam << (!alignment.name().empty() ? alignment.name() : "*") << "\t"
<< sam_flag(alignment) << "\t"
<< (refseq.empty() ? "*" : refseq) << "\t"
<< refpos + 1 << "\t"
//<< (alignment.path().mapping_size() ? refpos + 1 : 0) << "\t" // positions are 1-based in SAM, 0 means unmapped
<< alignment.mapping_quality() << "\t"
<< (alignment.has_path() && alignment.path().mapping_size() ? cigar : "*") << "\t"
<< (mateseq == refseq ? "=" : mateseq) << "\t"
<< matepos + 1 << "\t"
<< tlen << "\t"
<< (!alignment.sequence().empty() ? alignment.sequence() : "*") << "\t";
// hack much?
if (!alignment.quality().empty()) {
const string& quality = alignment.quality();
for (int i = 0; i < quality.size(); ++i) {
sam << quality_short_to_char(quality[i]);
}
} else {
sam << "*";
//sam << string(alignment.sequence().size(), 'I');
}
//<< (alignment.has_quality() ? string_quality_short_to_char(alignment.quality()) : string(alignment.sequence().size(), 'I'));
if (!alignment.read_group().empty()) sam << "\tRG:Z:" << alignment.read_group();
sam << "\n";
return sam.str();
}