Function object for comparing alignments by tag value. More...
#include <Sort.h>
Public Member Functions | |
ByTag (const std::string &tag, const Sort::Order &order=Sort::AscendingOrder) | |
bool | operator() (const BamTools::BamAlignment &lhs, const BamTools::BamAlignment &rhs) |
Function object for comparing alignments by tag value.
Default sort order is Sort::AscendingOrder.
std::vector<BamAlignment> a; // sort by edit distance, in ascending order (the following two lines are equivalent): std::sort( a.begin(), a.end(), Sort::ByTag<int>("NM") ); std::sort( a.begin(), a.end(), Sort::ByTag<int>("NM", Sort::AscendingOrder) ); // OR sort in descending order std::sort( a.begin(), a.end(), Sort::ByTag<int>("NM", Sort::DescendingOrder) );
BamTools::Algorithms::Sort::ByTag< T >::ByTag | ( | const std::string & | tag, | |
const Sort::Order & | order = Sort::AscendingOrder | |||
) | [inline] |
bool BamTools::Algorithms::Sort::ByTag< T >::operator() | ( | const BamTools::BamAlignment & | lhs, | |
const BamTools::BamAlignment & | rhs | |||
) | [inline] |