Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0e47b8a
refactor(singler): switch to seqera bioc container and trim deps
Mar 16, 2026
a59857f
Revert "refactor(singler): switch to seqera bioc container and trim d…
Mar 16, 2026
b272e33
refactor(containers): harmonize containers of local scanpy/anndata mo…
Mar 16, 2026
2d2caaf
refactor(containers): pin numpy=2.3.5 since 2.4 breaks upsetplot for now
Mar 16, 2026
315f5a9
refactor(containers): upgrade python=3.13.12 because of read_pickle/C…
Mar 16, 2026
9564683
fix(harmony): account for harmonypy>=0.2.0 Z_corr breaking change
Mar 16, 2026
2ab85b1
test(containers): refresh nf-test snapshots
kim-fehl Mar 16, 2026
ce358fe
refactor(collectsizes): use harmonized container with pandas and pyyaml
Mar 16, 2026
932c76b
test(containers): refresh nf-test snapshots for collectsizes
kim-fehl Mar 16, 2026
ee82013
refactor(scvi): align local scvi modules to use nf-core/modules scvi-…
Mar 16, 2026
9876c41
test(containers): refresh nf-test scvitools snapshots
kim-fehl Mar 16, 2026
f01e8d2
test(containers): refresh main_pipeline_* and default.nf snapshots
kim-fehl Mar 17, 2026
5832518
Update test snapshots
nictru Mar 17, 2026
3103feb
Add rounding to adata/entropy as a test ballon
nictru Mar 17, 2026
53df8b5
Add rounding to more modules
nictru Mar 17, 2026
9c31a8f
Attempt switch to float64 for more 'precise' rounding
nictru Mar 17, 2026
3892851
Try tweaking OMP configuration
nictru Mar 18, 2026
51cbdd8
Add some previously missed changes
nictru Mar 18, 2026
b99c5b5
Switch to variance ratio based tests for pca
nictru Mar 18, 2026
3c10d9c
Implement rounding for PCA variance ratios
nictru Mar 18, 2026
1d77e38
Update scanpy/neighbors tests to use pre-computed PCA
nictru Mar 19, 2026
26ede20
Update PCA-dependent modules
nictru Mar 19, 2026
8459eaf
Update adata/unify tests to follow latest nft-anndata api
nictru Mar 20, 2026
d93fd65
Create pca version of combined dataset and use it for adata/entrop, s…
nictru Mar 20, 2026
060264e
Fix adat/unify test 'unique' accessions
nictru Mar 20, 2026
bf78bb4
Make adata/entropy round scanpy/neighbors output to 3 decimals
nictru Mar 20, 2026
786a506
Update scimilarity environment
nictru Mar 20, 2026
29481b1
Implement deterministic sorting for rankgenesgroups
nictru Mar 21, 2026
0b98efe
Switch to pre-computed neighborhood graph
nictru Mar 21, 2026
1f0170f
Add pre-computed leiden clustering
nictru Mar 22, 2026
f7c7c11
Update harmony/combat/umap/differential_expression tests
nictru Mar 22, 2026
7593d9b
Add PCA rounding to combat
nictru Mar 22, 2026
a8ffd2a
Round harmony tests to 2 decimals
nictru Mar 22, 2026
ab3ad24
Fix integration subworkflow tests
nictru Mar 22, 2026
1932ee7
Further cleanup scanpy combat tests
nictru Mar 22, 2026
252ae8b
Update combat tests in the integrate subworkflow
nictru Mar 22, 2026
9d023a4
Update scanpy/leiden tests
nictru Mar 22, 2026
b583911
Update tests for cluster subworkflow
nictru Mar 22, 2026
0937d79
Simplify scanpy/neighbors tests
nictru Mar 22, 2026
4897c31
Update per group subworkflow tests to use precomputed clustering
nictru Mar 22, 2026
4b40cb6
Update pseudobulking subworkflow test snapshot
nictru Mar 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/local/adata/entropy/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::python=3.13.12
- conda-forge::pyyaml=6.0.3
- conda-forge::scanpy=1.11.5
- conda-forge::scanpy=1.12
5 changes: 3 additions & 2 deletions modules/local/adata/entropy/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process ADATA_ENTROPY {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/fd/fd27aeaf160eaba9a58c029e08f1da74051aa292c2fb043a5dd68fddcde3af93/data':
'community.wave.seqera.io/library/pyyaml_scanpy:3c9e9f631f45553d' }"
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/45/45339bf761a2cf0cdb058492bc37f3df8b05b363731d491d1d3a14e9ba0b8f55/data':
'community.wave.seqera.io/library/harmonypy_anndata_leidenalg_numpy_pruned:43066d5f86f18261' }"

input:
tuple val(meta), path(h5ad)
Expand All @@ -22,6 +22,7 @@ process ADATA_ENTROPY {
script:
prefix = task.ext.prefix ?: "${meta.id}_entropy"
plot_basis = task.ext.plot_basis ?: null
args = task.ext.args ?: ''
template 'entropy.py'

stub:
Expand Down
11 changes: 9 additions & 2 deletions modules/local/adata/entropy/templates/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import json
import base64
import yaml
import argparse
import shlex

os.environ["NUMBA_CACHE_DIR"] = "./tmp/numba"
os.environ["MPLCONFIGDIR"] = "./tmp/matplotlib"
Expand All @@ -19,6 +21,11 @@
entropy_col = "${entropy_col}"
prefix = "${prefix}"
adata = sc.read_h5ad("${h5ad}", backed='r')
args = "${args}"

parser = argparse.ArgumentParser()
parser.add_argument("--decimals", type=int, default=None)
params = parser.parse_args(shlex.split(args))

def entropy_of_group(group):
counts = group.value_counts(normalize=True)
Expand All @@ -30,8 +37,8 @@ def entropy_of_group(group):
colname = "${meta.id}:entropy"
adata.obs[colname] = adata.obs[group_col].map(entropies).astype(float) / np.log2(n_unique)

# Round to prevent hash inconsistencies
adata.obs[colname] = adata.obs[colname].round(3)
if params.decimals is not None:
adata.obs[colname] = adata.obs[colname].round(params.decimals)

adata.obs[[colname]].to_pickle(f"{prefix}.pkl")
adata.write_h5ad(f"{prefix}.h5ad")
Expand Down
50 changes: 12 additions & 38 deletions modules/local/adata/entropy/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,21 @@ nextflow_process {
tag "modules"
tag "modules_local"

setup {
run("SCANPY_PCA") {
script "modules/local/scanpy/pca/main.nf"
process {
"""
input[0] = channel.of([
[ id: 'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/scrnaseq/h5ad/combined_filtered_matrix.h5ad', checkIfExists: true)
]
)
input[1] = "X_pca"
"""
}
}
run("SCANPY_NEIGHBORS") {
script "modules/local/scanpy/neighbors/main.nf"
process {
"""
input[0] = SCANPY_PCA.out.h5ad
input[1] = "X_pca"
"""
}
}
run("SCANPY_LEIDEN") {
script "modules/local/scanpy/leiden/main.nf"
process {
"""
input[0] = SCANPY_NEIGHBORS.out.h5ad
input[1] = 1.0
input[2] = "leiden"
input[3] = false
"""
}
}
}

test("Should run without failures") {

config './nextflow.config'

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = SCANPY_LEIDEN.out.h5ad
input[0] = channel.of([
[ id: 'test' ],
file(params.pipelines_testdata_base_path + '/pbmc/combined_filtered_pca.h5ad', checkIfExists: true)
]
)
input[1] = 'leiden'
input[2] = 'sample'
"""
Expand All @@ -76,7 +46,11 @@ nextflow_process {
}
process {
"""
input[0] = SCANPY_LEIDEN.out.h5ad
input[0] = channel.of([
[ id: 'test' ],
file(params.pipelines_testdata_base_path + '/pbmc/combined_filtered_pca.h5ad', checkIfExists: true)
]
)
input[1] = 'leiden'
input[2] = 'sample'
"""
Expand Down
22 changes: 11 additions & 11 deletions modules/local/adata/entropy/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
]
}
],
"timestamp": "2025-06-22T15:55:46.390569411",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.3"
},
"timestamp": "2025-06-22T15:55:46.390569411"
}
},
"Should run without failures": {
"content": [
Expand All @@ -58,11 +58,11 @@
{
"id": "test"
},
"test_entropy.h5ad:md5,0ddf3491267da3afcd7d49bfb601bc39"
"test_entropy.h5ad:md5,f874063c56014bfe710f56e18e52b74f"
]
],
"1": [
"test_entropy.pkl:md5,0cce150308d3fd0a6b08795a68fea389"
"test_entropy.pkl:md5,43f99ffbaf5232c2a0841c2b3888bfd9"
],
"2": [

Expand All @@ -71,34 +71,34 @@

],
"4": [
"versions.yml:md5,fec1a6bc52548627507fb8d06e60da52"
"versions.yml:md5,06c3be8b97dfd251b6aef3221b56d5fc"
],
"h5ad": [
[
{
"id": "test"
},
"test_entropy.h5ad:md5,0ddf3491267da3afcd7d49bfb601bc39"
"test_entropy.h5ad:md5,f874063c56014bfe710f56e18e52b74f"
]
],
"multiqc_files": [

],
"obs": [
"test_entropy.pkl:md5,0cce150308d3fd0a6b08795a68fea389"
"test_entropy.pkl:md5,43f99ffbaf5232c2a0841c2b3888bfd9"
],
"plots": [

],
"versions": [
"versions.yml:md5,fec1a6bc52548627507fb8d06e60da52"
"versions.yml:md5,06c3be8b97dfd251b6aef3221b56d5fc"
]
}
],
"timestamp": "2026-03-22T09:52:42.901052235",
"meta": {
"nf-test": "0.9.2",
"nf-test": "0.9.4",
"nextflow": "25.10.2"
},
"timestamp": "2026-01-25T17:05:22.295034358"
}
}
}
5 changes: 5 additions & 0 deletions modules/local/adata/entropy/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: ADATA_ENTROPY {
ext.args = '--decimals 3'
}
}
3 changes: 2 additions & 1 deletion modules/local/adata/extend/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::anndata=0.12.7
- conda-forge::python=3.13.12
- conda-forge::anndata=0.12.10
- conda-forge::pyyaml=6.0.3
4 changes: 2 additions & 2 deletions modules/local/adata/extend/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process ADATA_EXTEND {

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/76/7612a78c6f49cfbeebf84c444ad314bf86da041588f3b0f14951e462e18a9228/data'
: 'community.wave.seqera.io/library/anndata_pyyaml:82c6914e861435f7'}"
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/45/45339bf761a2cf0cdb058492bc37f3df8b05b363731d491d1d3a14e9ba0b8f55/data'
: 'community.wave.seqera.io/library/harmonypy_anndata_leidenalg_numpy_pruned:43066d5f86f18261'}"

input:
tuple (
Expand Down
64 changes: 32 additions & 32 deletions modules/local/adata/extend/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
]
],
"2": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
],
"h5ad": [
[
Expand All @@ -38,15 +38,15 @@
]
],
"versions": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
]
}
],
"timestamp": "2026-03-16T15:14:17.984419949",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2026-01-16T22:00:29.120765286"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"Should extend with obsm data": {
"content": [
Expand All @@ -68,7 +68,7 @@
]
],
"2": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
],
"h5ad": [
[
Expand All @@ -87,15 +87,15 @@
]
],
"versions": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
]
}
],
"timestamp": "2026-03-16T15:13:53.551305616",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2026-01-16T22:00:13.25388026"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"Should extend with uns data": {
"content": [
Expand All @@ -117,7 +117,7 @@
]
],
"2": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
],
"h5ad": [
[
Expand All @@ -136,15 +136,15 @@
]
],
"versions": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
]
}
],
"timestamp": "2026-03-16T15:14:39.805580912",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2026-01-16T22:00:44.610008207"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"Should extend with obs data": {
"content": [
Expand All @@ -166,7 +166,7 @@
]
],
"2": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
],
"h5ad": [
[
Expand All @@ -185,15 +185,15 @@
]
],
"versions": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
]
}
],
"timestamp": "2026-03-16T15:13:30.793377663",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2026-01-16T21:59:57.879659481"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
},
"Should run without failures - stub": {
"content": [
Expand Down Expand Up @@ -238,11 +238,11 @@
]
}
],
"timestamp": "2026-01-16T22:01:11.948835963",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2026-01-16T22:01:11.948835963"
}
},
"Should run with no extensions": {
"content": [
Expand All @@ -264,7 +264,7 @@
]
],
"2": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
],
"h5ad": [
[
Expand All @@ -283,14 +283,14 @@
]
],
"versions": [
"versions.yml:md5,820747e56d08a1eae6b8dfb082f347a0"
"versions.yml:md5,b2a073150918c118c3858cf4e82145f7"
]
}
],
"timestamp": "2026-03-16T15:14:59.60059937",
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2026-01-16T22:00:59.998455502"
"nf-test": "0.9.4",
"nextflow": "25.10.4"
}
}
}
3 changes: 2 additions & 1 deletion modules/local/adata/merge/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::python=3.13.12
- conda-forge::pyyaml=6.0.3
- conda-forge::scanpy=1.11.5
- conda-forge::scanpy=1.12
Loading
Loading