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

Excel output fails if openpyxl isn't installed #130

Closed
widdowquinn opened this issue Mar 14, 2019 · 7 comments · Fixed by #367
Closed

Excel output fails if openpyxl isn't installed #130

widdowquinn opened this issue Mar 14, 2019 · 7 comments · Fixed by #367
Assignees
Labels
bug something isn't working how it should

Comments

@widdowquinn
Copy link
Owner

Summary:

Specifying --formats excel fails with pyani report if openpyxl is not installed

Expected Output:

A warning that openpyxl is not installed, and graceful failure that still produces output in the other formats

pyani Version:

v0.3.0dev

Python Version:

3.6

Operating System:

CentOS6

@widdowquinn widdowquinn self-assigned this Mar 14, 2019
@widdowquinn widdowquinn added the bug something isn't working how it should label Mar 14, 2019
@elzerac
Copy link

elzerac commented Jun 12, 2019

I did not get any other output due to this error. Is it possible for me to concatenate the blastn files into a table without re-doing the alignments? I have the correct blastn files...

@widdowquinn
Copy link
Owner Author

widdowquinn commented Jun 12, 2019

Hi Elza,

If this is the only error you have, then you should be able to either:

  1. install openpyxl and re-run
  2. re-run but do not ask for Excel output

and pyani should be able to find your pairwise comparisons.

(by the way, I would strongly advise that you use ANIm rather than the BLAST variants of ANI)

@elzerac
Copy link

elzerac commented Jun 12, 2019

Thanks for your response. I did install, but which option do I use to point to the blast files? I am getting an error that the directory already exists.

Also, could you provide a reference for the preference of ANIm? I am relatively new to this field!

@widdowquinn
Copy link
Owner Author

widdowquinn commented Jun 12, 2019

Hi Elze,

I'm assuming that you're using the latest version from the development branch on GitHub - that's the version that this bug report refers to. If you're not, then the instructions will differ.

To reuse the same output directory, use the -f option. With version 0.3 the old output files will be reused. With version 0.2 they will be recalculated and overwritten. To avoid that outcome with version 0.2, use the --noclobber option as well as -f.

There's no reference for my advice yet - I'm writing the paper that will spell this all out. Briefly…

  1. ANIm is quicker
  2. BLAST is not a genome alignment algorithm, it's a database search program. It's the wrong tool for the job. MUMmer is a genome alignment algorithm/program. It's the right tool for the job.
  3. MUMmer comparisons are symmetrical (comparing A vs B gives the same answer as B vs A), BLAST comparisons in ANIb are not symmetrical (A vs B doesn't usually equal B vs A). This is because of (2) above.
  4. ANIb involves arbitrary fragmentation of input sequences to emulate in vitro DDH. The result depends on exactly how this is done, and the fragmentation doesn't really resemble the in vitro fragmentation. It's an unnecessary, unrealistic step that brings in an extra parameter you could do without. ANIm doesn't require this.

Even with the problems of the BLAST-based methods, the results are typically close enough that you don't get many "wrong" answers (calling two things the same species when they're not, or calling them different species when they're the same), but even on the grounds of speed there's no reason to use ANIb over MUMmer. ANIm is much faster.

@widdowquinn
Copy link
Owner Author

Apologies for the openpyxl error, by the way. I'm getting round to it…

@baileythegreen
Copy link
Contributor

I've currently got a dev environment without openpyxl installed (so tests are giving me this error). I will see what I can do to make it not just kill the run.

@baileythegreen
Copy link
Contributor

I've added a try/except statement around this that handles the exception and allows things to continue running, while still informing the user about the missing module.

baileythegreen added a commit that referenced this issue Jan 24, 2022
Issue #130: Add `try/except` to catch `ModuleNotFoundError` when no `openpyxl`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working how it should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants