]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamWriter.h
Major update to BamTools version 1.0
[bamtools.git] / src / api / BamWriter.h
index 2d8b52810da74764b6e1844d1dced2a93f5dd938..476dbecf271e35ea8db22883055faa69c62babf0 100644 (file)
@@ -3,7 +3,7 @@
 // Marth Lab, Department of Biology, Boston College\r
 // All rights reserved.\r
 // ---------------------------------------------------------------------------\r
-// Last modified: 11 January 2011 (DB)\r
+// Last modified: 4 March 2011 (DB)\r
 // ---------------------------------------------------------------------------\r
 // Provides the basic functionality for producing BAM files\r
 // ***************************************************************************\r
 #define BAMWRITER_H\r
 \r
 #include <api/api_global.h>\r
-#include <api/BamAlignment.h>\r
-#include <api/SamHeader.h>\r
+#include <api/BamAux.h>\r
 #include <string>\r
 \r
 namespace BamTools {\r
 \r
+class BamAlignment;\r
+class SamHeader;\r
+\r
 namespace Internal {\r
     class BamWriterPrivate;\r
 } // namespace Internal\r
 \r
 class API_EXPORT BamWriter {\r
 \r
-    // constructor/destructor\r
+    public: enum CompressionMode { Compressed = 0\r
+                                 , Uncompressed\r
+                                 };\r
+\r
+    // ctor & dtor\r
     public:\r
         BamWriter(void);\r
         ~BamWriter(void);\r
 \r
     // public interface\r
     public:\r
-        // closes the alignment archive\r
+        //  closes the current BAM file\r
         void Close(void);\r
-        // opens the alignment archive (using std::string SAM header)\r
+        // returns true if BAM file is open for writing\r
+        bool IsOpen(void) const;\r
+        // opens a BAM file for writing\r
         bool Open(const std::string& filename, \r
-                  const std::string& samHeader, \r
-                  const BamTools::RefVector& referenceSequences, \r
-                  bool writeUncompressed = false);\r
-        // opens the alignment archive (using SamHeader object)\r
+                  const std::string& samHeaderText,\r
+                  const RefVector& referenceSequences);\r
+        // opens a BAM file for writing\r
         bool Open(const std::string& filename,\r
                   const SamHeader& samHeader,\r
-                  const BamTools::RefVector& referenceSequences,\r
-                  bool writeUncompressed = false);\r
+                  const RefVector& referenceSequences);\r
         // saves the alignment to the alignment archive\r
-        void SaveAlignment(const BamTools::BamAlignment& al);\r
+        void SaveAlignment(const BamAlignment& alignment);\r
+        // sets the output compression mode\r
+        void SetCompressionMode(const CompressionMode& compressionMode);\r
 \r
     // private implementation\r
     private:\r