Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewickIO bug #8

Open
ArtPoon opened this issue Dec 5, 2014 · 3 comments
Open

NewickIO bug #8

ArtPoon opened this issue Dec 5, 2014 · 3 comments
Labels

Comments

@ArtPoon
Copy link
Owner

ArtPoon commented Dec 5, 2014

Traceback (most recent call last):
  File "diffrisk.py", line 79, in <module>

  File "/Users/art/git/kamphir/kamphir.py", line 282, in abc_mcmc
    next_score = self.evaluate()
  File "/Users/art/git/kamphir/kamphir.py", line 233, in evaluate
    async_results = [apply_async(pool, self.compute, args=(tree,)) for tree in trees]
  File "/Library/Python/2.7/site-packages/Bio/Phylo/_io.py", line 53, in parse
    for tree in getattr(supported_formats[format], 'parse')(fp, **kwargs):
  File "/Library/Python/2.7/site-packages/Bio/Phylo/NewickIO.py", line 118, in parse
    yield self._parse_tree(buf)
  File "/Library/Python/2.7/site-packages/Bio/Phylo/NewickIO.py", line 171, in _parse_tree
    raise NewickError('Parenthesis mismatch.')
Bio.Phylo.NewickIO.NewickError: Parenthesis mismatch.
@ArtPoon ArtPoon added the bug label Dec 5, 2014
@ArtPoon
Copy link
Owner Author

ArtPoon commented Dec 5, 2014

from NewickIO.py:

            elif token == ')':
                # done adding children for this parent clade
                parent = self.process_clade(current_clade)
                if not parent:
                    raise NewickError('Parenthesis mismatch.')

So script is encountering a tree string with an unmatched closing parenthesis.

@ArtPoon
Copy link
Owner Author

ArtPoon commented Dec 9, 2014

This bug has a very low rate of occurrence. I am going to catch this exception in kamphir.py, simulate() by "manually" iterating over the file of Newick strings and passing the rare case where the string is mangled. The rest of the parsed trees will be returned as a List object. Eventually it would be nice to chase this one, but for now I'm closing with commit.

@ArtPoon ArtPoon reopened this Dec 10, 2014
@ArtPoon
Copy link
Owner Author

ArtPoon commented Dec 10, 2014

Captured a couple of trees that raised this exception, saved as crash.tree and crash2.tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant