当前位置: 首页>>代码示例>>C++>>正文


C++ SamFileHeader::getSortOrder方法代码示例

本文整理汇总了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);
}
开发者ID:rtchen,项目名称:gotcloud,代码行数:17,代码来源:SamFile.cpp

示例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.
开发者ID:PapenfussLab,项目名称:assemble_var,代码行数:67,代码来源:Bam2FastQ.cpp


注:本文中的SamFileHeader::getSortOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。