: start_( 0 ), stop_( 0 ), max_size_( window - 2 ), low_k_( low_k ),
44L( 0 ),
P( perfect_list ), thresholds_( thresholds ),
45r_w( 0 ), r_v( 0 ), num_diff( 0 )
47std::fill(
c_w,
c_w+ 64, 0 );
48std::fill(
c_v,
c_v+ 64, 0 );
55triplet_list_.pop_back();
56rem_triplet_info( r_w, c_w, s );
57 if( c_w[s] == 0 ) --num_diff;
60triplet_list_.push_front(
t);
61 if( c_w[
t] == 0 ) ++num_diff;
62add_triplet_info( r_w, c_w,
t);
65 if( num_diff <= 1 ) {
66 P.insert(
P.begin(),
perfect( start_, stop_ + 1, 0, 0 ) );
76 if( triplet_list_.size() >= max_size_ ) {
77 if( num_diff <= 1 ) {
78 returnshift_high(
t);
82triplet_list_.pop_back();
83rem_triplet_info( r_w, c_w, s );
84 if( c_w[s] == 0 ) --num_diff;
88rem_triplet_info( r_v, c_v, s );
94triplet_list_.push_front(
t);
95 if( c_w[
t] == 0 ) ++num_diff;
96add_triplet_info( r_w, c_w,
t);
97add_triplet_info( r_v, c_v,
t);
100 Uint4off = triplet_list_.size() - (L - start_) - 1;
103rem_triplet_info( r_v, c_v, triplet_list_[off] );
105}
while( triplet_list_[off--] !=
t);
110 if( triplet_list_.size() >= max_size_ && num_diff <= 1 ) {
112 P.insert(
P.begin(),
perfect( start_, stop_ + 1, 0, 0 ) );
120 typedefperfect_list_type::iterator perfect_iter_type;
129perfect_iter_type perfect_iter =
P.begin();
130 Uint4max_perfect_score = 0;
136 for( ; it != iend; ++it, ++
count, --pos ) {
138add_triplet_info( score, counts, *it );
144 while( perfect_iter !=
P.end()
145&& pos <= perfect_iter->bounds_.first ) {
146 if( max_perfect_score == 0
147|| max_len*perfect_iter->score_
148> max_perfect_score*perfect_iter->len_ ) {
149max_perfect_score = perfect_iter->score_;
150max_len = perfect_iter->len_;
157 if( max_perfect_score == 0
158|| score*max_len >= max_perfect_score*
count) {
159max_perfect_score = score;
161perfect_iter =
P.insert(
162perfect_iter,
perfect( pos, stop_ + 1,
163max_perfect_score,
count) );
188 if( !
P.empty() ) {
191 if(
b.first < wstart ) {
194 if( !res.empty() ) {
197 if( s +
linker_>= b1.first ) {
198res.back().second =
max( s, b1.second );
206 while( !
P.empty() &&
P.back().bounds_.first < wstart ) {
214std::unique_ptr< CSymDustMasker::TMaskList >
218std::unique_ptr< TMaskList > res(
new TMaskList);
223 if( stop >= seq.size() )
224stop = seq.size() - 1;
229 while( stop > 2 + start )
237 charc1 = *it, c2 = *++it;
240it.SetPos(start + w.
stop() + 2);
243 while( !
done&& it.GetPos() <= stop )
256 while( it.GetPos() <= stop ) {
274 while( !
P.empty() ) {
288std::unique_ptr< CSymDustMasker::TMaskList >
290{
return(*
this)( seq, 0, seq.size() - 1 ); }
294objects::CSeq_id & seq_id,
299std::unique_ptr< TMaskList > res = (*this)( seq );
301locs.reserve( res->size() );
303 for( TMaskList::const_iterator it = res->begin(); it != res->end(); ++it )
305 newobjects::CSeq_loc( seq_id, it->first, it->second ) ) );
313std::unique_ptr< TMaskList > res = (*this)( seq );
315 for( TMaskList::const_iterator it = res->begin(); it != res->end(); ++it )
316 result->AddInterval( seq_id, it->first, it->second );
bool shift_high(triplet_type t)
bool shift_window(triplet_type t)
bool needs_processing() const
triplets(size_type window, Uint1 low_k, perfect_list_type &perfect_list, thres_table_type &thresholds)
impl_type::const_iterator impl_citer_type
CSymDustMasker(Uint4 level=DEFAULT_LEVEL, size_type window=static_cast< size_type >(DEFAULT_WINDOW), size_type linker=static_cast< size_type >(DEFAULT_LINKER))
Object constructor.
Uint1 triplet_type
Type representing a triplet value.
std::list< perfect > perfect_list_type
Type representing a list of perfect intervals.
static const Uint4 DEFAULT_LEVEL
Default value of score threshold.
sequence_type::const_iterator seq_citer_type
std::pair< size_type, size_type > TMaskedInterval
Type respresenting an interval selected for masking.
std::vector< Uint4 > thres_table_type
Table type to store score sum thresholds for each window length.
static const triplet_type TRIPLET_MASK
Selects the significant bits in triplet_type.
CRef< objects::CPacked_seqint > GetMaskedInts(objects::CSeq_id &seq_id, const sequence_type &seq)
Mask a sequence and return result as a CPacked_seqint instance.
std::unique_ptr< TMaskList > operator()(const sequence_type &seq)
Mask a sequence.
void GetMaskedLocs(objects::CSeq_id &seq_id, const sequence_type &seq, std::vector< CConstRef< objects::CSeq_loc > > &locs)
Mask a sequence and return result as a sequence of CSeq_loc objects.
static const Uint4 DEFAULT_LINKER
Default value of the longest distance between consequtive masked intervals at which they should be me...
static const Uint4 DEFAULT_WINDOW
Default window size.
void save_masked_regions(TMaskList &res, size_type w, size_type start)
thres_table_type thresholds_
seq_t sequence_type
Public sequence type.
sequence_type::size_type size_type
Integer size type corresponding to sequence_type.
std::vector< TMaskedInterval > TMaskList
Type representing a list of masked intervals.
uint8_t Uint1
1-byte (8-bit) unsigned integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4