Skip to content

Update ilisi and add functional marker based metrics - #126

Merged
ghar1821 merged 24 commits into
mainfrom
update_ilisi
Jul 23, 2026
Merged

Update ilisi and add functional marker based metrics#126
ghar1821 merged 24 commits into
mainfrom
update_ilisi

Conversation

@ghar1821

@ghar1821 ghar1821 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Summary

New metric metrics/functional_marker_preservation: evaluates whether batch integration preserves biologically meaningful differences in functional marker expression between two groups (e.g. WT vs KO):

  • functional_marker_preservation_wilcoxon: proportion of (marker, cell type) pairs which differences are statistically significant (through Wilcoxon rank-sum) between groups unintegrated that remain significant in post integration.
  • functional_marker_preservation_cohens_d: mean absolute change in Cohen's d effect size, computed for every pair that is significant (from wilcoxon above) in the unintegrated baseline.

Updated metrics/lisi: iLISI is still computed globally across all cells per split (not per group), but is now skipped and returns NaN for a split if batch is confounded by group in any group — i.e. a group whose cells all come from a single batch, so cross-batch mixing can't be assessed for it. The iLISI/cLISI computation was moved out of script.py into a new helper.py (compute_ilisi, compute_clisi, _check_batch_group_confounding), and the output uns was expanded to include per-cell iLISI/cLISI values and cell IDs for each split.

Updated methods/harmonypy: switched to the PyTorch GPU backend (harmonypy≥0.2.0) using new openproblems/base_pytorch_nvidia:1.0.0 image, automatic GPU detection, removed the manual epsilon workaround, and updated the Nextflow label to lowcpu, gpu.

Updated metrics/flowsom_mapping_similarity: mapping similarity is now computed bidirectionally (split1→split2 and split2→split1), and per-donor cluster×cell_type absolute-difference matrices are exported in the output uns.

Added scripts/adhoc_runs/run_metric_adhoc.py + .sh which re-runs a single metric against existing pipeline output by injecting a VIASH block and running it as a subprocess, discovering (dataset, method) pairs automatically, with a skip-existing option. Lets you iterate on metric code without re-running the full Nextflow pipeline.

Added scripts/fetch_intermediate_files.py which consolidate the previous two-step log-parsing/file-copying process into one script that auto-detects SLURM vs AWS Batch runs and organizes output under <dataset>/method_out/ and <dataset>/metric_out/.
This replaces the old find_intermediate_files.py and download_intermediate_files.py and copy_intermediate_files.py.

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

ghar1821 added 24 commits April 9, 2026 09:43
- iLISI is now computed per group; groups where batch is fully
  confounded by group are skipped and return NaN
- Refactored cLISI calculation into helper.py
- Added compute_ilisi_per_group and compute_clisi to helper.py
- Updated CHANGELOG.md
- Switch Docker image to base_pytorch_nvidia:1.0.0
- Pin harmonypy>=0.2.0 and add torch dependency
- Pass device=None to run_harmony for auto GPU detection
- Remove epsilon workaround as harmonypy v0.2.0 handles
  numerical stability internally via clamping and L2 normalisation
- Update Nextflow label to lowcpu, gpu
- Update CHANGELOG.md
@ghar1821
ghar1821 merged commit 79a262f into main Jul 23, 2026
65 of 66 checks passed
@rcannood
rcannood deleted the update_ilisi branch September 8, 2026 09:37
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.

1 participant