Example #1
0
//  ----------------------------------------------------------------------------                
CRef< CSeq_annot >
CVcfReader::ReadSeqAnnot(
    ILineReader& lr,
    IErrorContainer* pErrorContainer ) 
//  ----------------------------------------------------------------------------                
{
    CRef< CSeq_annot > annot( new CSeq_annot );
    CRef< CAnnot_descr > desc( new CAnnot_descr );
    annot->SetDesc( *desc );
    annot->SetData().SetFtable();
    m_Meta.Reset( new CAnnotdesc );
    m_Meta->SetUser().SetType().SetStr( "vcf-meta-info" );

    while ( ! lr.AtEOF() ) {
        string line = *(++lr);
        NStr::TruncateSpacesInPlace( line );
        if ( x_ProcessMetaLine( line, annot ) ) {
            continue;
        }
        if ( x_ProcessHeaderLine( line, annot ) ) {
            continue;
        }
        if ( xProcessDataLine( line, annot ) ) {
            continue;
        }
        // still here? not good!
        cerr << "Unexpected line: " << line << endl;
    }
    return annot;
}
Example #2
0
//  ----------------------------------------------------------------------------                
CRef< CSeq_annot >
CVcfReader::ReadSeqAnnot(
    ILineReader& lr,
    IMessageListener* pEC ) 
//  ----------------------------------------------------------------------------                
{
    CRef< CSeq_annot > annot( new CSeq_annot );
    CRef< CAnnot_descr > desc( new CAnnot_descr );
    annot->SetDesc( *desc );
    annot->SetData().SetFtable();
    m_Meta.Reset( new CAnnotdesc );
    m_Meta->SetUser().SetType().SetStr( "vcf-meta-info" );

    while ( ! lr.AtEOF() ) {
        m_uLineNumber++;
        string line = *(++lr);
        NStr::TruncateSpacesInPlace( line );
        if (xProcessMetaLine(line, annot, pEC)) {
            continue;
        }
        if (xProcessHeaderLine(line, annot)) {
            continue;
        }
        if (xProcessDataLine(line, annot, pEC)) {
            continue;
        }
        // still here? not good!
        AutoPtr<CObjReaderLineException> pErr(
            CObjReaderLineException::Create(
            eDiag_Warning,
            0,
            "CVcfReader::ReadSeqAnnot: Unrecognized line or record type.",
            ILineError::eProblem_GeneralParsingError) );
        ProcessWarning(*pErr, pEC);
    }
    return annot;
}