本文整理汇总了C++中CSeq_feat::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ CSeq_feat::GetId方法的具体用法?C++ CSeq_feat::GetId怎么用?C++ CSeq_feat::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSeq_feat
的用法示例。
在下文中一共展示了CSeq_feat::GetId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignAttributesCore
// ----------------------------------------------------------------------------
bool CGffRecord::AssignAttributesCore(
const CSeq_annot& annot,
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strAttributes = "";
// If feature ids are present then they are likely used to show parent/child
// relationships, via corresponding xrefs. Thus, any feature ids override
// gb ID tags (feature ids and ID tags should agree in the first place, but
// if not, feature ids must trump ID tags).
//
bool bIdAssigned = false;
if ( feature.CanGetId() ) {
const CSeq_feat::TId& id = feature.GetId();
string value = CGffRecord::FeatIdString( id );
AddAttribute( "ID", value );
bIdAssigned = true;
}
if ( feature.CanGetXref() ) {
const CSeq_feat::TXref& xref = feature.GetXref();
string value;
for ( size_t i=0; i < xref.size(); ++i ) {
// const CSeqFeatXref& ref = *xref[i];
if ( xref[i]->CanGetId() && xref[i]->CanGetData() ) {
const CSeqFeatXref::TId& id = xref[i]->GetId();
CSeq_feat::TData::ESubtype other_type = GetSubtypeOf( annot, id );
if ( ! IsParentOf( other_type, feature.GetData().GetSubtype() ) ) {
continue;
}
if ( ! value.empty() ) {
value += ",";
}
value += CGffRecord::FeatIdString( id );
}
}
if ( ! value.empty() ) {
AddAttribute( "Parent", value );
}
}
if ( feature.CanGetQual() ) {
const vector< CRef< CGb_qual > >& quals = feature.GetQual();
vector< CRef< CGb_qual > >::const_iterator it = quals.begin();
while ( it != quals.end() ) {
if ( (*it)->CanGetQual() && (*it)->CanGetVal() ) {
if ( (*it)->GetQual() == "ID" ) {
if ( ! bIdAssigned ) {
AddAttribute( "ID", (*it)->GetVal() );
}
}
if ( (*it)->GetQual() == "Name" ) {
AddAttribute( "Name", (*it)->GetVal() );
}
if ( (*it)->GetQual() == "Var_type" ) {
AddAttribute( "Var_type", (*it)->GetVal() );
}
}
++it;
}
}
return true;
}