git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/branches/refactoring@66 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
@ -145,10 +145,10 @@ int main(int argc, char **argv){
|
|||||||
char *stream = ECOMALLOC(sizeof(char *)*LINE_BUFF_SIZE,"error stream buffer allocation");
|
char *stream = ECOMALLOC(sizeof(char *)*LINE_BUFF_SIZE,"error stream buffer allocation");
|
||||||
char *orig = ECOMALLOC(sizeof(char *)*LINE_BUFF_SIZE,"error orig buffer allocation");
|
char *orig = ECOMALLOC(sizeof(char *)*LINE_BUFF_SIZE,"error orig buffer allocation");
|
||||||
|
|
||||||
int is_ignored = 0;
|
int is_ignored = 0;
|
||||||
int is_included = 0;
|
int is_included = 0;
|
||||||
int is_matching = 0;
|
int is_matching = 0;
|
||||||
|
int good = 0;
|
||||||
seq = new_ecoseq();
|
seq = new_ecoseq();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -275,42 +275,39 @@ int main(int argc, char **argv){
|
|||||||
getLineContent(stream,seq);
|
getLineContent(stream,seq);
|
||||||
|
|
||||||
/* -----------------------------------------------*/
|
/* -----------------------------------------------*/
|
||||||
/* ignored if : */
|
/* is ignored if at least one option -i */
|
||||||
/* - v mode and no ignored */
|
|
||||||
/* OR */
|
|
||||||
/* - at least one -i option used */
|
|
||||||
/* AND */
|
/* AND */
|
||||||
/* - -i option is parent of current taxid */
|
/* if current sequence is son of taxid */
|
||||||
/* -----------------------------------------------*/
|
/* -----------------------------------------------*/
|
||||||
is_ignored = ( (v && i==0) ||
|
is_ignored = ( (i > 0) && (eco_is_taxid_included( taxonomy,
|
||||||
( (i > 0) && (eco_is_taxid_included( taxonomy,
|
|
||||||
ignored_taxid,
|
ignored_taxid,
|
||||||
i,
|
i,
|
||||||
seq->taxid))
|
seq->taxid))
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/* -----------------------------------------------*/
|
/* -----------------------------------------------*/
|
||||||
/* included if : */
|
/* is included if no -r option */
|
||||||
/* - normal mode and no restriction */
|
|
||||||
/* OR */
|
/* OR */
|
||||||
/* - is -r option is parent of current taxid */
|
/* if current sequence is son of taxid */
|
||||||
/* -----------------------------------------------*/
|
/* -----------------------------------------------*/
|
||||||
is_included = ( (!v && (r == 0)) || (eco_is_taxid_included( taxonomy,
|
is_included = ( (r == 0) || (eco_is_taxid_included( taxonomy,
|
||||||
restricted_taxid,
|
restricted_taxid,
|
||||||
r,
|
r,
|
||||||
seq->taxid))
|
seq->taxid))
|
||||||
);
|
);
|
||||||
|
|
||||||
/* -----------------------------------------------*/
|
/* ----------------------------------------------------------- */
|
||||||
/* match if no pattern or if function return 1 */
|
/* match if no pattern or if pattern match current sequence */
|
||||||
/* -----------------------------------------------*/
|
/* ----------------------------------------------------------- */
|
||||||
is_matching = ( (!v && !p) || (ispatternmatching(seq,pattern)));
|
is_matching = ( !p || (ispatternmatching(seq,pattern)));
|
||||||
|
|
||||||
if (
|
|
||||||
(!v && (!is_ignored && is_included && is_matching) ) ||
|
good = (is_included && is_matching && !is_ignored);
|
||||||
( v && (is_ignored && !is_included && !is_matching) )
|
|
||||||
)
|
if (v)
|
||||||
|
good=!good;
|
||||||
|
|
||||||
|
if ( good )
|
||||||
{
|
{
|
||||||
printf("%s",orig);
|
printf("%s",orig);
|
||||||
matchingresult++;
|
matchingresult++;
|
||||||
|
Reference in New Issue
Block a user