4 Commits

Author SHA1 Message Date
40f2972bda Actualiser src/libecoPCR/ecorank.c 2025-06-12 13:35:06 +00:00
7db34d77a4 Actualiser src/libecoPCR/ecotax.c 2025-06-12 13:34:30 +00:00
3503f66520 Update ecopcr.c to comment a debug message 2020-04-27 14:10:30 +02:00
9deb30a8c4 Patch a bug inducing that sequences were considered as circular whatever
the -c option was present or not.
2020-04-27 12:07:28 +02:00
3 changed files with 92 additions and 87 deletions

View File

@ -614,8 +614,10 @@ int main(int argc, char **argv)
length = 0;
if (posj > posi)
length = posj - posi - o1->patlen - o2->patlen;
if (posj < posi)
length = posj + apatseq->seqlen - posi - o1->patlen - o2->patlen;
else {
if (circular > 0)
length = posj + apatseq->seqlen - posi - o1->patlen - o2->patlen;
}
if ((length>0) && // For when primers touch or overlap
(!lmin || (length >= lmin)) &&
(!lmax || (length <= lmax)))
@ -648,7 +650,7 @@ int main(int argc, char **argv)
}
o1cHits = ManberAll(apatseq,o1c,3,begin,length);
// printf("circular= %d\n",circular);
if (o1cHits)
for (i=0; i < o2Hits;i++)
{
@ -668,8 +670,11 @@ int main(int argc, char **argv)
length = 0;
if (posj > posi)
length = posj - posi + 1 - o2->patlen - o1->patlen; /* - o1->patlen : deleted by <EC> (prior to the OBITools3) */
if (posj < posi)
else {
if (circular > 0)
length = posj + apatseq->seqlen - posi - o1->patlen - o2->patlen;
}
if ((length>0) && // For when primers touch or overlap
(!lmin || (length >= lmin)) &&
(!lmax || (length <= lmax)))

View File

@ -34,14 +34,11 @@ ecorankidx_t *read_rankidx(const char *filename)
int32_t rank_index(const char* label,ecorankidx_t* ranks)
{
char **rep;
fprintf(stderr,"Looking for rank -%s-... ",label);
rep = bsearch(label,ranks->label,ranks->count,sizeof(char*),compareRankLabel);
if (rep)
return rep-ranks->label;
else
ECOERROR(ECO_NOTFOUND_ERROR,"Rank label not found");
return -1;
}

View File

@ -341,6 +341,9 @@ ecotx_t *eco_getsuperkingdom(ecotx_t *taxon,
if (taxonomy && tax!=taxonomy)
{
rankindex = rank_index("superkingdom",taxonomy->ranks);
if (rankindex < 0) {
rankindex = rank_index("domain",taxonomy->ranks);
}
tax=taxonomy;
}