From b200b0c33d195a49495205a69c5e3bcf412613f5 Mon Sep 17 00:00:00 2001 From: Calvin McCarter Date: Sat, 6 Sep 2025 01:13:52 -0400 Subject: [PATCH 1/3] add src/methods/condo/config.vsh.yaml --- src/methods/condo/config.vsh.yaml | 63 +++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/methods/condo/config.vsh.yaml diff --git a/src/methods/condo/config.vsh.yaml b/src/methods/condo/config.vsh.yaml new file mode 100644 index 00000000..c502b83b --- /dev/null +++ b/src/methods/condo/config.vsh.yaml @@ -0,0 +1,63 @@ +__merge__: ../../api/comp_method.yaml +name: condo +label: condo +summary: "ConDo is a feature transformation method for batch correction based on matching conditional distributions." +description: | + Confounded Domain Adaptation (ConDo) is a batch correction method that performs a linear transformation to features, to match their conditional distribution given biological variables of interest. + It will first learn (nonlinear) a conditional generative model for each batch, of the features given biological variables. + Then, it finds a linear feature transformation, either affine or location-scale, that minimizes the expected divergence between the conditional distributions. +references: + # McCarter C. + # Towards Backwards-Compatible Data with Confounded Domain Adaptation. + # Transactions on Machine Learning Research. 2024;2835-8856. + doi: + - 10.5281/zenodo.17066563 +links: + documentation: https://github.com/calvinmccarter/condo-adapter?tab=readme-ov-file#usage + repository: https://github.com/calvinmccarter/condo-adapter +info: + preferred_normalization: log_cp10k +arguments: + - name: --divergence + type: string + default: kld + description: Distributional divergence to use. + - name: --transform_type + type: string + default: affine + description: Type of linear transformation to apply + - name: --bootstrap_fraction + type: float + default: 1.0 + description: Optional random subsample of data for constrained memory settings; only applies when divergence is mmd. + - name: --n_epochs + type: integer + default: 5 + description: Number of epochs to run; only applies when divergence is mmd. + - name: --learning_rate + type: float + default: 0.001 + description: Learning rate; only applies when divergence is mmd. +resources: + - type: python_script + path: script.py + - path: /src/utils/read_anndata_partial.py +engines: + - type: docker + image: openproblems/base_pytorch_nvidia:1.0.0 + setup: + - type: python + pypi: + - condo==1.0.0 + - miceforest==5.7.0 + - numpy<2 + - pandas + - pytorch-minimize==0.0.2 + - scikit-learn + - scipy>=1.6 + - torch==1.9.0 +runners: + - type: executable + - type: nextflow + directives: + label: [midtime,midmem,midcpu,gpu] From ea54b67a0031ac377e4643034a5f3c13ce5b5b1d Mon Sep 17 00:00:00 2001 From: Calvin McCarter Date: Sat, 6 Sep 2025 01:14:15 -0400 Subject: [PATCH 2/3] add CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 859869e4..42418460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Added `method/drvi` component (PR #61). * Added `ARI_batch` and `NMI_batch` to `metrics/clustering_overlap` (PR #68). +* Added `method/condo` component (PR #80). ## Minor changes From fdd6c397ba0f7e73fe215ae8f757e4cf2709e77f Mon Sep 17 00:00:00 2001 From: Calvin McCarter Date: Sat, 6 Sep 2025 21:31:16 -0400 Subject: [PATCH 3/3] minor --- CHANGELOG.md | 2 +- src/methods/condo/config.vsh.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42418460..0f1383fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * Added `method/drvi` component (PR #61). * Added `ARI_batch` and `NMI_batch` to `metrics/clustering_overlap` (PR #68). -* Added `method/condo` component (PR #80). +* Added `method/condo` component (PR #83). ## Minor changes diff --git a/src/methods/condo/config.vsh.yaml b/src/methods/condo/config.vsh.yaml index c502b83b..bf1e3002 100644 --- a/src/methods/condo/config.vsh.yaml +++ b/src/methods/condo/config.vsh.yaml @@ -9,7 +9,7 @@ description: | references: # McCarter C. # Towards Backwards-Compatible Data with Confounded Domain Adaptation. - # Transactions on Machine Learning Research. 2024;2835-8856. + # Transactions on Machine Learning Research. 2024. doi: - 10.5281/zenodo.17066563 links: