]> git.donarmstrong.com Git - bamtools.git/blobdiff - BamMultiReader.h
change merger to use GetNextAlignmentCore
[bamtools.git] / BamMultiReader.h
index f1a2bb242e450785c5cacf32517d393a93fc9e1a..3d9024c40ce9927e13e3588acb82d4d09b7711a7 100644 (file)
@@ -15,6 +15,7 @@
 #include <string>\r
 #include <map>\r
 #include <utility> // for pair\r
+#include <sstream>\r
 \r
 using namespace std;\r
 \r
@@ -27,6 +28,7 @@ namespace BamTools {
 // index mapping reference/position pairings to bamreaders and their alignments\r
 typedef multimap<pair<int, int>, pair<BamReader*, BamAlignment*> > AlignmentIndex;\r
 \r
+\r
 class BamMultiReader {\r
 \r
     // constructor / destructor\r
@@ -47,11 +49,18 @@ class BamMultiReader {
 \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
         // returns file pointers to beginning of alignments\r
         bool Rewind(void);\r
 \r
@@ -63,6 +72,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