This commit is contained in:
2007-06-14 14:11:13 +00:00
parent ab46791915
commit 8455ed0a99

View File

@ -145,10 +145,10 @@ int main(int argc, char **argv){
char *stream = ECOMALLOC(sizeof(char *)*LINE_BUFF_SIZE,"error stream 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_matching = 0;
int good = 0;
seq = new_ecoseq();
/**
@ -275,42 +275,39 @@ int main(int argc, char **argv){
getLineContent(stream,seq);
/* -----------------------------------------------*/
/* ignored if : */
/* - v mode and no ignored */
/* OR */
/* - at least one -i option used */
/* is ignored if at least one option -i */
/* AND */
/* - -i option is parent of current taxid */
/* if current sequence is son of taxid */
/* -----------------------------------------------*/
is_ignored = ( (v && i==0) ||
( (i > 0) && (eco_is_taxid_included( taxonomy,
is_ignored = ( (i > 0) && (eco_is_taxid_included( taxonomy,
ignored_taxid,
i,
seq->taxid))
)
);
/* -----------------------------------------------*/
/* included if : */
/* - normal mode and no restriction */
/* is included if no -r option */
/* 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,
r,
seq->taxid))
);
/* -----------------------------------------------*/
/* match if no pattern or if function return 1 */
/* -----------------------------------------------*/
is_matching = ( (!v && !p) || (ispatternmatching(seq,pattern)));
if (
(!v && (!is_ignored && is_included && is_matching) ) ||
( v && (is_ignored && !is_included && !is_matching) )
)
/* ----------------------------------------------------------- */
/* match if no pattern or if pattern match current sequence */
/* ----------------------------------------------------------- */
is_matching = ( !p || (ispatternmatching(seq,pattern)));
good = (is_included && is_matching && !is_ignored);
if (v)
good=!good;
if ( good )
{
printf("%s",orig);
matchingresult++;