19 #include "PileupElementBaseQual.h"
24 std::cout <<
"newAnalyze: ";
38 std::cout <<
"Class Analyze: Counter = " << myCounter <<
": ";
48 int main(
int argc,
char ** argv)
50 const char* fileName =
"../../test/testFiles/sortedBam.bam";
51 const char* indexName =
"../../test/testFiles/sortedBam.bam.bai";
53 printf(
"\nPileup<PileupElementBaseQual> on entire file: %s\n", fileName);
55 pileup.processFile(fileName);
57 printf(
"\nPileup<PileupElement> on entire file: %s\n", fileName);
59 pileup1.processFile(fileName);
61 printf(
"\nPileup<PileupElementBaseQual> on a section of file: %s\n", fileName);
88 const char* refName =
"1";
100 pileup2.processAlignment(record);
103 pileup2.flushPileup();
113 printf(
"\nPileup<PileupElementBaseQual> on entire file, newAnalyze: %s\n", fileName);
118 pileup3.processFile(fileName);
120 printf(
"\nPileup<PileupElementBaseQual> on entire file, newAnalyze: %s\n", fileName);
123 myAnalyzeClass.myCounter = 2;
125 pileup4.processFile(fileName);
This class inherits from the base class and stores base and qualities.
const char * GetStatusMessage()
Get the Status Message of the last call that sets status.
@ 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...
SamStatus::Status GetStatus()
Get the Status of the last call that sets status.
virtual void analyze()
Perform the analysis associated with this class.
bool ReadRecord(SamFileHeader &header, SamRecord &record)
Reads the next record from the file & stores it in the passed in record.
bool ReadBamIndex(const char *filename)
Read the specified bam index file.
bool SetReadSection(int32_t refID)
Sets which reference id (index into the BAM list of reference information) of the BAM file should be ...
Class providing an easy to use interface to get/set/operate on the fields in a SAM/BAM record.
bool OpenForRead(const char *filename, SamFileHeader *header=NULL)
Open a sam/bam file for reading with the specified filename, determing the type of file and SAM/BAM b...
bool ReadHeader(SamFileHeader &header)
Reads the header section from the file and stores it in the passed in header.
Allows the user to easily read/write a SAM/BAM file.
Class to perform a pileup of all reads by position, assuming the reads are coordinate sorted.