本文整理汇总了C++中path_t::rend方法的典型用法代码示例。如果您正苦于以下问题:C++ path_t::rend方法的具体用法?C++ path_t::rend怎么用?C++ path_t::rend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类path_t
的用法示例。
在下文中一共展示了path_t::rend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
static
void
rev_apath_to_export_md(path_t& apath,
const char* ref_begin,
const char* ref_bases,
const char* ref_end,
const char* read_bases,
std::string& md)
{
// process the align path
bool foundUnsupportedCigar = false;
path_t::const_reverse_iterator pCRIter;
for (pCRIter = apath.rbegin(); pCRIter != apath.rend(); ++pCRIter)
{
if (pCRIter->type == DELETE)
{
// handle deletion
md.push_back('^');
for (uint32_t i = 0; i < pCRIter->length; ++i, --ref_bases)
{
md.push_back(comp_base(*ref_bases));
}
md.push_back('$');
}
else if (pCRIter->type == INSERT)
{
// handle insertion
md.push_back('^');
md += boost::lexical_cast<std::string>(pCRIter->length);
read_bases += pCRIter->length;
md.push_back('$');
}
else if (is_segment_align_match(pCRIter->type))
{
// recreate the the match descriptor for this non-INDEL region
uint32_t numMatchingBases = 0;
for (uint32_t i = 0; i < pCRIter->length; ++i, --ref_bases, ++read_bases)
{
// handle circular genome
if ((ref_bases < ref_begin) || (ref_bases > ref_end))
{
md.push_back('N');
continue;
}
const char rcRefBase = comp_base(*ref_bases);
if (rcRefBase != *read_bases)
{
// write the number of preceding matching bases
if (numMatchingBases != 0)
{
md += boost::lexical_cast<std::string>(numMatchingBases);
numMatchingBases = 0;
}
// output the mismatched base
md.push_back(rcRefBase);
}
else ++numMatchingBases;
}
// write the number of trailing matching bases
if (numMatchingBases != 0)
{
md += boost::lexical_cast<std::string>(numMatchingBases);
}
}
else
{
// handle unsupported CIGAR operation
foundUnsupportedCigar = true;
break;
}
}
if (foundUnsupportedCigar) md = "UNSUPPORTED";
}