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);
57 printf(
"\nPileup<PileupElement> on entire file: %s\n", fileName);
61 printf(
"\nPileup<PileupElementBaseQual> on a section of file: %s\n", fileName);
88 const char* refName =
"1";
113 printf(
"\nPileup<PileupElementBaseQual> on entire file, newAnalyze: %s\n", fileName);
120 printf(
"\nPileup<PileupElementBaseQual> on entire file, newAnalyze: %s\n", fileName);
123 myAnalyzeClass.myCounter = 2;
bool ReadHeader(SamFileHeader &header)
Reads the header section from the file and stores it in the passed in header.
This class inherits from the base class and stores base and qualities.
bool SetReadSection(int32_t refID)
Sets which reference id (index into the BAM list of reference information) of the BAM file should be ...
virtual void analyze()
Perform the analysis associated with this class.
NO_MORE_RECS: failed to read a record since there are no more to read either in the file or section i...
void flushPileup()
Done processing, flush every position that is currently being stored in the pileup.
Allows the user to easily read/write a SAM/BAM file.
SamStatus::Status GetStatus()
Get the Status of the last call that sets status.
virtual void processAlignment(SamRecord &record)
Add an alignment to the pileup.
const char * GetStatusMessage()
Get the Status Message of the last call that sets status.
bool ReadRecord(SamFileHeader &header, SamRecord &record)
Reads the next record from the file & stores it in the passed in record.
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...
virtual int processFile(const std::string &fileName, uint16_t excludeFlag=0x0704, uint16_t includeFlag=0)
Performs a pileup on the specified file.
bool ReadBamIndex(const char *filename)
Read the specified bam index file.
Class to perform a pileup of all reads by position, assuming the reads are coordinate sorted...