]> git.donarmstrong.com Git - bamtools.git/commitdiff
clarified no-index behavior in bam multi reader
authorErik Garrison <erik.garrison@bc.edu>
Wed, 27 Oct 2010 16:07:47 +0000 (12:07 -0400)
committerErik Garrison <erik.garrison@bc.edu>
Wed, 27 Oct 2010 16:07:47 +0000 (12:07 -0400)
src/api/BamMultiReader.cpp

index f8e0997a8d6f13f53611f7c9ab145454969a896b..ef5eeb4505fac6a6830a33d95c8f9966555f14fe 100644 (file)
@@ -301,21 +301,12 @@ bool BamMultiReader::Open(const vector<string>& filenames, bool openIndexes, boo
     // for filename in filenames
     fileNames = filenames; // save filenames in our multireader
     for (vector<string>::const_iterator it = filenames.begin(); it != filenames.end(); ++it) {
-        
+
         const string filename = *it;
         BamReader* reader = new BamReader;
 
         bool openedOK = true;
-        if (openIndexes) {
-            
-            // leave index filename empty 
-            // this allows BamReader & BamIndex to search for any available
-            // useStandardIndex gives hint to prefer BAI over BTI
-            openedOK = reader->Open(filename, "", true, preferStandardIndex);
-        } 
-        
-        // ignoring index file(s)
-        else openedOK = reader->Open(filename); 
+        openedOK = reader->Open(filename, "", openIndexes, preferStandardIndex);
         
         // if file opened ok, check that it can be read
         if ( openedOK ) {