X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FBamWriter.h;h=476dbecf271e35ea8db22883055faa69c62babf0;hb=8c80d760637f8df39262683cd2570f0589423d36;hp=2d8b52810da74764b6e1844d1dced2a93f5dd938;hpb=577b6032aa3d85616047c8aba6061dd8dad20cfc;p=bamtools.git diff --git a/src/api/BamWriter.h b/src/api/BamWriter.h index 2d8b528..476dbec 100644 --- a/src/api/BamWriter.h +++ b/src/api/BamWriter.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 11 January 2011 (DB) +// Last modified: 4 March 2011 (DB) // --------------------------------------------------------------------------- // Provides the basic functionality for producing BAM files // *************************************************************************** @@ -12,39 +12,47 @@ #define BAMWRITER_H #include -#include -#include +#include #include namespace BamTools { +class BamAlignment; +class SamHeader; + namespace Internal { class BamWriterPrivate; } // namespace Internal class API_EXPORT BamWriter { - // constructor/destructor + public: enum CompressionMode { Compressed = 0 + , Uncompressed + }; + + // ctor & dtor public: BamWriter(void); ~BamWriter(void); // public interface public: - // closes the alignment archive + // closes the current BAM file void Close(void); - // opens the alignment archive (using std::string SAM header) + // returns true if BAM file is open for writing + bool IsOpen(void) const; + // opens a BAM file for writing bool Open(const std::string& filename, - const std::string& samHeader, - const BamTools::RefVector& referenceSequences, - bool writeUncompressed = false); - // opens the alignment archive (using SamHeader object) + const std::string& samHeaderText, + const RefVector& referenceSequences); + // opens a BAM file for writing bool Open(const std::string& filename, const SamHeader& samHeader, - const BamTools::RefVector& referenceSequences, - bool writeUncompressed = false); + const RefVector& referenceSequences); // saves the alignment to the alignment archive - void SaveAlignment(const BamTools::BamAlignment& al); + void SaveAlignment(const BamAlignment& alignment); + // sets the output compression mode + void SetCompressionMode(const CompressionMode& compressionMode); // private implementation private: