From 038f0e1dda24b2d6765cc8c878b7dbdc5f922ed6 Mon Sep 17 00:00:00 2001 From: derek Date: Fri, 30 Sep 2011 16:20:28 -0400 Subject: [PATCH] Initial test run of new BamAlgorithms --- src/api/BamAlgorithms.h | 144 +++++++++++++++++++++++++++++++++ src/api/CMakeLists.txt | 1 + src/toolkit/bamtools_count.cpp | 113 +++++++++++++++++++++++--- 3 files changed, 248 insertions(+), 10 deletions(-) create mode 100644 src/api/BamAlgorithms.h diff --git a/src/api/BamAlgorithms.h b/src/api/BamAlgorithms.h new file mode 100644 index 0000000..c62e68e --- /dev/null +++ b/src/api/BamAlgorithms.h @@ -0,0 +1,144 @@ +// *************************************************************************** +// BamAlgorithms.h (c) 2009 Derek Barnett +// Marth Lab, Department of Biology, Boston College +// All rights reserved. +// --------------------------------------------------------------------------- +// Last modified: 29 September 2011 (DB) +// --------------------------------------------------------------------------- +// Provides generic algorithms that are intended to work with BamTools data +// structures. Where possible, these are intended to be STL-compatible. +// *************************************************************************** + +#ifndef BAMALGORITHMS_H +#define BAMALGORITHMS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace BamTools { +namespace Algorithms { + +// ------------------------------------------------------- +// Built-in function objects for comparing BamAlignments + +typedef std::binary_function BamAlignmentComparer; + +// Algorithms::SortByName +// compare alignments by name (default comparison is std::less ) +template