本文整理汇总了C++中CSeq_feat::CanGetLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ CSeq_feat::CanGetLocation方法的具体用法?C++ CSeq_feat::CanGetLocation怎么用?C++ CSeq_feat::CanGetLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSeq_feat
的用法示例。
在下文中一共展示了CSeq_feat::CanGetLocation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AssignStop
// ----------------------------------------------------------------------------
bool CGffRecord::AssignStop(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
if ( feature.CanGetLocation() ) {
const CSeq_loc& location = feature.GetLocation();
unsigned int uEnd = location.GetStop( eExtreme_Positional ) + 1;
m_strEnd = NStr::UIntToString( uEnd );
}
return true;
}
示例2: AssignSeqId
// ----------------------------------------------------------------------------
bool CGffRecord::AssignSeqId(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strSeqId = "<unknown>";
if ( feature.CanGetLocation() ) {
const CSeq_loc& location = feature.GetLocation();
const CSeq_id* pId = location.GetId();
switch ( pId->Which() ) {
case CSeq_id::e_Local:
if ( pId->GetLocal().IsId() ) {
m_strSeqId = NStr::UIntToString( pId->GetLocal().GetId() );
}
else {
m_strSeqId = pId->GetLocal().GetStr();
}
break;
case CSeq_id::e_Gi:
m_strSeqId = NStr::IntToString( pId->GetGi() );
break;
case CSeq_id::e_Other:
if ( pId->GetOther().CanGetAccession() ) {
m_strSeqId = pId->GetOther().GetAccession();
if ( pId->GetOther().CanGetVersion() ) {
m_strSeqId += ".";
m_strSeqId += NStr::UIntToString(
pId->GetOther().GetVersion() );
}
}
break;
default:
break;
}
}
return true;
}
示例3: AssignStrand
// ----------------------------------------------------------------------------
bool CGffRecord::AssignStrand(
const CSeq_feat& feature )
// ----------------------------------------------------------------------------
{
m_strStrand = ".";
if ( feature.CanGetLocation() ) {
const CSeq_loc& location = feature.GetLocation();
ENa_strand strand = location.GetStrand();
switch( strand ) {
default:
break;
case eNa_strand_plus:
m_strStrand = "+";
break;
case eNa_strand_minus:
m_strStrand = "-";
break;
}
}
return true;
}