From ae528e48f471014a10fd18975b81c9eedf5b2608 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Thu, 30 Jun 2011 15:12:38 +0000 Subject: [PATCH] delta bug git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/trunk@309 60f365c0-8329-0410-b2a4-ec073aeeaa1d --- src/ecopcr.c | 11 +++++++---- src/libecoPCR/ecodna.c | 3 +++ src/libecoPCR/ecofilter.c | 11 ++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/ecopcr.c b/src/ecopcr.c index 1cb5ac4..ff2d830 100644 --- a/src/ecopcr.c +++ b/src/ecopcr.c @@ -262,6 +262,9 @@ void printRepeat(ecoseq_t *seq, amplifia[i]|=32; for (i=1;ihiterr[1]->val[j]; length = 0; if (posj > posi) - length=posj - posi - o1->patlen; /* - o2->patlen : suppress by */ + length=posj - posi - o1->patlen - o2->patlen; if (posj < posi) - length= posj + apatseq->seqlen - posi - o1->patlen; + length= posj + apatseq->seqlen - posi - o1->patlen - o2->patlen; if (length && (!lmin || (length >= lmin)) && (!lmax || (length <= lmax))) @@ -689,9 +692,9 @@ int main(int argc, char **argv) length = 0; if (posj > posi) - length=posj - posi + 1 - o2->patlen; /* - o1->patlen : suppress by */ + length=posj - posi + 1 - o2->patlen - o1->patlen; /* - o1->patlen : suppress by */ if (posj < posi) - length= posj + apatseq->seqlen - posi - o1->patlen; + length= posj + apatseq->seqlen - posi - o1->patlen - o2->patlen; if (length && (!lmin || (length >= lmin)) && diff --git a/src/libecoPCR/ecodna.c b/src/libecoPCR/ecodna.c index 7d29a0e..86d2012 100644 --- a/src/libecoPCR/ecodna.c +++ b/src/libecoPCR/ecodna.c @@ -104,6 +104,9 @@ char *ecoComplementSequence(char *nucAcSeq) char *getSubSequence(char* nucAcSeq,int32_t begin,int32_t end) +/* + extract subsequence from nucAcSeq [begin,end[ +*/ { static char *buffer = NULL; static int32_t buffSize= 0; diff --git a/src/libecoPCR/ecofilter.c b/src/libecoPCR/ecofilter.c index 8a7dbb1..64276c0 100644 --- a/src/libecoPCR/ecofilter.c +++ b/src/libecoPCR/ecofilter.c @@ -10,10 +10,11 @@ int eco_is_taxid_included( ecotaxonomy_t *taxonomy, taxon = eco_findtaxonbytaxid(taxonomy, taxid); - for (i=0; i < tab_len; i++) - if ( (taxon->taxid == restricted_taxid[i]) || - (eco_isundertaxon(taxon, restricted_taxid[i])) ) - return 1; + if (taxon) + for (i=0; i < tab_len; i++) + if ( (taxon->taxid == restricted_taxid[i]) || + (eco_isundertaxon(taxon, restricted_taxid[i])) ) + return 1; return 0; -} \ No newline at end of file +}