本文整理汇总了C++中Items::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Items::clear方法的具体用法?C++ Items::clear怎么用?C++ Items::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Items
的用法示例。
在下文中一共展示了Items::clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generic_worker_single_thr
/* static */
void Module_DMAP::generic_worker_single_thr(Module_DMAP * search, int id) {
Mask * sequences;
int read_seq;
vector<Mask> printable_solutions;
Transmitting_Result received;
if (search->my_rank == 0) {
sequences = new Mask[SEQUENCES_FOR_BLOCK];
read_seq = read_sequences(search->input_file1, SEQUENCES_FOR_BLOCK, sequences, search->fastqformat, search->gui_output);
} else {
received = search->receive_from_previous(id);
sequences = received.first;
read_seq = received.second;
}
while (read_seq != 0) {
Items solutions;
//ItemsGapped solutions_gapped;
t_errors calculated_errors;
for (int i = 0; i < read_seq; i++) {
Mask & s = sequences[i];
if (search->my_rank == 0 and search->trim) {
// check_routine(sequences[i], 0);
s.quality_trimming_MOTT(search->min_phred_value_MOTT,search->min_mean_quality,search->min_size);
}
if (s.status_discarded()) {
if (s.status_low_complexity())
s.low_complexity =true; //s.set_type(low_complexity);
else
s.low_quality = true; //s.set_type(quality_discarded);
printable_solutions.push_back(s);
continue;
}
if (search->auto_errors)
calculated_errors = round((double)s.get_good_length() / search->errors_rate);
else
calculated_errors = search->common_errors_allowed;
if (search->my_rank != 0 and s.algn > 0 and s.NM < calculated_errors)
calculated_errors = s.NM;
t_errors count = 0;
for (t_pattern_length i = s.get_good_region_start()-1; (i < s.get_good_region_stop()) and (count <= calculated_errors); i++)
if (s.sequence[i] == 'N' or s.sequence[i] == 'n')
count++;
if (count > calculated_errors) {
//s.set_type(alignments_not_found);
printable_solutions.push_back(s);
continue;
}
/** ALIGNMENT **/
solutions.clear();
if (search->my_rank == 0 and search->contamination_check) {
search->CR.search(s.get_good_sequence(),solutions,calculated_errors);
if (solutions.size() > 0)
s.contaminated = true;
}
if (not s.contaminated)
search->H.search(s.get_good_sequence(),solutions,calculated_errors);
if (solutions.size() == 0) {
/** Try gapped **/
/*
solutions_gapped.clear();
if (search->gap)
search->H.search_gapped(s.get_good_sequence(),solutions_gapped,search->seed_sizes,search->seed_errors,calculated_errors,search->max_gap);
*/
/*
if (solutions_gapped.size() == 0) {// size 0 means no alignment found
*/
//s.set_type(alignments_not_found);
printable_solutions.push_back(s);
continue;
/*
} else {
if (not search->printAll) {
Random_Choice_Result r;
bool improved = (s.NM + s.NM_gap) > (solutions_gapped.at(0).errors1 + solutions_gapped.at(0).errors2);
if (improved)
r = Search_MPI::random_choice_from_previous(0,solutions_gapped.size());
else
r = Search_MPI::random_choice_from_previous(s.algn,solutions_gapped.size());
if (not improved and r.first) {
// take the previous solution
s.algn += solutions_gapped.size();
} else {
// update solution
const ResultItemGapped & HM = solutions_gapped.at(r.second);
s.globalPosition = HM.GlobalPosition1;
if (improved)
s.algn = solutions_gapped.size();
else
s.algn += solutions_gapped.size();
s.HI = 1;
s.IH = 1;
s.primary = true;
s.strand = HM.strand;
//.........这里部分代码省略.........