Sequence circularity, bug correction

git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/trunk@167 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
2008-04-28 16:46:18 +00:00
parent d863b7e48e
commit 708b7c387e
5 changed files with 18 additions and 13 deletions

View File

@ -239,7 +239,7 @@ void printRepeat(ecoseq_t *seq,
error1,
oligo2,
error2,
amplength,
amplength - o1->patlen - o2->patlen,
amplifia,
seq->DE
);
@ -387,10 +387,12 @@ int main(int argc, char **argv)
strcpy(oligo2,argv[optind]);
if (circular)
{
circular = strlen(oligo1);
if (strlen(oligo2)>(size_t)circular)
circular = strlen(oligo2);
}
}
else
errflag++;

View File

@ -9,6 +9,7 @@ SRCS=$(SOURCES)
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
LIBFILE= libapat.a
RANLIB=ranlib
include ../global.mk
@ -20,4 +21,4 @@ clean:
$(LIBFILE): $(OBJECTS)
ar -cr $@ $?
$(RANLIB) $@

View File

@ -80,14 +80,14 @@ int CreateS(Pattern *ppat, Int32 lalpha)
/* -------------------------------------------- */
Int32 ManberNoErr(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
{
Int32 pos;
UInt32 pos;
UInt32 smask, r;
UInt8 *data;
StackiPtr *stkpos, *stkerr;
UInt32 end;
end = begin + length;
end = (end <= pseq->seqlen) ? end:pseq->seqlen;
end = (end <= (size_t)(pseq->seqlen+pseq->circular)) ? end:(size_t)(pseq->seqlen+pseq->circular);
/* create local masks */
@ -127,7 +127,7 @@ Int32 ManberNoErr(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
Int32 ManberSub(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
{
int e, emax, found;
Int32 pos;
UInt32 pos;
UInt32 smask, cmask, sindx;
UInt32 *pr, r[2 * MAX_PAT_ERR + 2];
UInt8 *data;
@ -135,7 +135,7 @@ Int32 ManberSub(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
UInt32 end;
end = begin + length;
end = (end <= pseq->seqlen) ? end:pseq->seqlen;
end = (end <= (size_t)(pseq->seqlen+pseq->circular)) ? end:(size_t)(pseq->seqlen+pseq->circular);
/* create local masks */
emax = ppat->maxerr;
@ -193,7 +193,7 @@ Int32 ManberSub(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
Int32 ManberIndel(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
{
int e, emax, found;
Int32 pos;
UInt32 pos;
UInt32 smask, cmask, sindx;
UInt32 *pr, r[2 * MAX_PAT_ERR + 2];
UInt8 *data;
@ -201,7 +201,7 @@ Int32 ManberIndel(Seq *pseq, Pattern *ppat, int patnum,int begin,int length)
UInt32 end;
end = begin + length;
end = (end <= pseq->seqlen) ? end:pseq->seqlen;
end = (end <= (size_t)(pseq->seqlen+pseq->circular)) ? end:(size_t)(pseq->seqlen+pseq->circular);
/* create local masks */
emax = ppat->maxerr;

View File

@ -15,6 +15,7 @@ SRCS=$(SOURCES)
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
LIBFILE= libecoPCR.a
RANLIB= ranlib
include ../global.mk
@ -27,3 +28,4 @@ clean:
$(LIBFILE): $(OBJECTS)
ar -cr $@ $?
$(RANLIB) $@

View File

@ -50,13 +50,13 @@ void EncodeSequence(SeqPtr seq)
while (*cseq) {
*data++ = (IS_UPPER(*cseq) ? *cseq - 'A' : 0x0);
*data = (IS_UPPER(*cseq) ? *cseq - 'A' : 0x0);
data++;
cseq++;
}
for (i=0,cseq=seq->cseq;i < seq->circular; i++,cseq++)
*data++ = (IS_UPPER(*cseq) ? *cseq - 'A' : 0x0);
for (i=0,cseq=seq->cseq;i < seq->circular; i++,cseq++,data++)
*data = (IS_UPPER(*cseq) ? *cseq - 'A' : 0x0);
for (i = 0 ; i < MAX_PATTERN ; i++)
seq->hitpos[i]->top = seq->hiterr[i]->top = 0;