1 // ***************************************************************************
2 // BamWriter_p.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 25 October 2011 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides the basic functionality for producing BAM files
8 // ***************************************************************************
17 // This file is not part of the BamTools API. It exists purely as an
18 // implementation detail. This header file may change from version to
19 // version without notice, or even be removed.
23 #include "api/BamAux.h"
24 #include "api/internal/io/BgzfStream_p.h"
34 class BamWriterPrivate {
38 BamWriterPrivate(void);
39 ~BamWriterPrivate(void);
44 std::string GetErrorString(void) const;
45 bool IsOpen(void) const;
46 bool Open(const std::string& filename,
47 const std::string& samHeaderText,
48 const BamTools::RefVector& referenceSequences);
49 bool SaveAlignment(const BamAlignment& al);
50 void SetWriteCompressed(bool ok);
54 uint32_t CalculateMinimumBin(const int begin, int end) const;
55 void CreatePackedCigar(const std::vector<BamTools::CigarOp>& cigarOperations, std::string& packedCigar);
56 void EncodeQuerySequence(const std::string& query, std::string& encodedQuery);
57 void WriteAlignment(const BamAlignment& al);
58 void WriteCoreAlignment(const BamAlignment& al);
59 void WriteMagicNumber(void);
60 void WriteReferences(const BamTools::RefVector& referenceSequences);
61 void WriteSamHeaderText(const std::string& samHeaderText);
67 std::string m_errorString;
70 } // namespace Internal
71 } // namespace BamTools
73 #endif // BAMWRITER_P_H