1 // ***************************************************************************
\r
2 // BamWriter.h (c) 2009 Michael Str�mberg, Derek Barnett
\r
3 // Marth Lab, Department of Biology, Boston College
\r
4 // ---------------------------------------------------------------------------
\r
5 // Last modified: 5 October 2011 (DB)
\r
6 // ---------------------------------------------------------------------------
\r
7 // Provides the basic functionality for producing BAM files
\r
8 // ***************************************************************************
\r
13 #include <api/api_global.h>
\r
14 #include <api/BamAux.h>
\r
17 namespace BamTools {
\r
22 namespace Internal {
\r
23 class BamWriterPrivate;
\r
24 } // namespace Internal
\r
26 class API_EXPORT BamWriter {
\r
30 enum CompressionMode { Compressed = 0
\r
41 // closes the current BAM file
\r
43 // returns a human-readable description of the last error that occurred
\r
44 std::string GetErrorString(void) const;
\r
45 // returns true if BAM file is open for writing
\r
46 bool IsOpen(void) const;
\r
47 // opens a BAM file for writing
\r
48 bool Open(const std::string& filename,
\r
49 const std::string& samHeaderText,
\r
50 const RefVector& referenceSequences);
\r
51 // opens a BAM file for writing
\r
52 bool Open(const std::string& filename,
\r
53 const SamHeader& samHeader,
\r
54 const RefVector& referenceSequences);
\r
55 // saves the alignment to the alignment archive
\r
56 bool SaveAlignment(const BamAlignment& alignment);
\r
57 // sets the output compression mode
\r
58 void SetCompressionMode(const BamWriter::CompressionMode& compressionMode);
\r
60 // private implementation
\r
62 Internal::BamWriterPrivate* d;
\r
65 } // namespace BamTools
\r
67 #endif // BAMWRITER_H
\r