Skip to content

Commit

Permalink
negate strcmp
Browse files Browse the repository at this point in the history
tool                    TP         FP         TN         FN       prec      sens      spec       NPV       MCC
FGS                2494195     231257     656879     283010      91.51     89.81     73.96     69.89     62.58
FGS+               2661256     533556     361341     109188       83.3     96.06     40.38     76.79     46.79
prodigal           2488137     117535     745673     313996      95.49     88.79     86.38     70.37     70.36
FGSrs              2504714     280484     607613     272530      89.93     90.19     68.42     69.04     58.78
  • Loading branch information
Felix Van der Jeugt committed Sep 22, 2021
1 parent ddde02b commit 22f2f20
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/viterbi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,15 +662,15 @@ fn build_genes(
if whole_genome {
// add refinement of the start codons here
let start_old = start_t as usize;
let mut codon = &seq[start_old..start_old + 3];
let mut codon = &seq[start_old - 1..start_old + 2];
let mut s = 0;
// find the optimal start codon within 30bp up- and downstream of start codon
let mut e_save = 0.0;
let mut s_save = 0;
while !(codon != [T, A, A] || codon != [T, A, G] || codon != [T, G, A])
while !(codon == [T, A, A] || codon == [T, A, G] || codon == [T, G, A])
&& start_old >= 1 + s + 35
{
if codon != [A, T, G] || codon != [G, T, G] || codon != [T, T, G] {
if codon == [A, T, G] || codon == [G, T, G] || codon == [T, T, G] {
let utr = &seq[start_old - 1 - s - 30..start_old - 1 - s - 30 + 63];
let mut freq_sum = 0.0;
for j in 0..utr.len() - 2 {
Expand All @@ -687,9 +687,8 @@ fn build_genes(
}
s += 3;
codon = &seq[start_old - 1 - s..start_old - 1 - s + 3];

dna_start_t += s_save as usize;
}
dna_start_t += s_save as usize;
}

read_prediction.genes.push(gene::Gene {
Expand All @@ -712,10 +711,10 @@ fn build_genes(
// find the optimal start codon within 30bp up- and downstream of start codon
let mut e_save = 0.0;
let mut s_save = 0;
while !(codon != [T, A, A] || codon != [T, A, G] || codon != [T, G, A])
while !(codon == [T, T, A] || codon == [C, T, A] || codon == [T, C, A])
&& end_old - 2 + s + 35 < seq.len()
{
if codon != [A, T, G] || codon != [G, T, G] || codon != [T, T, G] {
if codon == [C, A, T] || codon == [C, A, C] || codon == [C, A, A] {
let utr = &seq[end_old - 1 - 2 + s - 30..end_old + s + 30];
let mut freq_sum = 0.0;
for j in 0..utr.len() - 2 {
Expand All @@ -729,7 +728,7 @@ fn build_genes(
}
}
s += 3;
codon = &seq[end_old - 1 - 2 + s..end_old];
codon = &seq[end_old - 1 - 2 + s..end_old + s];
}

end_t = end_old + s_save;
Expand Down

0 comments on commit 22f2f20

Please sign in to comment.