Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,14 @@ int shine_dalgarno_exact(unsigned char *seq, int pos, int start, double *rwt) {
double match[6], cur_ctr, dis_flag;

limit = imin(6, start-4-pos);
for(i = limit; i < 6; i++) match[i] = -10.0;
for(i = 0; 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;
if(pos + i >= 0) {
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;
}
}

/* Find the maximally scoring motif */
Expand Down Expand Up @@ -739,18 +739,19 @@ int shine_dalgarno_mm(unsigned char *seq, int pos, int start, double *rwt) {
double match[6], cur_ctr, dis_flag;

limit = imin(6, start-4-pos);
for(i = limit; i < 6; i++) match[i] = -10.0;
for(i = 0; 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;
}
else {
if(is_g(seq, pos+i) == 1) match[i] = 3.0;
else match[i] = -2.0;
if(pos+i >= 0) {
if(i % 3 == 0) {
if(is_a(seq, pos+i) == 1) match[i] = 2.0;
else match[i] = -3.0;
}
else {
if(is_g(seq, pos+i) == 1) match[i] = 3.0;
else match[i] = -2.0;
}
}
}

Expand Down