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

added ArrayPloter and plotepiscan into Biotite #485

Merged
merged 18 commits into from
Oct 23, 2023

Conversation

ferrervi
Copy link
Contributor

I am willing to generalize ArrayPlotter as much as possible but It was not immediately clear to me how to do that . Comments and help are very appreciated.
thanks

@padix-key
Copy link
Member

Hi, thank you for contributing your work! I will probably need a few days for a proper review, but here are some initial comments:

  • Your commits also include the Jupyter notebook checkpoint files (the ipynb_checkpints ones). Could you remove them? This can be done with git rm and giving the directory names (with additional -r option).
  • The signalarray.py content is quite specific to the actual application you provide. Therefore, I would not put it into sequence.graphics, but put its functions directly into plotepiscan.py.

@ferrervi
Copy link
Contributor Author

ferrervi commented Aug 1, 2023

Hi, I incorporated your suggestions and updated the PR. Thank you.
🙂

@padix-key
Copy link
Member

padix-key commented Aug 2, 2023

Thanks. I am on vacation for a week in a few days, so maybe I will not be able to review your contribution before it.

Copy link
Member

@padix-key padix-key left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I would mainly request only some style changes, for which I made suggestions. Please check if the line length is still OK after accepting the suggestions. Furthermore I would propose that you add pandas to environment.yml, so that your example can be run in the automatic build of the documentation. In addition you might also add yourself to CONTRIB.rst, if you like! I might bring up some additional points, as soon as I had time to execute you example.

doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Show resolved Hide resolved
Copy link
Member

@padix-key padix-key left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry for the delay, but finally I found time to finish the review. It looks mostly fine to me, there are mainly some small typos and docstring changes I would like to request.

doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Outdated Show resolved Hide resolved
src/biotite/sequence/graphics/alignment.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
########################################################################
# Create a signal map
# -------------------

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix rendering

Suggested change
#

doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved

super().__init__(axes, color_symbols, font_size, font_param)
self.fl_score = fl_score
self._cmap = self._generate_colormap(colors["dimorange"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the following lines call set_color:

if color is not None or cmap is not None:
symbol_plotter.set_color(color=color, cmap=cmap)

I tested setting the color parameter in plot_alignment_array() in your example and it would lead to:

AttributeError: 'ArrayPlotter' object has no attribute 'set_color'

doc/examples/scripts/sequence/plotepiscan.py Outdated Show resolved Hide resolved
@padix-key
Copy link
Member

Hi, thanks for implementing the suggestions. The final plot has still some issue with its colorbar. If you cannot reproduce it, I will have a look on on it.

@ferrervi
Copy link
Contributor Author

I fixed the rendering of the final plot. It should be displaying correctly now. Thank you.

@padix-key
Copy link
Member

Looks good to me. I would merge this PR as soon as the tests pass, if you are ready.

@padix-key padix-key merged commit 4f90c0d into biotite-dev:master Oct 23, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants