void CBitmaskBuilder::SequenceBuffer( CSeqBuffer * ncbi8na ) { CProgressIndicator progress( "Listing "+NStr::IntToString( m_wSize )+"-mers of length "+NStr::IntToString( m_wLength )+" for "+m_seqId ); fourplanes::CHashGenerator hgen( m_wLength ); for( const char * seq = ncbi8na->GetBeginPtr(); seq < ncbi8na->GetEndPtr(); ++seq ) { hgen.AddBaseMask( CNcbi8naBase( seq ) ); // cerr << CIupacnaBase( CNcbi8naBase( seq ) ) << "\t"; if( hgen.GetAmbiguityCount() <= (int)m_maxAmb ) { for( fourplanes::CHashIterator h( hgen ); h; ++h ) { Uint8 packed = CBitHacks::PackWord( Uint8(*h), m_pattern2na ); // cerr << hex << DISPLAY( Uint8(*h) ) << DISPLAY( m_pattern2na ) << DISPLAY( packed ) << dec << "\n"; SetBit( packed ); } } //else cerr << "-\n"; progress.Increment(); } progress.Summary(); }
/*! * \brief hyperbolic spin transformation from pa to pb by amt (0,1) */ Point hspin(const Pnt& pa, const Pnt& pb, double amt){ return Round::loc( pa.boost( hgen(pa,pb,amt) ) ); //versor * dist * amt * .5) ); }