1 // ***************************************************************************
2 // bamtools_pileup_engine.h (c) 2010 Derek Barnett, Erik Garrison
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 18 September 2010
7 // ---------------------------------------------------------------------------
8 // Provides pileup at position functionality for various tools.
9 // ***************************************************************************
11 #ifndef BAMTOOLS_PILEUP_ENGINE_H
12 #define BAMTOOLS_PILEUP_ENGINE_H
15 #include "BamAlignment.h"
19 // contains auxiliary data about a single BamAlignment
20 // at current position considered
21 struct PileupAlignment {
24 BamAlignment Alignment;
25 int32_t PositionInAlignment;
26 bool IsCurrentDeletion;
35 PileupAlignment(const BamAlignment& al)
37 , PositionInAlignment(-1)
38 , IsCurrentDeletion(false)
39 , IsNextDeletion(false)
40 , IsNextInsertion(false)
43 , IsSegmentBegin(false)
48 // contains all data at a position
49 struct PileupPosition {
54 std::vector<PileupAlignment> PileupAlignments;
57 PileupPosition(const int& refId = 0,
58 const int& position = 0,
59 const std::vector<PileupAlignment>& alignments = std::vector<PileupAlignment>())
62 , PileupAlignments(alignments)
69 PileupVisitor(void) { }
70 virtual ~PileupVisitor(void) { }
73 virtual void Visit(const PileupPosition& pileupData) =0;
83 bool AddAlignment(const BamAlignment& al);
84 void AddVisitor(PileupVisitor* visitor);
88 struct PileupEnginePrivate;
89 PileupEnginePrivate* d;
92 } // namespace BamTools
94 #endif // BAMTOOLS_PILEUP_ENGINE_H