Example #1
0
//  ----------------------------------------------------------------------------
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;
}
Example #2
0
//  ----------------------------------------------------------------------------
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;
}
Example #3
0
//  ----------------------------------------------------------------------------
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;
}