本文整理汇总了C++中CSeq_feat::GetQual方法的典型用法代码示例。如果您正苦于以下问题:C++ CSeq_feat::GetQual方法的具体用法?C++ CSeq_feat::GetQual怎么用?C++ CSeq_feat::GetQual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSeq_feat
的用法示例。
在下文中一共展示了CSeq_feat::GetQual方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xMapRna
// ----------------------------------------------------------------------------
bool CSoMap::xMapRna(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
static const map<CSeqFeatData::ESubtype, string> mapSubtypeStraight = {
{CSeqFeatData::eSubtype_misc_RNA, "transcript"},
{CSeqFeatData::eSubtype_rRNA, "rRNA"},
{CSeqFeatData::eSubtype_tRNA, "tRNA"},
};
static const map<CSeqFeatData::ESubtype, string> mapSubtypePseudo = {
{CSeqFeatData::eSubtype_misc_RNA, "pseudogenic_transcript"},
{CSeqFeatData::eSubtype_rRNA, "pseudogenic_rRNA"},
{CSeqFeatData::eSubtype_tRNA, "pseudogenic_tRNA"},
};
auto subtype = feature.GetData().GetSubtype();
if (feature.IsSetPseudo() && feature.GetPseudo()) {
auto cit = mapSubtypePseudo.find(subtype);
if (cit == mapSubtypePseudo.end()) {
return false;
}
so_type = cit->second;
return true;
}
if (feature.IsSetPseudo() && !feature.GetPseudo()) {
auto cit = mapSubtypeStraight.find(subtype);
if (cit == mapSubtypeStraight.end()) {
return false;
}
so_type = cit->second;
return true;
}
for (auto qual: feature.GetQual()) {
if (qual->GetQual() == "pseudo" || qual->GetQual() == "pseudogene") {
auto cit = mapSubtypePseudo.find(subtype);
if (cit == mapSubtypePseudo.end()) {
return false;
}
so_type = cit->second;
return true;
}
}
auto cit = mapSubtypeStraight.find(subtype);
if (cit == mapSubtypeStraight.end()) {
return false;
}
so_type = cit->second;
return true;
}
示例2: AssignType
// ----------------------------------------------------------------------------
bool CGffRecord::AssignType(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strType = "region";
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() == "standard_name" ) {
m_strType = (*it)->GetVal();
return true;
}
}
++it;
}
}
if ( ! feature.CanGetData() ) {
return true;
}
switch ( feature.GetData().GetSubtype() ) {
default:
m_strType = feature.GetData().GetKey();
break;
case CSeq_feat::TData::eSubtype_gene:
m_strType = "gene";
break;
case CSeq_feat::TData::eSubtype_cdregion:
m_strType = "CDS";
break;
case CSeq_feat::TData::eSubtype_mRNA:
m_strType = "mRNA";
break;
case CSeq_feat::TData::eSubtype_scRNA:
m_strType = "scRNA";
break;
case CSeq_feat::TData::eSubtype_exon:
m_strType = "exon";
break;
}
return true;
}
示例3: xMapGene
// ----------------------------------------------------------------------------
bool CSoMap::xMapGene(
const CSeq_feat& feature,
string& so_type)
// ----------------------------------------------------------------------------
{
if (feature.IsSetPseudo() && feature.GetPseudo()) {
so_type = "pseudogene";
return true;
}
for (auto qual: feature.GetQual()) {
if (qual->GetQual() == "pseudo" || qual->GetQual() == "pseudogene") {
so_type = "pseudogene";
return true;
}
}
so_type = "gene";
return true;
}
示例4: AssignScore
// ----------------------------------------------------------------------------
bool CGffRecord::AssignScore(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strScore = ".";
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() == "score" ) {
m_strScore = (*it)->GetVal();
return true;
}
}
++it;
}
}
return true;
}
示例5: 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;
}