// ---------------------------------------------------------------------------- bool CVcfReader::xProcessDataLine( const string& line, CRef<CSeq_annot> pAnnot, IMessageListener* pEC) // ---------------------------------------------------------------------------- { if ( NStr::StartsWith( line, "#" ) ) { return false; } CVcfData data; if (!xParseData(line, data, pEC)) { return false; } CRef<CSeq_feat> pFeat( new CSeq_feat ); pFeat->SetData().SetVariation().SetData().SetSet().SetType( CVariation_ref::C_Data::C_Set::eData_set_type_package ); pFeat->SetData().SetVariation().SetVariant_prop().SetVersion( 5 ); CSeq_feat::TExt& ext = pFeat->SetExt(); ext.SetType().SetStr( "VcfAttributes" ); if (!xAssignFeatureLocationSet(data, pFeat)) { return false; } if (!xAssignVariationIds(data, pFeat)) { return false; } if (!xAssignVariationAlleleSet(data, pFeat)) { return false; } if (!xProcessScore(data, pFeat)) { return false; } if (!xProcessFilter(data, pFeat)) { return false; } if (!xProcessInfo( data, pFeat, pEC)) { return false; } if (!xProcessFormat(data, pFeat)) { return false; } if ( pFeat->GetExt().GetData().empty() ) { pFeat->ResetExt(); } pAnnot->SetData().SetFtable().push_back( pFeat ); return true; }
// ---------------------------------------------------------------------------- bool CVcfReader::xProcessVariant( const CVcfData& data, unsigned int index, CRef<CSeq_annot> pAnnot) // ---------------------------------------------------------------------------- { CRef<CSeq_feat> pFeat( new CSeq_feat ); pFeat->SetData().SetVariation().SetData().SetSet().SetType( CVariation_ref::C_Data::C_Set::eData_set_type_package ); pFeat->SetData().SetVariation().SetVariant_prop().SetVersion( 5 ); CSeq_feat::TExt& ext = pFeat->SetExt(); ext.SetType().SetStr( "VcfAttributes" ); if ( ! xAssignFeatureLocation( data, index, pFeat ) ) { return false; } if ( ! x_AssignVariationIds( data, pFeat ) ) { return false; } if ( ! xAssignVariationAlleles( data, index, pFeat ) ) { return false; } if ( ! x_ProcessScore( data, pFeat ) ) { return false; } if ( ! x_ProcessFilter( data, pFeat ) ) { return false; } if ( ! x_ProcessInfo( data, pFeat ) ) { return false; } if ( ! x_ProcessFormat( data, pFeat ) ) { return false; } if ( pFeat->GetExt().GetData().empty() ) { pFeat->ResetExt(); } pAnnot->SetData().SetFtable().push_back( pFeat ); return true; }