]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamWriter.cpp
Update to BamTools API 0.9.2 with exposure of SamHeader object from BamReader and...
[bamtools.git] / src / api / BamWriter.cpp
index e92d0714443744e7855d12a432ba582cf3b174b8..386755d09256aebeb0e1298a7bb222ef4a103253 100644 (file)
@@ -3,7 +3,7 @@
 // Marth Lab, Department of Biology, Boston College\r
 // All rights reserved.\r
 // ---------------------------------------------------------------------------\r
-// Last modified: 22 November 2010 (DB)\r
+// Last modified: 11 January 2011 (DB)\r
 // ---------------------------------------------------------------------------\r
 // Provides the basic functionality for producing BAM files\r
 // ***************************************************************************\r
@@ -32,7 +32,7 @@ void BamWriter::Close(void) {
     d->Close();\r
 }\r
 \r
-// opens the alignment archive\r
+// opens the alignment archive (using std::string SAM header)\r
 bool BamWriter::Open(const string& filename,\r
                      const string& samHeader,\r
                      const RefVector& referenceSequences,\r
@@ -41,6 +41,15 @@ bool BamWriter::Open(const string& filename,
     return d->Open(filename, samHeader, referenceSequences, isWriteUncompressed);\r
 }\r
 \r
+// opens the alignment archive (using SamHeader object)\r
+bool BamWriter::Open(const string& filename,\r
+                     const SamHeader& samHeader,\r
+                     const RefVector& referenceSequences,\r
+                     bool isWriteUncompressed)\r
+{\r
+    return d->Open(filename, samHeader.ToString(), referenceSequences, isWriteUncompressed);\r
+}\r
+\r
 // saves the alignment to the alignment archive\r
 void BamWriter::SaveAlignment(const BamAlignment& al) {\r
     d->SaveAlignment(al);\r