You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noting down issues to fix and potential improvements to milopy, encountered while writing tutorial (scverse/pertpy-tutorials#4) - issues entirely inherited from my code ofc :)
milo.add_covariate_to_nhoods_var
change name to add_covariate_to_nhoods_obs and update docs
Check types of added columns (e.g. can go from category to object and then nhood_counts_by_cond complains
pt.pl.milo.nhood_counts_by_cond
add informative error for when covariate is missing (directing to use add_covariate_to_nhoods_var)
convert strings to categoricals internally (or add informative errors for dtype object)
milo.da_nhoods:
at the moment the use of subset_samples and subset_nhoods is buggy, in some edge cases this messes up the SpatialFDR calculation. While the bug is easy enough to catch with diagnostic plots (randomized SpatialFDR) and to fix (Misc bug fixes emdann/milopy#30), I'm wondering whether these parameters should be dropped completely in the new implementation in pertpy. The use case of subset_samples is essentially covered by specifying contrasts (+ adding a new column in adata.obs if needed to specify groups). Using subset_nhoods is somewhat of a pathological hack (I don't think I've ever used it and I can't even remember the original use case for adding this parameter). In practice if one wants to test on a specific subset of cell phenotypes the best solution is to subset cells and restart from KNN graph building.
Add informative errors for missing columns in model matrix (i.e. when the reference level is specified in contrasts)
Noting down issues to fix and potential improvements to milopy, encountered while writing tutorial (scverse/pertpy-tutorials#4) - issues entirely inherited from my code ofc :)
milo.add_covariate_to_nhoods_varadd_covariate_to_nhoods_obsand update docscategorytoobjectand thennhood_counts_by_condcomplainspt.pl.milo.nhood_counts_by_condadd_covariate_to_nhoods_var)milo.da_nhoods:subset_samplesandsubset_nhoodsis buggy, in some edge cases this messes up the SpatialFDR calculation. While the bug is easy enough to catch with diagnostic plots (randomized SpatialFDR) and to fix (Misc bug fixes emdann/milopy#30), I'm wondering whether these parameters should be dropped completely in the new implementation in pertpy. The use case ofsubset_samplesis essentially covered by specifying contrasts (+ adding a new column in adata.obs if needed to specify groups). Usingsubset_nhoodsis somewhat of a pathological hack (I don't think I've ever used it and I can't even remember the original use case for adding this parameter). In practice if one wants to test on a specific subset of cell phenotypes the best solution is to subset cells and restart from KNN graph building.Happy to open a PR to implement these changes.