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

local plotting #159

Merged
merged 14 commits into from
Dec 20, 2021
Merged

local plotting #159

merged 14 commits into from
Dec 20, 2021

Conversation

Lioscro
Copy link
Collaborator

@Lioscro Lioscro commented Nov 12, 2021

Support for plotting trees locally, instead of submitting to iTOL (since this is paid now...)

  • Support rectangle plots in the four cardinal directions (left, right, up, down)
  • Support polar plots (circular plots)
  • Support colorstrip annotations (where categorical/continuous/indel information is displayed as a color strip)
  • Support subclade coloring
  • Static plotting using Matplotlib
  • Interactive plotting using Plotly
  • Tutorial notebook (https://nbviewer.org/github/YosefLab/Cassiopeia/blob/tree-plotter/notebooks/local_plotting.ipynb) -- Github doesn't render plotly plots when viewing notebook.

Samples (3730_NT_T1)

Polar
image

Rectangle
image

@Lioscro Lioscro self-assigned this Nov 12, 2021
@codecov
Copy link

codecov bot commented Nov 12, 2021

Codecov Report

Merging #159 (09f6c7c) into master (3e85462) will decrease coverage by 0.08%.
The diff coverage is 87.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
- Coverage   87.11%   87.03%   -0.09%     
==========================================
  Files          73       75       +2     
  Lines        5130     5521     +391     
==========================================
+ Hits         4469     4805     +336     
- Misses        661      716      +55     
Impacted Files Coverage Δ
cassiopeia/plotting/local.py 80.62% <80.62%> (ø)
cassiopeia/plotting/utilities.py 96.79% <96.79%> (ø)
cassiopeia/mixins/errors.py 100.00% <100.00%> (ø)
cassiopeia/mixins/warnings.py 100.00% <100.00%> (ø)
cassiopeia/plotting/__init__.py 100.00% <100.00%> (ø)
cassiopeia/plotting/itol_utilities.py 59.39% <100.00%> (-10.25%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e85462...09f6c7c. Read the comment docs.

@mattjones315
Copy link
Collaborator

I'm really excited to take a look at this @Lioscro!

One quick comment -- I think this PR will really benefit from a little notebook tutorial. What do you think?

@Lioscro
Copy link
Collaborator Author

Lioscro commented Nov 13, 2021

I'm really excited to take a look at this @Lioscro!

One quick comment -- I think this PR will really benefit from a little notebook tutorial. What do you think?

Of course! Keep in mind there are still a ton of things to add to this PR, so I'll get to that eventually.

@Lioscro Lioscro marked this pull request as ready for review November 14, 2021 04:04
@Lioscro Lioscro requested review from mattjones315 and removed request for mattjones315 November 14, 2021 04:05
Copy link
Collaborator

@richardyz98 richardyz98 left a comment

Choose a reason for hiding this comment

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

Hi Joseph,
Amazing PR! The code is really clean and understandable. Thanks for this tremendous effort.

I had some clerical comments, but otherwise it looks really good.

Also, if I understand correctly, the plotting functions at the moment can only consume allele tables? I don't think it's in the scope of this PR, but perhaps we can add (and this is something I may be able to help on) functionality to consume character matrices as well?

Thanks!
Richard

cassiopeia/plotting/utilities.py Show resolved Hide resolved
cassiopeia/plotting/utilities.py Outdated Show resolved Hide resolved
cassiopeia/plotting/utilities.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
cassiopeia/plotting/local.py Outdated Show resolved Hide resolved
@Lioscro
Copy link
Collaborator Author

Lioscro commented Nov 18, 2021

Hi Joseph, Amazing PR! The code is really clean and understandable. Thanks for this tremendous effort.

I had some clerical comments, but otherwise it looks really good.

Also, if I understand correctly, the plotting functions at the moment can only consume allele tables? I don't think it's in the scope of this PR, but perhaps we can add (and this is something I may be able to help on) functionality to consume character matrices as well?

Thanks! Richard

I think that is a great idea! I'll open a new issue to implement this. I also considered doing that in this PR, but at the moment I just wanted to replicate all the important functionalities from iTOL plotting.

Copy link
Collaborator

@mattjones315 mattjones315 left a comment

Choose a reason for hiding this comment

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

Wow! I am thoroughly impressed by this fantastic PR! I don't have anything I'd like to see changed per se, but before you merge this in, can you add these functions to the documentation website? I'm happy to help if you're unfamiliar with how our docs folder works. For this reason, I'll Request Changes until we get the docs updated.

cassiopeia/plotting/local.py Show resolved Hide resolved
cassiopeia/plotting/local.py Show resolved Hide resolved
cassiopeia/plotting/local.py Show resolved Hide resolved
cassiopeia/plotting/local.py Show resolved Hide resolved
cassiopeia/plotting/local.py Show resolved Hide resolved
cassiopeia/plotting/utilities.py Show resolved Hide resolved
cassiopeia/plotting/utilities.py Show resolved Hide resolved
Copy link
Collaborator

@richardyz98 richardyz98 left a comment

Choose a reason for hiding this comment

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

Looks good to me Joseph! Thank you for clearing up all of my comments!

Copy link
Collaborator

@mattjones315 mattjones315 left a comment

Choose a reason for hiding this comment

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

This looks fantastic! Thanks so much for the hard work here. The only thing missing is the notebook tutorial on the documentation site. I'll add that in here for you.

@Lioscro Lioscro merged commit eeea3b7 into master Dec 20, 2021
@Lioscro Lioscro deleted the tree-plotter branch December 20, 2021 18:46
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.

3 participants