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

View File

@ -148,7 +148,7 @@ int main(int argc, char **argv){
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++;