X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FBamWriter.h;h=476dbecf271e35ea8db22883055faa69c62babf0;hb=8c80d760637f8df39262683cd2570f0589423d36;hp=55f86f4f29f13b0415604b7f1c785d525239c487;hpb=81ffcac10d28190c191243226e3841d13746f89e;p=bamtools.git diff --git a/src/api/BamWriter.h b/src/api/BamWriter.h index 55f86f4..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: 19 November 2010 (DB) +// Last modified: 4 March 2011 (DB) // --------------------------------------------------------------------------- // Provides the basic functionality for producing BAM files // *************************************************************************** @@ -12,33 +12,47 @@ #define BAMWRITER_H #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 + // 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); + const std::string& samHeaderText, + const RefVector& referenceSequences); + // opens a BAM file for writing + bool Open(const std::string& filename, + const SamHeader& samHeader, + 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: