Ejemplo n.º 1
0
/*!
  Returns a list with the names of all properties for this class.

  If \a super is TRUE, inherited properties are included.

  \sa property()
 */
QStrList QMetaObject::propertyNames( bool super ) const
{
    QStrList l( FALSE );

    if ( superclass && super ) {
	QStrList sl = superclass->propertyNames( super );
	for ( QStrListIterator slit( sl ); slit.current(); ++slit )
	    l.append( slit.current() );
    }

    for( int i = 0; i < d->numPropData; ++i ) {
	if ( d->propData[i].isValid() )
	    l.append( d->propData[i].name() );
    }

    return l;
}
Ejemplo n.º 2
0
/*!\internal

 */
QStrList QMetaObject::enumeratorNames( bool super ) const
{
    QStrList l( FALSE );

    if ( superclass && super ) {
	QStrList sl = superclass->enumeratorNames( super );
	for ( QStrListIterator slit( sl ); slit.current(); ++slit )
	    l.append( slit.current() );
    }

    for( int i = 0; i < d->numEnumData; ++i ) {
	if ( d->enumData[i].items )
	    l.append( d->enumData[i].name );
    }

    return l;
}
Ejemplo n.º 3
0
//trims exons around internal alignment gaps to complete codons
//if CDS can be retrieved from bioseq
void CSplignTrim::TrimHolesToCodons(TSegs& segments, CBioseq_Handle& mrna_bio_handle, bool mrna_strand, size_t mrna_len)
{

    if( mrna_bio_handle ) {
        //collect CDS intervals (could be more than one in a case of ribosomal slippage)
        vector<TSeqRange> tr;
        for(CFeat_CI ci(mrna_bio_handle, SAnnotSelector(CSeqFeatData::e_Cdregion)); ci; ++ci) {
            for(CSeq_loc_CI slit(ci->GetLocation()); slit; ++slit) {
                TSeqRange r, ori;
                ori = slit.GetRange();
                if( mrna_strand ) {
                    r = ori;
                } else {//reverse
                    r.SetFrom(mrna_len - ori.GetTo() - 1);
                    r.SetTo(mrna_len - ori.GetFrom() - 1);
                }
                tr.push_back(r);
            }
        }

        if(tr.empty()) return;// CDS not found

        //trim
        AdjustGaps(segments);//make sure there is no adjacent gaps
        size_t pos1 = 0, pos2 = 2;
        for(; pos2 < segments.size(); ++pos1, ++pos2) {
            if( segments[pos1].m_exon && !segments[pos1+1].m_exon && segments[pos2].m_exon ) {//candidate for trimming
                
                //trim left exon    
                TSeqPos p1 = segments[pos1].m_box[1];
                ITERATE(vector<TSeqRange>, it, tr) {
                    if( p1 >= it->GetFrom() && p1 <= it->GetTo() ) {
                        TSeqPos cut_mrna_len = (p1 + 1 - it->GetFrom()) % 3, cnt = 0;
                        string transcript = segments[pos1].m_details;
                        int i = (int)transcript.size() - 1;
                        for(; i>=0; --i) {
                            if( cnt%3 == cut_mrna_len &&  transcript[i] == 'M' ) { //cut point  
                                CutFromRight(transcript.size() - i - 1, segments[pos1]);
                                break;
                            }
                            if( transcript[i] != 'I' ) ++cnt;
                        }
                        if( i < 0 ) {// exon should not be so bad   
                            NCBI_THROW(CAlgoAlignException, eInternal, g_msg_InvalidRange);
                        }
                        break;
                    }
                }
                
                //trim right exon   
                TSeqPos p2 =  segments[pos2].m_box[0];
                ITERATE(vector<TSeqRange>, it, tr) {
                    if( p2 >= it->GetFrom() && p2 <= it->GetTo() ) {
                        TSeqPos cut_mrna_len = ( 3 - ( p2 - it->GetFrom()) % 3  ) %3, cnt = 0;
                        string transcript = segments[pos2].m_details;
                        int i = 0;
                        for( ; i < (int)transcript.size(); ++i) {
                            if( cnt%3 == cut_mrna_len && transcript[i] == 'M' ) { //cut point   
                                CutFromLeft(i, segments[pos2]);
                                break;
                            }
                            if( transcript[i] != 'I' ) ++cnt;
                        }
                        if( i == (int)transcript.size() ) {// exon should not be so bad 
                            NCBI_THROW(CAlgoAlignException, eInternal, g_msg_InvalidRange);
                        }
                        break;
                    }
                }
            }
        }
        AdjustGaps(segments);
    }