Skip to content
Snippets Groups Projects
Commit b3231ae0 authored by Lihouck Flavien's avatar Lihouck Flavien
Browse files

Modification de l'algorithme de consensus

parent 5c61a425
No related branches found
No related tags found
No related merge requests found
......@@ -63,12 +63,21 @@ string MSA::consensus(int threshold, int ploidity) {
}
vector<char> conserved_nuc(ploidity, '.');
// int nuc_score[ploidity](0);
int stored_nuc_cnt(0);
int min_score(100);
int max_score(0);
int current_score;
for(int k(0); k < (int)alphabet.size(); ++k) {
if ( ((scores[k]*(100))/(int)text.size())> (threshold)*current_weight /ploidity) {
conserved_nuc[stored_nuc_cnt] = alphabet[k];
stored_nuc_cnt++;
if ( ( current_score= (scores[k]*(100))/(int)text.size())> (threshold)*current_weight) {
if (current_score > max_score) {
max_score = current_score;
conserved_nuc[1] = conserved_nuc[0];
conserved_nuc[0] = alphabet[k];
}
else if (current_score > min_score) {
min_score = current_score;
conserved_nuc[1] = alphabet[k];
}
}
}
char nuc = basis_to_IUPAC(conserved_nuc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment