]> git.donarmstrong.com Git - bamtools.git/blobdiff - bamtools_index.h
further cleanup of duplicate @RG tag warning reporting
[bamtools.git] / bamtools_index.h
index 5c0a1b2e1915f080fda1edc39e8e8e2a3eee5e94..bb6d89353066bd8972734d1ddbaeb2280609f53d 100644 (file)
@@ -3,58 +3,33 @@
 // Marth Lab, Department of Biology, Boston College
 // All rights reserved.
 // ---------------------------------------------------------------------------
-// Last modified: 26 May 2010
+// Last modified: 1 June 2010
 // ---------------------------------------------------------------------------
-// Creates a BAM index (".bai") file for the provided BAM file.
+// Creates a BAM index (".bai") file for the provided BAM file
 // ***************************************************************************
 
 #ifndef BAMTOOLS_INDEX_H
 #define BAMTOOLS_INDEX_H
 
-#include <iostream>
-#include <string>
-
-#include "BamReader.h"
-// #include "GetOpt.h"
-#include "bamtools_getopt.h"
+#include "bamtools_tool.h"
 
 namespace BamTools {
-
-int BamIndexHelp(void) { 
-    std::cerr << std::endl;
-    std::cerr << "usage:\tbamtools index [--nclist] FILE" << std::endl;
-    std::cerr << std::endl;
-    std::cerr << "\t--nclist  Use NCList indexing scheme (faster?)   [off] ** JUST HERE AS POSSIBLE SWITCH EXAMPLE FOR NOW **" << std::endl;
-    std::cerr << "\tFILE      Input BAM file to generate index from  [REQUIRED]" << std::endl;
-    std::cerr << std::endl;
-    return 0;
-}
-
-int RunBamIndex(int argc, char* argv[]) {
   
-    // else parse command line for args  
-    GetOpt options(argc, argv, 1);
-    
-    std::string inputFilename;
-    options.addRequiredArgument("input", &inputFilename);
-    
-    bool useNCList;
-    options.addSwitch("nclist", &useNCList);
-    
-    if ( !options.parse() ) return BamIndexHelp();
-    
-    // open our BAM reader
-    BamReader reader;
-    reader.Open(inputFilename);
-    
-    // create index for BAM file
-    reader.CreateIndex();
-    
-    // clean & exit
-    reader.Close();
-    return 0;
-}
-
+class IndexTool : public AbstractTool {
+  
+    public:
+        IndexTool(void);
+        ~IndexTool(void);
+  
+    public:
+        int Help(void);
+        int Run(int argc, char* argv[]); 
+        
+    private:
+        struct IndexSettings;
+        IndexSettings* m_settings;
+};
+  
 } // namespace BamTools
 
 #endif // BAMTOOLS_INDEX_H