92 for (
size_t i = 0; i <
layout_v.size(); ++i)
98 for (
size_t i = 0; i <
strand_v.size(); ++i)
100 auto strand_plane =
strand_v[i].get();
103 strand_plane->optimize(tb);
104 strand_plane->sync();
111 unique_ptr<bm::bvector<> > ap(bv);
126 unique_ptr<rsc_vector_u8 > ap(strand);
144 unsigned char strand)
158 dm.
strand_v[plane] = unique_ptr<rsc_vector_u8 >(strand_plane);
160 assert(strand_plane->
is_null(pos));
161 strand_plane->
set(pos, strand);
167 unsigned start,
unsigned end,
168 unsigned char strand)
170 assert(start <= end);
174 for (
size_t i = 0; i < dm.
layout_v.size(); ++i)
180 dm.
layout_v[i] = unique_ptr<bm::bvector<> >(bv);
217 for (
size_t i = 0; i < dm.
layout_v.size(); ++i)
233 bv_ptr->copy_range(*bv, start_pos, end_pos);
236 dm_target.
add_layout(t_plane, bv_ptr.release());
244 strand_plane = dm.
strand_v[i].get();
248 strand_ptr->copy_range(*strand_plane, start_pos, end_pos);
249 dm_target.
add_strand(t_plane, strand_ptr.release());
272 "-------------------------------------------------------------------------"
274 "ATGTTAGCCCGCGCATATTATATATGTAGCGTATTAAGCGDGGAGATTACCCTTGCATTAGGTTANNNNNNNN"
276 "-------------------------------------------------------------------------"
279 for (
size_t i = 0; i < dm.
layout_v.size(); ++i)
291 auto st = ien.
start();
auto end = ien.
end();
292 char ch_strand =
'?';
295 auto strand = strand_plane->
get(st);
298 case 0: ch_strand =
'>';
break;
299 case 1: ch_strand =
'<';
break;
303 for (; spaces < st; ++spaces)
305 for (
bool first =
true; st <= end; ++st, first =
false)
310 cout << (first ? ch_strand :
'.');
371 catch(std::exception& ex)
373 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Algorithms for bit ranges and intervals.
Compressed sparse container rsc_sparse_vector<> for integer types.
bool any_range(size_type left, size_type right) const BMNOEXCEPT
Returns true if any bits in the range are 1s (non-empty interval) Function uses closed interval [left...
bvector< Alloc > & set_range(size_type left, size_type right, bool value=true)
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's siz...
forward iterator class to traverse bit-vector as ranges
size_type end() const BMNOEXCEPT
Return interval end/right as bit-vector coordinate 011110 [left..right].
bool valid() const BMNOEXCEPT
Returns true if enumerator is valid (false if traversal is done)
size_type start() const BMNOEXCEPT
Return interval start/left as bit-vector coordinate 011110 [left..right].
Rank-Select compressed sparse vector.
void set(size_type idx, value_type v)
set specified element with bounds checking and automatic resize
value_type get(size_type idx) const BMNOEXCEPT
get specified element without bounds checking
bool is_null(size_type idx) const BMNOEXCEPT
test if specified element is NULL
sparse vector with runtime compression using bit transposition method
@ BM_GAP
GAP compression is ON.
bool find_interval_end(const BV &bv, typename BV::size_type from, typename BV::size_type &pos) BMNOEXCEPT
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...
bool find_interval_start(const BV &bv, typename BV::size_type from, typename BV::size_type &pos) BMNOEXCEPT
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...
Data frame object, sued to buid succinct data model.
void optimize()
Optimize memory layoput, build index for faster read access.
void add_strand(size_t plane, rsc_vector_u8 *strand)
void add_layout(size_t plane, bm::bvector<> *bv)
layout_vector_type layout_v
layout vector
starnds_vector_type strand_v
strand planes vector
bm::sparse_vector< unsigned char, bm::bvector<> > sparse_vector_u8
bm::interval_enumerator< bm::bvector<> > interval_enumerator_type
std::vector< std::unique_ptr< rsc_vector_u8 > > starnds_vector_type
bm::rsc_sparse_vector< unsigned char, sparse_vector_u8 > rsc_vector_u8
void splice_model(data_model &dm_target, const data_model &dm, bm::bvector<>::size_type start, bm::bvector<>::size_type end, bool copy_strands)
Data model splicer.
void add_object(data_model &dm, unsigned start, unsigned end, unsigned char strand)
Register new object in the data model: [start..end] + strand.
void set_feature_strand(data_model &dm, size_t plane, bm::bvector<>::size_type pos, unsigned char strand)
std::vector< std::unique_ptr< bm::bvector<> > > layout_vector_type
void print_model(const data_model &dm)
This is ASCII art "renderer" for the data model.