]> git.donarmstrong.com Git - bamtools.git/blobdiff - bamtools.cpp
added warning for duplicate @RG tag in header
[bamtools.git] / bamtools.cpp
index b5ba6e0a7b00f083ddd3d3866bdb242e70fd6aa4..1dc16d1c0c1976a943ebb07a80bc9c9242b46ed3 100644 (file)
 #include <iostream>
 
 // BamTools includes
+#include "bamtools_convert.h"
 #include "bamtools_count.h"
 #include "bamtools_coverage.h"
+#include "bamtools_filter.h"
 #include "bamtools_header.h"
 #include "bamtools_index.h"
 #include "bamtools_merge.h"
@@ -26,8 +28,10 @@ using namespace BamTools;
 
 // ------------------------------------------
 // bamtools subtool names
+static const string CONVERT  = "convert";
 static const string COUNT    = "count";
 static const string COVERAGE = "coverage";
+static const string FILTER   = "filter";
 static const string HEADER   = "header";
 static const string INDEX    = "index";
 static const string MERGE    = "merge";
@@ -53,8 +57,10 @@ int Help(int argc, char* argv[]) {
     if (argc > 2) {
         
         AbstractTool* tool(0);
+        if ( argv[2] == CONVERT )  tool = new ConvertTool;
         if ( argv[2] == COUNT )    tool = new CountTool;
         if ( argv[2] == COVERAGE ) tool = new CoverageTool;
+        if ( argv[2] == FILTER )   tool = new FilterTool;
         if ( argv[2] == HEADER )   tool = new HeaderTool;
         if ( argv[2] == INDEX )    tool = new IndexTool;
         if ( argv[2] == MERGE )    tool = new MergeTool;
@@ -71,8 +77,10 @@ int Help(int argc, char* argv[]) {
     cerr << "usage: bamtools [--help] COMMAND [ARGS]" << endl;
     cerr << endl;
     cerr << "Available bamtools commands:" << endl;
+    cerr << "\tconvert   Converts between BAM and a number of other formats" << endl;
     cerr << "\tcount     Prints number of alignments in BAM file" << endl;
     cerr << "\tcoverage  Prints coverage statistics from the input BAM file" << endl;
+    cerr << "\tfilter    Filters BAM file(s) by user-specified criteria" << endl;
     cerr << "\theader    Prints BAM header information" << endl;
     cerr << "\tindex     Generates index for BAM file" << endl;
     cerr << "\tmerge     Merge multiple BAM files into single file" << endl;
@@ -112,8 +120,10 @@ int main(int argc, char* argv[]) {
         
     // determine desired sub-tool
     AbstractTool* tool(0);
+    if ( argv[1] == CONVERT )  tool = new ConvertTool;
     if ( argv[1] == COUNT )    tool = new CountTool;
     if ( argv[1] == COVERAGE ) tool = new CoverageTool;
+    if ( argv[1] == FILTER )   tool = new FilterTool;
     if ( argv[1] == HEADER )   tool = new HeaderTool;
     if ( argv[1] == INDEX )    tool = new IndexTool;
     if ( argv[1] == MERGE )    tool = new MergeTool;