]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamReader.h
Large-scale API indexing re-organization:
[bamtools.git] / src / api / BamReader.h
index 5d4c83ab9c8c7638c776c3b6a2e987200b0d9487..6e863b6beded3fbded2b9d70b0442b4c1276dbaf 100644 (file)
@@ -3,7 +3,7 @@
 // Marth Lab, Department of Biology, Boston College\r
 // All rights reserved.\r
 // ---------------------------------------------------------------------------\r
-// Last modified: 2 September 2010 (DB)\r
+// Last modified: 3 September 2010 (DB)\r
 // ---------------------------------------------------------------------------\r
 // Uses BGZF routines were adapted from the bgzf.c code developed at the Broad\r
 // Institute.\r
@@ -45,7 +45,12 @@ class BamReader {
         // performs random-access jump to reference, position\r
         bool Jump(int refID, int position = 0);\r
         // opens BAM file (and optional BAM index file, if provided)\r
-        bool Open(const std::string& filename, const std::string& indexFilename = "");\r
+        // @lookForIndex - if no indexFilename provided, look for an existing index file\r
+        // @preferStandardIndex - if true, give priority in index file searching to standard BAM index\r
+        bool Open(const std::string& filename, \r
+                  const std::string& indexFilename = "", \r
+                  const bool lookForIndex = false, \r
+                  const bool preferStandardIndex = false);\r
         // returns file pointer to beginning of alignments\r
         bool Rewind(void);\r
         // sets a region of interest (with left & right bound reference/position)\r
@@ -86,8 +91,10 @@ class BamReader {
         // BAM index operations\r
         // ----------------------\r
 \r
-        // creates index for BAM file, saves to file (default = bamFilename + ".bai")\r
-        bool CreateIndex(bool useDefaultIndex = true);\r
+        // creates index for BAM file, saves to file\r
+        // default behavior is to create the BAM standard index (".bai")\r
+        // set flag to false to create the BamTools-specific index (".bti")\r
+        bool CreateIndex(bool useStandardIndex = true);\r
         \r
     // private implementation\r
     private:\r