BamTools::Algorithms::Sort::ByTag< T > Struct Template Reference

Function object for comparing alignments by tag value. More...

#include <Sort.h>

List of all members.

Public Member Functions

 ByTag (const std::string &tag, const Sort::Order &order=Sort::AscendingOrder)
bool operator() (const BamTools::BamAlignment &lhs, const BamTools::BamAlignment &rhs)

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

Constructor & Destructor Documentation

template<typename T >
BamTools::Algorithms::Sort::ByTag< T >::ByTag ( const std::string &  tag,
const Sort::Order order = Sort::AscendingOrder 
) [inline]

Member Function Documentation

template<typename T >
bool BamTools::Algorithms::Sort::ByTag< T >::operator() ( const BamTools::BamAlignment lhs,
const BamTools::BamAlignment rhs 
) [inline]

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Aug 29 17:43:46 2012 for BamTools by  doxygen 1.6.3