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

Add examples to plotting functions #511

Merged
merged 28 commits into from
Feb 5, 2024
Merged

Add examples to plotting functions #511

merged 28 commits into from
Feb 5, 2024

Conversation

namsaraeva
Copy link
Collaborator

@namsaraeva namsaraeva commented Jan 22, 2024

Added plots:

  • sccoda
  • tasccoda - ete3 problems
  • augur - long runtime
  • enrichment
  • milo - last two plotting methods throw errors
  • mixscape

@namsaraeva namsaraeva linked an issue Jan 22, 2024 that may be closed by this pull request
@namsaraeva namsaraeva self-assigned this Jan 22, 2024
@namsaraeva namsaraeva changed the title Add examples to plotting functions Add examples to plotting functions and harmonise plotting API Jan 24, 2024
@namsaraeva
Copy link
Collaborator Author

Decided to merge the issues #458 and #447 to avoid possible conflicts in the future since I am editing docstrings.

@namsaraeva namsaraeva marked this pull request as draft January 24, 2024 16:04
@namsaraeva namsaraeva linked an issue Jan 24, 2024 that may be closed by this pull request
4 tasks
@namsaraeva
Copy link
Collaborator Author

namsaraeva commented Jan 25, 2024

A little bit more context to the tasscoda issue:

tasccoda.plot_draw_tree(mdata, tree="lineage") fails with Import Error: to use tasscoda please install ete3 with pip install ete3

even though ete3 is installed (see session info below), so I couldn't generate example plots for all tasscoda plotting functions.

session_info.txt

@namsaraeva
Copy link
Collaborator Author

Augur example code:

import pertpy as pt
adata = pt.dt.bhattacherjee()
ag_rfc = pt.tl.Augur("random_forest_classifier")

data_15 = ag_rfc.load(adata, condition_label="Maintenance_Cocaine", treatment_label="withdraw_15d_Cocaine")
adata_15, results_15 = ag_rfc.predict(data_15, random_state=None, n_threads=4)
adata_15_permute, results_15_permute = ag_rfc.predict(data_15, augur_mode="permute", n_subsamples=100, random_state=None, n_threads=4)

data_48 = ag_rfc.load(adata, condition_label="Maintenance_Cocaine", treatment_label="withdraw_48h_Cocaine")
adata_48, results_48 = ag_rfc.predict(data_48, random_state=None, n_threads=4)
adata_48_permute, results_48_permute = ag_rfc.predict(data_48, augur_mode="permute", n_subsamples=100, random_state=None, n_threads=4)
pvals = ag_rfc.predict_differential_prioritization(augur_results1=results_15, augur_results2=results_48, permuted_results1=results_15_permute, permuted_results2=results_48_permute)
ag_rfc.plot_dp_scatter(pvals)

fails too.

pvals = ag_rfc.predict_differential_prioritization(augur_results1=results_15, augur_results2=results_48, permuted_results1=results_15_permute, permuted_results2=results_48_permute) can't be calculated due to TypeError: Passing a set as an indexer is not supported. Use a list instead.

Bildschirmfoto 2024-01-25 um 12 16 09

See session info in the comment above.

@namsaraeva
Copy link
Collaborator Author

Milo:

Bildschirmfoto 2024-01-25 um 13 01 16

Couldn't find the reason for this error either

@namsaraeva namsaraeva requested a review from Zethson January 25, 2024 12:43
Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

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

Great! Generally looks good. Let's fix the issues and finish the docstrings

Copy link

codecov bot commented Feb 4, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (d49872c) 63.99% compared to head (8a37d15) 64.07%.
Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
+ Coverage   63.99%   64.07%   +0.07%     
==========================================
  Files          43       43              
  Lines        4969     4982      +13     
==========================================
+ Hits         3180     3192      +12     
- Misses       1789     1790       +1     
Files Coverage Δ
pertpy/data/__init__.py 100.00% <ø> (ø)
pertpy/data/_dataloader.py 100.00% <ø> (ø)
pertpy/data/_datasets.py 100.00% <ø> (ø)
pertpy/plot/_coda.py 100.00% <ø> (ø)
pertpy/tools/_coda/_base_coda.py 56.08% <ø> (ø)
pertpy/tools/_dialogue.py 13.70% <ø> (ø)
pertpy/tools/_distances/_distances.py 88.60% <100.00%> (ø)
pertpy/tools/_enrichment.py 52.02% <ø> (ø)
pertpy/tools/_milo.py 49.00% <ø> (ø)
pertpy/tools/_mixscape.py 79.80% <ø> (-0.20%) ⬇️
... and 4 more

@namsaraeva namsaraeva requested a review from Zethson February 4, 2024 11:27
@namsaraeva namsaraeva changed the title Add examples to plotting functions and harmonise plotting API Add examples to plotting functions Feb 4, 2024
@namsaraeva namsaraeva marked this pull request as ready for review February 4, 2024 11:28
Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

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

Thank youu!!

Could we please remove the TODOs for adding the missing previews? They'll already render which isn't pretty.

I'm confident that @Lilly-May or whoever is going to add them will be able to identify them or they can look at the state of this PR before merging

@namsaraeva namsaraeva requested a review from Zethson February 5, 2024 20:23
@Zethson Zethson merged commit ffce105 into main Feb 5, 2024
6 of 8 checks passed
@namsaraeva namsaraeva deleted the plot_example branch February 5, 2024 20:35
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.

Harmonize plotting API Add plotting example output to every plotting function
2 participants