93 for (
size_t i = 0; i <
layout_v.size(); ++i)
99 for (
size_t i = 0; i <
strand_v.size(); ++i)
101 auto strand_plane =
strand_v[i].get();
104 strand_plane->optimize(tb);
105 strand_plane->sync();
112 unique_ptr<bm::bvector<> > ap(bv);
127 unique_ptr<rsc_vector_u8 > ap(strand);
146 unsigned char strand)
160 dm.
strand_v[plane] = unique_ptr<rsc_vector_u8 >(strand_plane);
162 assert(strand_plane->
is_null(pos));
163 strand_plane->
set(pos, strand);
170 unsigned start,
unsigned end,
171 unsigned char strand)
173 assert(start <= end);
177 for (
size_t i = 0; i < dm.
layout_v.size(); ++i)
183 dm.
layout_v[i] = unique_ptr<bm::bvector<> >(bv);
220 for (
size_t i = 0; i < dm.
layout_v.size(); ++i)
236 bv_ptr->copy_range(*bv, start_pos, end_pos);
239 dm_target.
add_layout(t_plane, bv_ptr.release());
247 strand_plane = dm.
strand_v[i].get();
251 strand_ptr->copy_range(*strand_plane, start_pos, end_pos);
252 dm_target.
add_strand(t_plane, strand_ptr.release());
276 "-------------------------------------------------------------------------"
278 "ATGTTAGCCCGCGCATATTATATATGTAGCGTATTAAGCGDGGAGATTACCCTTGCATTAGGTTANNNNNNNN"
280 "-------------------------------------------------------------------------"
283 for (
size_t i = 0; i < dm.
layout_v.size(); ++i)
295 auto st = ien.
start();
auto end = ien.
end();
296 char ch_strand =
'?';
299 auto strand = strand_plane->
get(st);
302 case 0: ch_strand =
'>';
break;
303 case 1: ch_strand =
'<';
break;
307 for (; spaces < st; ++spaces)
309 for (
bool first =
true; st <= end; ++st, first =
false)
314 cout << (first ? ch_strand :
'.');
375 catch(std::exception& ex)
377 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.
pre-processor un-defines to avoid global space pollution (internal)
Bitvector Bit-vector container with runtime compression of bits.
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_size_type size_type
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
succinct sparse vector with runtime compression using bit-slicing / 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
static void add_object(data_model &dm, unsigned start, unsigned end, unsigned char strand)
Register new object in the data model: [start..end] + strand.
static void set_feature_strand(data_model &dm, size_t plane, bm::bvector<>::size_type pos, unsigned char strand)
static 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.
static void print_model(const data_model &dm)
This is ASCII art "renderer" for the data model.
std::vector< std::unique_ptr< bm::bvector<> > > layout_vector_type