Skip to content

Commit

Permalink
Prodigal V2.60 bugfix 1
Browse files Browse the repository at this point in the history
  • Loading branch information
hyattpd committed Jul 11, 2013
1 parent 5770df5 commit 4bc33bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions dprog.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int dprog(struct _node *nod, int nn, struct _training *tinf, int flag) {
void score_connection(struct _node *nod, int p1, int p2, struct _training *tinf,
int flag) {
struct _node *n1 = &(nod[p1]), *n2 = &(nod[p2]), *n3;
int i, cod = 0, left = n1->ndx, right = n2->ndx, bnd, ovlp = 0, maxfr = -1;
int i, left = n1->ndx, right = n2->ndx, bnd, ovlp = 0, maxfr = -1;
double score = 0.0, scr_mod = 0.0, maxval;

/***********************/
Expand Down Expand Up @@ -158,7 +158,7 @@ void score_connection(struct _node *nod, int p1, int p2, struct _training *tinf,
n2->type == STOP) {
if(n2->stop_val >= n1->ndx) return;
if(n1->ndx % 3 != n2->ndx % 3) return;
cod = 1; right += 2;
right += 2;
if(flag == 0) scr_mod = tinf->bias[0]*n1->gc_score[0] +
tinf->bias[1]*n1->gc_score[1] + tinf->bias[2]*n1->gc_score[2];
else if(flag == 1) score = n1->cscore + n1->sscore;
Expand All @@ -169,7 +169,7 @@ void score_connection(struct _node *nod, int p1, int p2, struct _training *tinf,
n2->type != STOP) {
if(n1->stop_val <= n2->ndx) return;
if(n1->ndx % 3 != n2->ndx % 3) return;
cod = 1; left -= 2;
left -= 2;
if(flag == 0) scr_mod = tinf->bias[0]*n2->gc_score[0] +
tinf->bias[1]*n2->gc_score[1] + tinf->bias[2]*n2->gc_score[2];
else if(flag == 1) score = n2->cscore + n2->sscore;
Expand Down Expand Up @@ -246,7 +246,7 @@ void score_connection(struct _node *nod, int p1, int p2, struct _training *tinf,
if(n2->stop_val >= n1->ndx) return;
if(n1->star_ptr[n2->ndx%3] == -1) return;
n3 = &(nod[n1->star_ptr[n2->ndx%3]]);
left = n3->ndx; right += 2; cod = 1;
left = n3->ndx; right += 2;
if(flag == 0) scr_mod = tinf->bias[0]*n3->gc_score[0] +
tinf->bias[1]*n3->gc_score[1] + tinf->bias[2]*n3->gc_score[2];
else if(flag == 1) score = n3->cscore + n3->sscore +
Expand All @@ -259,7 +259,7 @@ void score_connection(struct _node *nod, int p1, int p2, struct _training *tinf,
if(n1->stop_val <= n2->ndx) return;
if(n2->star_ptr[n1->ndx%3] == -1) return;
n3 = &(nod[n2->star_ptr[n1->ndx%3]]);
left -= 2; right = n3->ndx; cod = 1;
left -= 2; right = n3->ndx;
if(flag == 0) scr_mod = tinf->bias[0]*n3->gc_score[0] +
tinf->bias[1]*n3->gc_score[1] + tinf->bias[2]*n3->gc_score[2];
else if(flag == 1) score = n3->cscore + n3->sscore +
Expand Down
4 changes: 2 additions & 2 deletions gene.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
/* Copies genes from the dynamic programming to a final array */

int add_genes(struct _gene *glist, struct _node *nod, int dbeg) {
int path, pos, ctr;
int path, ctr;

if(dbeg == -1) return 0;
path = dbeg; ctr = 0; pos = -1;
path = dbeg; ctr = 0;
while(nod[path].traceb != -1) path = nod[path].traceb;

while(path != -1) {
Expand Down
4 changes: 2 additions & 2 deletions sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,12 @@ int shine_dalgarno_exact(unsigned char *seq, int pos, int start, double *rwt) {
int i, j, k, mism, rdis, limit, max_val, cur_val = 0;
double match[6], cur_ctr, dis_flag;

if(pos < 0) return 0;
limit = imin(6, start-4-pos);
for(i = limit; i < 6; i++) match[i] = -10.0;

/* Compare the 6-base region to AGGAGG */
for(i = 0; i < limit; i++) {
if(pos+i < 0) continue;
if(i%3 == 0 && is_a(seq, pos+i) == 1) match[i] = 2.0;
else if(i%3 != 0 && is_g(seq, pos+i) == 1) match[i] = 3.0;
else match[i] = -10.0;
Expand Down Expand Up @@ -736,12 +736,12 @@ int shine_dalgarno_mm(unsigned char *seq, int pos, int start, double *rwt) {
int i, j, k, mism, rdis, limit, max_val, cur_val = 0;
double match[6], cur_ctr, dis_flag;

if(pos < 0) return 0;
limit = imin(6, start-4-pos);
for(i = limit; i < 6; i++) match[i] = -10.0;

/* Compare the 6-base region to AGGAGG */
for(i = 0; i < limit; i++) {
if(pos+i < 0) continue;
if(i % 3 == 0) {
if(is_a(seq, pos+i) == 1) match[i] = 2.0;
else match[i] = -3.0;
Expand Down

0 comments on commit 4bc33bd

Please sign in to comment.