// ***************************************************************************\r
// BamWriter.h (c) 2009 Michael Str�mberg, Derek Barnett\r
// Marth Lab, Department of Biology, Boston College\r
-// All rights reserved.\r
// ---------------------------------------------------------------------------\r
-// Last modified: 19 November 2010 (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/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\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
+ 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 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