48 template <
typename MapqCalculator,
typename ReadData>
55 MapqCalculator _mapq_eval,
58 const ReadData _read_data) :
70 const uint32 read_len =
read_data.sequence_index()[ read_id + 1 ] - read_offset;
84 template <
typename scoring_tag>
99 const uint32 genome_len = genome_access.
bps();
104 typedef typename scoring_scheme_type::threshold_score_type threshold_score_type;
108 threshold_score_type threshold_score = scoring_scheme.threshold_score();
129 thrust::make_counting_iterator(0u),
130 thrust::make_counting_iterator(0u) + count,
154 device_timer.
start();
179 best_approx_score<scoring_tag>(
206 for (
uint32 seeding_pass = 0; seeding_pass < params.
max_reseed+1; ++seeding_pass)
220 device_timer.
start();
245 params.persist_seeding == -1 || seeding_pass == (
uint32) params.persist_seeding)
253 best_approx_score<scoring_tag>(
296 mapq_evaluator_type mapq_eval( input_scoring_scheme.
sw );
300 nvbio::transform<device_tag>(
302 thrust::make_counting_iterator<uint32>(0),
324 device_timer.
start();
339 if (
cigar.has_overflown())
347 device_timer.
start();
358 input_scoring_scheme.
sw,
408 thrust::make_counting_iterator(0u),
409 thrust::make_counting_iterator(0u) + count,
411 second_idx_dvec.begin(),
426 device_timer.
start();
428 uint32* second_idx = thrust::raw_pointer_cast( &second_idx_dvec[0] );
443 if (
cigar.has_overflown())
451 device_timer.
start();
462 input_scoring_scheme.
sw,
505 thrust::host_vector<io::Alignment> h_best_data(
BATCH_SIZE*2 );
506 thrust::host_vector<uint8> h_mapq(
BATCH_SIZE );
512 for (
uint32 i = 0; i < count; ++i)
515 const uint8 mapq = h_mapq[i];
523 typename scoring_tag,
524 typename scoring_scheme_type>
529 const scoring_scheme_type& scoring_scheme,
533 const uint32 seeding_pass,
534 const uint32 seed_queue_size,
539 typedef typename scoring_scheme_type::threshold_score_type threshold_score_type;
542 const int32 score_limit = scoring_scheme_type::worst_score;
558 const uint32 genome_len = genome_access.
bps();
579 active_read_queues.
resize( seed_queue_size );
582 thrust::device_ptr<const uint32>( seed_queue ),
583 thrust::device_ptr<const uint32>( seed_queue ) + seed_queue_size,
584 active_read_queues.
in_queue.begin(),
592 pipeline_type pipeline(
615 for (
uint32 extension_pass = 0; active_read_queues.
in_size && n_ext < params.
max_ext; ++extension_pass)
617 log_debug(stderr,
"[%u] pass:\n[%u] batch: %u\n[%u] seeding pass: %d\n[%u] extension pass: %u\n",
ID,
ID,
batch_number,
ID, seeding_pass,
ID, extension_pass);
632 device_timer.
start();
644 device_timer.
start();
647 pipeline.n_hits_per_read = 1;
664 pipeline.n_hits_per_read =
std::min(
693 cudaDeviceSynchronize();
700 active_read_queues.
swap();
706 if (active_read_queues.
in_size == 0)
711 if (pipeline.hits_queue_size == 0)
723 pipeline.n_hits_per_read,
724 pipeline.hits_queue_size,
728 log_debug(stderr,
"[%u] selected %u hits\n",
ID, pipeline.hits_queue_size);
733 device_timer.
start();
737 pipeline.idx_queue =
sort_hi_bits( pipeline.hits_queue_size, pipeline.scoring_queues.hits.loc );
744 device_timer.
start();
772 device_timer.
start();
778 pipeline.idx_queue =
sort_hi_bits( pipeline.hits_queue_size, pipeline.scoring_queues.hits.loc );
787 float score_time = 0.0f;
788 float dev_score_time = 0.0f;
790 device_timer.
start();
803 dev_score_time += device_timer.
seconds();
814 device_timer.
start();
830 n_ext += pipeline.n_hits_per_read;
834 stats.
score.
add( pipeline.hits_queue_size, score_time + timer.
seconds(), dev_score_time + device_timer.
seconds() );