Class to perform a pileup of all reads by position, assuming the reads are coordinate sorted.
More...
|
| | Pileup (const FUNC_CLASS &fp=FUNC_CLASS()) |
| | Constructor using the default maximum number of bases a read spans.
|
| | Pileup (int window, const FUNC_CLASS &fp=FUNC_CLASS()) |
| | Constructor that sets the maximum number of bases a read spans.
|
| | Pileup (const std::string &refSeqFileName, const FUNC_CLASS &fp=FUNC_CLASS()) |
| | Perform pileup with a reference.
|
| | Pileup (int window, const std::string &refSeqFileName, const FUNC_CLASS &fp=FUNC_CLASS()) |
| | Perform pileup with a reference and a specified window size.
|
| virtual | ~Pileup () |
| | Destructor.
|
| virtual int | processFile (const std::string &fileName, uint16_t excludeFlag=0x0704, uint16_t includeFlag=0) |
| | Performs a pileup on the specified file.
|
| virtual void | processAlignment (SamRecord &record) |
| | Add an alignment to the pileup.
|
| virtual void | processAlignmentRegion (SamRecord &record, int startPos, int endPos, PosList *excludeList=NULL) |
| | Add only positions that fall within the specified region of the alignment to the pileup and outside of the specified excluded positions.
|
| void | flushPileup () |
| | Done processing, flush every position that is currently being stored in the pileup.
|
template<class PILEUP_TYPE, class FUNC_CLASS = defaultPileup<PILEUP_TYPE>>
class Pileup< PILEUP_TYPE, FUNC_CLASS >
Class to perform a pileup of all reads by position, assuming the reads are coordinate sorted.
Definition at line 58 of file Pileup.h.
template<class PILEUP_TYPE, class FUNC_CLASS>
| Pileup< PILEUP_TYPE, FUNC_CLASS >::Pileup |
( |
int | window, |
|
|
const FUNC_CLASS & | fp = FUNC_CLASS() ) |
Constructor that sets the maximum number of bases a read spans.
This is the "window" the length of the buffer that holds the pileups for each position until the read start has moved past the position.
Definition at line 168 of file Pileup.h.
169 : myAnalyzeFuncPtr(
fp),
170 myElements(),
171 pileupStart(0),
172 pileupHead(0),
173 pileupTail(-1),
175 myCurrentRefID(-2),
177{
178
179 myElements.resize(
window);
180}
template<class PILEUP_TYPE, class FUNC_CLASS>
| void Pileup< PILEUP_TYPE, FUNC_CLASS >::flushPileup |
( |
| ) |
|
template<class PILEUP_TYPE, class FUNC_CLASS>
| void Pileup< PILEUP_TYPE, FUNC_CLASS >::processAlignmentRegion |
( |
SamRecord & | record, |
|
|
int | startPos, |
|
|
int | endPos, |
|
|
PosList * | excludeList = NULL ) |
|
virtual |
Add only positions that fall within the specified region of the alignment to the pileup and outside of the specified excluded positions.
- Parameters
-
| record | alignment to be added to the pileup. |
| startPos | 0-based start position of the bases that should be added to the pileup. |
| endPos | 0-based end position of the bases that should be added to the pileup (this position is not added). Set to -1 if there is no end position to the region. |
| excludeList | list of refID/positions to exclude from processing. |
Definition at line 316 of file Pileup.h.
320{
323
324
325
327
328
329
331 {
333 }
334
335
336
337
339 {
340
341
342
344 {
345 break;
346 }
347
348
351 {
352
354 {
355
357 }
358 }
360 {
362 }
363 }
364}
References flushPileup(), SamRecord::get0BasedAlignmentEnd(), SamRecord::get0BasedPosition(), SamRecord::getReferenceID(), and PosList::hasPosition().
template<class PILEUP_TYPE, class FUNC_CLASS>
| int Pileup< PILEUP_TYPE, FUNC_CLASS >::processFile |
( |
const std::string & | fileName, |
|
|
uint16_t | excludeFlag = 0x0704, |
|
|
uint16_t | includeFlag = 0 ) |
|
virtual |
Performs a pileup on the specified file.
- Parameters
-
| excludeFlag | if specified, if any bit set in the exclude flag is set in the record's flag, it will be dropped. Defaulted to exclude:
- unmapped,
- not primary alignment
- failed platform/vendor quality check
- PCR or optical duplicate
|
| includeFlag | if specified, every bit must be set in the record's flag for it to be included - defaulted to 0, no bits are required to be set. |
- Returns
- 0 for success and non-zero for failure.
Definition at line 235 of file Pileup.h.
238{
242
244 {
245 samIn.SetReference(myRefPtr);
246 }
247
249 {
251 return(
samIn.GetStatus());
252 }
253
255 {
257 return(
samIn.GetStatus());
258 }
259
260
262
263
265 {
268 {
269
270
271 continue;
272 }
274 {
275
276
277 continue;
278 }
280 }
281
283
286 {
287
290 }
292}
virtual void processAlignment(SamRecord &record)
Add an alignment to the pileup.
@ NO_MORE_RECS
NO_MORE_RECS: failed to read a record since there are no more to read either in the file or section i...
References SamFile::COORDINATE, flushPileup(), SamRecord::getFlag(), SamFile::GetStatus(), SamFile::GetStatusMessage(), StatGenStatus::NO_MORE_RECS, SamFile::OpenForRead(), processAlignment(), SamFile::ReadHeader(), SamFile::ReadRecord(), SamFile::SetReference(), and SamFile::setSortedValidation().