-
Notifications
You must be signed in to change notification settings - Fork 270
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
Added heatmap plotting method to Alignment (and tests). #779
Conversation
Thanks @Kleptobismol, looking forward to trying this out! |
Thanks @Kleptobismol, I'll take a pass through later today. |
@@ -9,7 +9,7 @@ | |||
* Added `skbio.stats.power` for performing emperical power analysis. The module uses existing datasets and iteratively draws samples to estimate the number of samples needed to see a significant difference for a given critical value. | |||
* Added `skbio.stats.isubsample` for subsampling from an unknown number of values. This method supports subsampling from multiple partitions and does not require that all items be stored in memory, requiring approximately `O(N*M)`` space where `N` is the number of partitions and `M` is the maximum subsample size. | |||
* Added ``skbio.stats.subsample_counts``, which replaces ``skbio.stats.subsample``. See deprecation section below for more details ([#770](https://github.com/biocore/scikit-bio/issues/770)). | |||
|
|||
* Added ``heatmap`` method to ``skbio.alignment.Alignment`` for creating a heatmap from an alignment (see [#765](https://github.com/biocore/scikit-bio/issues/765)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a newline below here to separate this section from the bug fixes section
This may be a rather general comment but is there a reason why this method doesn't use seaborn to produce the heat map? See this link. |
I think using |
👍 for using seaborn. Let's get this merged first and then update all of the existing plotting methods to use seaborn in another pull request ( |
Also fig_size defaults to None, and so does cmap.
@@ -1668,6 +1671,125 @@ def to_phylip(self, map_labels=False, label_prefix=""): | |||
|
|||
return '\n'.join(result), new_id_to_old_id | |||
|
|||
def heatmap(self, value_map, legend_labels=['Minimum', 'Median', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't catch this before: the default value for legend_labels
should be changed to a tuple instead of a list (see here for an explanation why).
@Kleptobismol done reviewing |
What variable should I be passing to np.empty? It says it requires a "shape" argument (pos1) |
nevermind it's between sequence_length and sequence_count |
The docstring entries about the X and Y axis labels are likely in the wrong place.
What do i do about this? |
@Kleptobismol That happens when travis has a network error. I'm rerunning the tests, they should pass fine this time. |
Strange, the python3 test loads the docs fine, but the tests fail. Python2 the tests succeed, but the docs won't load. |
So i didn't do anything wrong? |
@@ -11,6 +11,7 @@ | |||
* Added `skbio.stats.power` for performing empirical power analysis. The module uses existing datasets and iteratively draws samples to estimate the number of samples needed to see a significant difference for a given critical value. | |||
* Added `skbio.stats.isubsample` for subsampling from an unknown number of values. This method supports subsampling from multiple partitions and does not require that all items be stored in memory, requiring approximately `O(N*M)`` space where `N` is the number of partitions and `M` is the maximum subsample size. | |||
* Added ``skbio.stats.subsample_counts``, which replaces ``skbio.stats.subsample``. See deprecation section below for more details ([#770](https://github.com/biocore/scikit-bio/issues/770)). | |||
* Added ``heatmap`` method to ``skbio.alignment.Alignment`` for creating a heatmap from an alignment (see [#765](https://github.com/biocore/scikit-bio/issues/765)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move this under a Features
heading in the 0.2.2-dev section?
@Kleptobismol I took another pass through, please see my comments inline. Thanks! |
@Kleptobismol sorry for the delay on this. I'm pulling your commits to make some minor edits and to play around with the code a bit. I'll submit a new pull request sometime today that has your commits plus my changes. |
Closing in favor of #816. |
Fixes #765
Based on @gregcaporaso's scikit-bio cookbook recipe:
http://nbviewer.ipython.org/github/biocore/scikit-bio-cookbook/blob/master/Alignment%20viewing%20and%20filtering.ipynb