scverse / pertpy

Perturbation Analysis in the scverse ecosystem.
https://pertpy.readthedocs.io/en/latest/
MIT License
91 stars 19 forks source link

Save perturbation and clustering labels as categorical #481

Closed Lilly-May closed 6 months ago

Lilly-May commented 6 months ago

Description of changes

Both PerturbationSpaces and ClusterSpaces add a column in .obs that stores either the perturbation name or the clustering label. For downstream processing of the data (e.g. plotting), it is required that the values are stored as categorical. By including the conversion to a categorical column in the compute methods, the user doesn't need to perform the conversion separately, thereby simplifying usage.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (3b82005) 63.93% compared to head (7ded6ba) 63.97%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #481 +/- ## ========================================== + Coverage 63.93% 63.97% +0.04% ========================================== Files 42 42 Lines 4763 4769 +6 ========================================== + Hits 3045 3051 +6 Misses 1718 1718 ``` | [Files](https://app.codecov.io/gh/theislab/pertpy/pull/481?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab) | Coverage Δ | | |---|---|---| | [...y/tools/\_perturbation\_space/\_perturbation\_space.py](https://app.codecov.io/gh/theislab/pertpy/pull/481?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-cGVydHB5L3Rvb2xzL19wZXJ0dXJiYXRpb25fc3BhY2UvX3BlcnR1cmJhdGlvbl9zcGFjZS5weQ==) | `85.95% <100.00%> (+0.15%)` | :arrow_up: | | [pertpy/tools/\_perturbation\_space/\_simple.py](https://app.codecov.io/gh/theislab/pertpy/pull/481?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=theislab#diff-cGVydHB5L3Rvb2xzL19wZXJ0dXJiYXRpb25fc3BhY2UvX3NpbXBsZS5weQ==) | `76.10% <100.00%> (+0.87%)` | :arrow_up: |