I tried to retrieve unmapped reads via setting SetReadSection("*",-1,-1) or SetReadSection("",-1,-1), but failed in both ways. I wonder if I used it in a wrong way.
I also tested it using bam file only contains unmapped reads, which results in failure at SamRecord.cpp:625 line
if(ifread(filePtr, &(myRecordPtr->myReferenceID), myRecordPtr->myBlockSize) != (unsigned int)myRecordPtr->myBlockSize)
{
// Error reading the record. Reset it and return failure.
resetRecord();
std::string statusMsg = "Failed to read the record, ";
statusMsg += filePtr->getFileName();
statusMsg += ".";
myStatus.setStatus(SamStatus::FAIL_IO, statusMsg.c_str());
return(SamStatus::FAIL_IO);
}
The snapshot in GDB:
(gdb) p myRecordPtr->myBlockSize $13 = 21840194
Anybody experienced this problem before?