本文整理汇总了C++中SamFile::SetReadSequenceTranslation方法的典型用法代码示例。如果您正苦于以下问题:C++ SamFile::SetReadSequenceTranslation方法的具体用法?C++ SamFile::SetReadSequenceTranslation怎么用?C++ SamFile::SetReadSequenceTranslation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SamFile
的用法示例。
在下文中一共展示了SamFile::SetReadSequenceTranslation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
{
std::cerr << "Failed to open " << unpairedOut
<< " so can't convert bam2FastQ.\n";
return(-1);
}
if(myFirstFile == NULL)
{
std::cerr << "Failed to open " << firstOut
<< " so can't convert bam2FastQ.\n";
return(-1);
}
if(mySecondFile == NULL)
{
std::cerr << "Failed to open " << secondOut
<< " so can't convert bam2FastQ.\n";
return(-1);
}
}
if((readName) || (strcmp(mySamHeader.getSortOrder(), "queryname") == 0))
{
readName = true;
}
else
{
// defaulting to coordinate sorted.
samIn.setSortedValidation(SamFile::COORDINATE);
}
// Setup the '=' translation if the reference was specified.
if(!refFile.IsEmpty())
{
GenomeSequence* refPtr = new GenomeSequence(refFile);
samIn.SetReadSequenceTranslation(SamRecord::BASES);
samIn.SetReference(refPtr);
}
SamRecord* recordPtr;
int16_t samFlag;
SamStatus::Status returnStatus = SamStatus::SUCCESS;
while(returnStatus == SamStatus::SUCCESS)
{
recordPtr = myPool.getRecord();
if(recordPtr == NULL)
{
// Failed to allocate a new record.
throw(std::runtime_error("Failed to allocate a new SAM/BAM record"));
}
if(!samIn.ReadRecord(mySamHeader, *recordPtr))
{
// Failed to read a record.
returnStatus = samIn.GetStatus();
continue;
}
// Have a record. Check to see if it is a pair or unpaired read.
samFlag = recordPtr->getFlag();
if(SamFlag::isPaired(samFlag))
{
if(readName)
{
handlePairedRN(*recordPtr);
}
else
{