1 // ***************************************************************************
2 // BamWriter_p.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 24 February 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/BgzfStream_p.h>
31 class BamWriterPrivate {
35 BamWriterPrivate(void);
36 ~BamWriterPrivate(void);
41 bool IsOpen(void) const;
42 bool Open(const std::string& filename,
43 const std::string& samHeaderText,
44 const BamTools::RefVector& referenceSequences);
45 void SaveAlignment(const BamAlignment& al);
46 void SetWriteCompressed(bool ok);
50 unsigned int CalculateMinimumBin(const int begin, int end) const;
51 void CreatePackedCigar(const std::vector<BamTools::CigarOp>& cigarOperations, std::string& packedCigar);
52 void EncodeQuerySequence(const std::string& query, std::string& encodedQuery);
53 void WriteMagicNumber(void);
54 void WriteReferences(const BamTools::RefVector& referenceSequences);
55 void WriteSamHeaderText(const std::string& samHeaderText);
63 } // namespace Internal
64 } // namespace BamTools
66 #endif // BAMWRITER_P_H