41 #include <thrust/iterator/transform_iterator.h>
42 #include <thrust/adjacent_difference.h>
48 template <
typename scoring_tag>
62 typedef typename scoring_scheme_type::threshold_score_type threshold_score_type;
78 thrust::make_counting_iterator(0u),
79 thrust::make_counting_iterator(0u) + count,
98 for (
uint32 seed = 0; seed < max_seeds; ++seed)
103 log_debug(stderr,
" map seed %u\n", seed);
117 make_uint2( seed, seed+1 ),
135 make_uint2( seed, seed+1 ),
156 input_scoring_scheme,
173 log_debug(stderr,
" map (%u seeds)\n", max_seeds);
184 make_uint2( 0u, max_seeds ),
202 make_uint2( 0u, max_seeds ),
224 input_scoring_scheme,
253 return loc + (read_id << 33) + (rc << 32);
261 template <
typename Iterator>
277 template <
typename scoring_scheme_type>
283 const scoring_scheme_type& scoring_scheme,
288 const uint32 seed_queue_size,
297 const int32 score_limit = scoring_scheme_type::worst_score;
311 const uint32 genome_len = genome_access.
bps();
352 if (n_hit_ranges == 0)
355 log_verbose(stderr,
" ranges : %u\n", n_hit_ranges);
375 #if defined(NVBIO_CUDA_DEBUG)
381 for (
uint32 i = 0; i < n_reads; ++i)
384 uint32 index = h_index[i];
385 for (
uint32 j = 0; j < cnt; ++j)
387 const SeedHit hit = h_hits[ index + j ];
391 if (n_hits != total_hits)
393 log_error(stderr,
" expected %llu hits, computed %llu\n", total_hits, n_hits);
412 pipeline_type pipeline(
458 pipeline.n_hits_per_read = 1u;
459 pipeline.hits_queue_size = hit_count;
508 nvbio::transform<device_tag>(
510 thrust::make_counting_iterator<uint32>(0) + 1u,
525 pipeline.scoring_queues.hits,
547 log_debug_cont(stderr,
" (%u/%u - %.2f)\n", pipeline.hits_queue_size, hit_count,
float(pipeline.hits_queue_size)/
float(hit_count));
550 pipeline.idx_queue = sorting_idx.first;
565 buffer_offset + buffer_count,
574 total_alignments += n_alignments;
575 log_verbose(stderr,
"\r alignments : %u (%.1fM) %.1f%% ", n_alignments,
float(total_alignments)*1.0e-6f, 100.0f *
float(hit_offset + hit_count)/
float(n_hits));
578 buffer_count += n_alignments;
587 if (hit_offset + hit_count < n_hits)
606 buffer_offset + buffer_count,
615 thrust::make_counting_iterator(0u),
616 thrust::make_counting_iterator(0u) + n_backtracks,
629 log_debug(stderr,
" traceback (%u alignments)\n", n_backtracks);
643 if (
cigar.has_overflown())
655 input_scoring_scheme.
sw,
683 buffer_count -= n_backtracks;
684 buffer_offset = (buffer_offset + n_backtracks) % (
BATCH_SIZE*2);
689 log_debug(stderr,
" alignments: %llu\n", total_alignments);