本文整理汇总了C++中SamFileHeader::getSortOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ SamFileHeader::getSortOrder方法的具体用法?C++ SamFileHeader::getSortOrder怎么用?C++ SamFileHeader::getSortOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SamFileHeader
的用法示例。
在下文中一共展示了SamFileHeader::getSortOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSortOrderFromHeader
SamFile::SortedType SamFile::getSortOrderFromHeader(SamFileHeader& header)
{
const char* tag = header.getSortOrder();
// Default to unsorted since if it is not specified in the header
// that is the value that should be used.
SortedType headerSortOrder = UNSORTED;
if(strcmp(tag, "queryname") == 0)
{
headerSortOrder = QUERY_NAME;
}
else if(strcmp(tag, "coordinate") == 0)
{
headerSortOrder = COORDINATE;
}
return(headerSortOrder);
}
示例2: if
//.........这里部分代码省略.........
// If it is interleaved or the 2nd file is not a new name, set it appropriately.
if(interleave || secondOut == firstOut)
{
mySecondFile = myFirstFile;
}
else if(secondOut == unpairedOut)
{
mySecondFile = myUnpairedFile;
}
else
{
mySecondFile = ifopen(secondOut, "w");
}
if(myUnpairedFile == NULL)
{
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(samHeader.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(samHeader, *recordPtr))
{
// Failed to read a record.