]> git.donarmstrong.com Git - bamtools.git/blobdiff - BamMultiReader.h
integration of SetRegion into BamMultiReader
[bamtools.git] / BamMultiReader.h
index 6d5a805f2739c9306ac6c9d2f23bc37b63ab388e..e5960df03f13c84a70e392962b45e8a69afed590 100644 (file)
@@ -43,17 +43,31 @@ class BamMultiReader {
         int CurrentRefID;\r
         int CurrentLeft;\r
 \r
+        // region under analysis, specified using SetRegion\r
+        BamRegion Region;\r
+\r
         // ----------------------\r
         // BAM file operations\r
         // ----------------------\r
 \r
         // close BAM files\r
         void Close(void);\r
+\r
+        // opens BAM files (and optional BAM index files, if provided)\r
+        // @openIndexes - triggers index opening, useful for suppressing\r
+        // error messages during merging of files in which we may not have\r
+        // indexes.\r
+        // @coreMode - setup our first alignments using GetNextAlignmentCore();\r
+        // also useful for merging\r
+        void Open(const vector<string> filenames, bool openIndexes = true, bool coreMode = false);\r
+\r
         // performs random-access jump to reference, position\r
         bool Jump(int refID, int position = 0);\r
-        // opens BAM files (and optional BAM index files, if provided)\r
-        //void Open(const vector<std::string&> filenames, const vector<std::string&> indexFilenames);\r
-        void Open(const vector<string> filenames, bool openIndexes = true);\r
+\r
+        // sets the target region\r
+        bool SetRegion(const BamRegion& region);\r
+        bool SetRegion(const int&, const int&, const int&, const int&); // convenience function to above\r
+\r
         // returns file pointers to beginning of alignments\r
         bool Rewind(void);\r
 \r
@@ -65,6 +79,10 @@ class BamMultiReader {
 \r
         // retrieves next available alignment (returns success/fail) from all files\r
         bool GetNextAlignment(BamAlignment&);\r
+        // retrieves next available alignment (returns success/fail) from all files\r
+        // and populates the support data with information about the alignment\r
+        // *** BUT DOES NOT PARSE CHARACTER DATA FROM THE ALIGNMENT\r
+        bool GetNextAlignmentCore(BamAlignment&);\r
         // ... should this be private?\r
         bool HasOpenReaders(void);\r
 \r
@@ -95,6 +113,7 @@ class BamMultiReader {
         // utility\r
         void PrintFilenames(void);\r
         void DumpAlignmentIndex(void);\r
+        void UpdateAlignments(void); // updates our alignment cache\r
 \r
     // private implementation\r
     private:\r