Loading...
Searching...
No Matches
BamTools::Algorithms::Sort::ByTag< T > Struct Template Reference

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) const

## Detailed Description

template<typename T>
struct BamTools::Algorithms::Sort::ByTag< T >

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
Function object for comparing alignments by tag value.
Definition Sort.h:178
BamTools::Algorithms::Sort::DescendingOrder
@ DescendingOrder
Definition Sort.h:37
BamTools::Algorithms::Sort::AscendingOrder
@ AscendingOrder
Definition Sort.h:36

## Constructor & Destructor Documentation

## ByTag()

template<typename T>

BamTools::Algorithms::Sort::ByTag< T >::ByTag | ( | const std::string & | tag,
|  | const Sort::Order & | order = Sort::AscendingOrder )

inline

## Member Function Documentation

## operator()()

template<typename T>

bool BamTools::Algorithms::Sort::ByTag< T >::operator() | ( | const BamTools::BamAlignment & | lhs,
|  | const BamTools::BamAlignment & | rhs ) const

inline

The documentation for this struct was generated from the following file:

- Sort.h