Loading...
Searching...
No Matches
ShiftIndelsTest Class Reference

## Static Public Member Functions

static void | testShift (const char *input, const char *output)

## Detailed Description

Definition at line 20 of file ShiftIndels.h.

## Member Function Documentation

## testShift()

void ShiftIndelsTest::testShift | ( | const char * | input,
|  | const char * | output )

static

Definition at line 31 of file ShiftIndels.cpp.

{
SamFile inSam, outSam;
assert(inSam.OpenForRead(input));
assert(outSam.OpenForWrite(output));
// Read the SAM Header.
SamFileHeader samHeader;
assert(inSam.ReadHeader(samHeader));
assert(outSam.WriteHeader(samHeader));
SamRecord samRecord;
int readNum = 1;
bool shiftResult = true;
while(inSam.ReadRecord(samHeader, samRecord))
{
if((readNum == 3)|| (readNum == 5))
{
shiftResult = false;
}
else
{
shiftResult = true;
}
++readNum;
assert(samRecord.shiftIndelsLeft() == shiftResult);
assert(outSam.WriteRecord(samHeader, samRecord));
}
}
SamFile::ReadHeader
bool ReadHeader(SamFileHeader &header)
Reads the header section from the file and stores it in the passed in header.
Definition SamFile.cpp:450
SamFile::ReadRecord
bool ReadRecord(SamFileHeader &header, SamRecord &record)
Reads the next record from the file & stores it in the passed in record.
Definition SamFile.cpp:514
SamFile::OpenForRead
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...
Definition SamFile.cpp:93
SamFile::OpenForWrite
bool OpenForWrite(const char *filename, SamFileHeader *header=NULL)
Open a sam/bam file for writing with the specified filename, determining SAM/BAM from the extension (...
Definition SamFile.cpp:223
SamFile::WriteHeader
bool WriteHeader(SamFileHeader &header)
Writes the specified header into the file.
Definition SamFile.cpp:480
SamFile::WriteRecord
bool WriteRecord(SamFileHeader &header, SamRecord &record)
Writes the specified record into the file.
Definition SamFile.cpp:632
SamRecord::shiftIndelsLeft
bool shiftIndelsLeft()
Shift the indels (if any) to the left by updating the CIGAR.
Definition SamRecord.cpp:368

The documentation for this class was generated from the following files:

- bam/test/ShiftIndels.h
- bam/test/ShiftIndels.cpp