]> git.donarmstrong.com Git - bamtools.git/blobdiff - bamtools_merge.cpp
Separated indexing ops to new class. Implemented a fixed-partition-size index format...
[bamtools.git] / bamtools_merge.cpp
index 402d3773d85696a376d449612dc948cb31663911..dcea1725b229a4c95200318ebbe0103cc55ec809 100644 (file)
@@ -62,8 +62,8 @@ MergeTool::MergeTool(void)
     
     // set up options 
     OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
-    Options::AddValueOption("-in",  "BAM filename", "the input BAM file(s)",  "", m_settings->HasInputBamFilename,  m_settings->InputFiles,     IO_Opts);
-    Options::AddValueOption("-out", "BAM filename", "the output BAM file",    "", m_settings->HasOutputBamFilename, m_settings->OutputFilename, IO_Opts);
+    Options::AddValueOption("-in",  "BAM filename", "the input BAM file(s)", "", m_settings->HasInputBamFilename,  m_settings->InputFiles,     IO_Opts);
+    Options::AddValueOption("-out", "BAM filename", "the output BAM file",   "", m_settings->HasOutputBamFilename, m_settings->OutputFilename, IO_Opts);
     
 //     OptionGroup* FilterOpts = Options::CreateOptionGroup("Filters");
 //     Options::AddValueOption("-region", "REGION", "genomic region. See README for more details", "", m_settings->HasRegion, m_settings->Region, FilterOpts);
@@ -89,7 +89,7 @@ int MergeTool::Run(int argc, char* argv[]) {
     
     // opens the BAM files without checking for indexes
     BamMultiReader reader;
-    reader.Open(m_settings->InputFiles, false); 
+    reader.Open(m_settings->InputFiles, false, true); 
 
     // retrieve header & reference dictionary info
     std::string mergedHeader = reader.GetHeaderText();
@@ -101,10 +101,10 @@ int MergeTool::Run(int argc, char* argv[]) {
 
     // store alignments to output file
     BamAlignment bAlignment;
-    while (reader.GetNextAlignment(bAlignment)) {
+    while (reader.GetNextAlignmentCore(bAlignment)) {
         writer.SaveAlignment(bAlignment);
     }
-
+    
     // clean & exit
     reader.Close();
     writer.Close();