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

Make Heatmap/dendogram figure just from ANI matrix table? #85

Closed
TonyMannion opened this issue Jun 5, 2017 · 13 comments
Closed

Make Heatmap/dendogram figure just from ANI matrix table? #85

TonyMannion opened this issue Jun 5, 2017 · 13 comments
Assignees
Labels
question how can I do this? why does it do that? where can I get this? etc.

Comments

@TonyMannion
Copy link

TonyMannion commented Jun 5, 2017

I have an ANI matrix table that I calculated using a different program, but I like the heatmap/dendogram output generated by pyani. Is it possible to use my ANI results to create a heatmap/dendogram figure using pyani code?

Thank you!

Tony

@widdowquinn
Copy link
Owner

Hi Tony,

If it's named appropriately (with corresponding class and label files as appropriate), you could drop it into a results directory and use the --rerender options.

If you're comfortable in Python you could import pyani as a package in Python, load your matrix as a pandas dataframe, and use the pyani_graphics module functions, e.g. call heatmap_seaborn().

Cheers,

L.

@widdowquinn widdowquinn self-assigned this Jun 5, 2017
@widdowquinn widdowquinn added the question how can I do this? why does it do that? where can I get this? etc. label Jun 5, 2017
@TonyMannion
Copy link
Author

TonyMannion commented Jun 5, 2017 via email

@widdowquinn
Copy link
Owner

Would you be able to provide the .tab file before and after the change you made?

@TonyMannion
Copy link
Author

TonyMannion commented Jun 5, 2017 via email

@widdowquinn
Copy link
Owner

I can't see any files on the thread. Do you see them?

@widdowquinn
Copy link
Owner

I think you sent your last comment by email. This strips out attachments. Would you be able to drag-and-drop the files into this thread on GitHub, please?

@TonyMannion
Copy link
Author

I did attach them in my email response, sorry about that! Now attached in the zip folder.

Mannion_GitHub.zip

@widdowquinn
Copy link
Owner

Hi Tony - pyani requires all the .tab files for a rerender - could you please attach a .zip with all the relevant output?

@widdowquinn
Copy link
Owner

For info, I've attempted to reproduce this with the test data provided in the repository.

First, I generated specific output data:

average_nucleotide_identity.py -i tests/test_ani_data/ -o tests/issue_85 -m ANIm -g --gmethod seaborn -v -l issue_85.log

Then copied this to a new location:

cp -R tests/issue_85 tests/issue_85_after

I modified the ANIm_percentage_identity.tab data in a similar way to your modification, replacing 1.0 values on the diagonal with 0.5 (this makes no biological sense, BTW - it implies a sequence has only 50% identity with itself), and then ran the rerender:

average_nucleotide_identity.py -i tests/test_ani_data/ -o tests/issue_85_after -m ANIm -g --gmethod seaborn -v -l issue_85_rerender.log --rerender

This gave the same error you see:

INFO: Graphics method: seaborn
Traceback (most recent call last):
  File "/Users/lpritc/Documents/Development/pyani/venv-pyani-devel/bin/average_nucleotide_identity.py", line 4, in <module>
    __import__('pkg_resources').run_script('pyani==0.2.3', 'average_nucleotide_identity.py')
  File "/Users/lpritc/Documents/Development/pyani/venv-pyani-devel/lib/python3.6/site-packages/pkg_resources/__init__.py", line 738, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/lpritc/Documents/Development/pyani/venv-pyani-devel/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1506, in run_script
    exec(script_code, namespace, namespace)
  File "/Users/lpritc/Documents/Development/pyani/venv-pyani-devel/lib/python3.6/site-packages/pyani-0.2.3-py3.6.egg/EGG-INFO/scripts/average_nucleotide_identity.py", line 791, in <module>
  File "/Users/lpritc/Documents/Development/pyani/venv-pyani-devel/lib/python3.6/site-packages/pyani-0.2.3-py3.6.egg/EGG-INFO/scripts/average_nucleotide_identity.py", line 620, in draw
AttributeError: 'bool' object has no attribute 'info'

But so does the unmodified output:

average_nucleotide_identity.py -i tests/test_ani_data/ -o tests/issue_85 -m ANIm -g --gmethod seaborn -v -l issue_85_rerender.log --rerender

So this is an issue with the rerender code in general. I'll get onto it.

@widdowquinn
Copy link
Owner

OK - I've found the issue, and I'll push the change in a few minutes.

Before:

anim_percentage_identity

After:

anim_percentage_identity

widdowquinn added a commit that referenced this issue Jun 6, 2017
widdowquinn added a commit that referenced this issue Jun 6, 2017
@widdowquinn
Copy link
Owner

That's the fix implemented with commit 99bb596 - please could you clone the latest version, install, and check it works for you?

@TonyMannion
Copy link
Author

Works perfectly now! Thank you so much!

Best,
Tony

@widdowquinn
Copy link
Owner

No worries - please raise another issue if you get any problems.

L.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question how can I do this? why does it do that? where can I get this? etc.
Projects
None yet
Development

No branches or pull requests

2 participants