Skip to content

Commit 0a3ba9b

Browse files
authored
Fix control methods (#109)
* improve description and enabling all control methods * update changelog again * re-enabling the shuffle by batch
1 parent 90b7dc9 commit 0a3ba9b

6 files changed

Lines changed: 49 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@
155155

156156
* Fix missing anndata in yaml file and set the base_r docker image version to 1 instead of 1.0.0 (PR #89).
157157

158-
* Fix bug in control methods (PR #107 and PR #108).
158+
* Fix bug in control methods (PR #107, #108, #109).
159+
* All control methods are updated to cater the new schema.
160+
* All control methods are re-enabled. Selectively disable them when running the pipeline using method exclude.
159161

160162

src/control_methods/shuffle_integration/config.vsh.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
__merge__: /src/api/comp_control_method.yaml
22
name: shuffle_integration
3-
label: Shuffle integration
4-
summary: Integrations are randomly permuted
5-
description: Integrations are randomly permuted
6-
status: disabled
3+
label: Shuffle Integration
4+
summary: Randomly shuffle cells in the whole dataset.
5+
description: |
6+
This negative control randomly permutes cell-to-sample (hence batch)
7+
assignments while keeping each cell's measured markers unchanged.
8+
This destroys any biological and batch specific structure but preserves marker expression.
9+
10+
Purpose:
11+
- Provide a baseline to verify that integration methods outperform
12+
random assignment of cells to batches.
13+
14+
Example:
15+
- A cell from a KO sample in batch 1 may be reassigned to any sample in the whole data.
16+
It may be reassigned to another KO sample in batch 1 or 2, or to a WT sample in batch 1 or 2.
17+
# status: disabled
718
resources:
819
- type: python_script
920
path: script.py

src/control_methods/shuffle_integration_by_batch/config.vsh.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
__merge__: /src/api/comp_control_method.yaml
22
name: shuffle_integration_by_batch
3-
label: Shuffle integration by batch
4-
summary: Integrations are randomly permuted within each batch
5-
description: Integrations are randomly permuted within each batch
3+
label: Shuffle Integration — within batches
4+
summary: Randomly reassign cells to any samples within the same batch.
5+
description: |
6+
This negative-control method randomly permutes cell-to-cell type assignments.
7+
Cells remain assigned to their original batch (batch effects preserved).
8+
Within each batch, cells are reassigned to random samples, destroying
9+
biological/sample-specific structure (e.g., KO vs WT differences).
10+
11+
Purpose:
12+
- Evaluate whether an integration method preserves differences between samples
13+
and biological groups while removing batch effects.
14+
15+
Example:
16+
- A cell from a KO sample in batch 1 may be reassigned to any sample in batch 1
17+
(KO or WT), but it will never be moved to batch 2.
618
# status: disabled
719
resources:
820
- type: python_script

src/control_methods/shuffle_integration_by_cell_type/config.vsh.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
__merge__: /src/api/comp_control_method.yaml
22
name: shuffle_integration_by_cell_type
3-
label: Shuffle integration by cell type
4-
summary: Integrations are randomly permuted within each cell type
5-
description: Integrations are randomly permuted within each cell type
3+
label: Shuffle Integration — within cell type
4+
summary: Randomly reassign cells to any cell types
5+
description: |
6+
This negative-control method randomly permutes cell-to-cell type assignments.
7+
Cells will be assigned to any cell types, regardless of their original cell type
8+
or sample of origin or batch of origin.
9+
10+
Purpose:
11+
- Evaluate whether an integration method preserves differences between cell types
12+
while removing batch effects.
13+
14+
Example:
15+
- A Neutrophil from a KO sample in batch 1 may be reassigned to any cell type
16+
(B cell, T cell, Monocyte, etc.) from any sample in any batch.
617
# status: disabled
718
resources:
819
- type: python_script

src/workflows/run_benchmark/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ resources:
8282
dependencies:
8383
- name: utils/extract_uns_metadata
8484
repository: op
85-
# - name: control_methods/shuffle_integration
85+
- name: control_methods/shuffle_integration
8686
- name: control_methods/shuffle_integration_by_batch
8787
- name: control_methods/shuffle_integration_by_cell_type
8888
- name: control_methods/no_integration

src/workflows/run_benchmark/main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ workflow auto {
99

1010
// construct list of methods and control methods
1111
methods = [
12-
// shuffle_integration,
12+
shuffle_integration,
1313
shuffle_integration_by_batch,
1414
shuffle_integration_by_cell_type,
1515
harmonypy,

0 commit comments

Comments
 (0)