Skip to content

Commit

Permalink
Fix Celltyping OOM (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffquinn-msk authored Nov 21, 2024
1 parent 5e2866f commit b87b264
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nextflow/modules/nf-core/celltyping/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process CELLTYPING {
tag "$meta.id"
label 'process_low'
label 'process_high_memory'
container "${ workflow.containerEngine == 'apptainer' && !task.ext.singularity_pull_docker_container ?
('docker://jeffquinnmsk/nuc2seg:' + params.nuc2seg_version) :
('docker.io/jeffquinnmsk/nuc2seg:' + params.nuc2seg_version) }"
Expand Down
4 changes: 2 additions & 2 deletions src/nuc2seg/celltyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def fit_celltype_em_model(
gene_counts,
gene_names,
min_components=2,
max_components=25,
max_components=20,
max_em_steps=100,
tol=1e-4,
warm_start=False,
Expand Down Expand Up @@ -270,7 +270,7 @@ def fit_celltyping_on_segments_and_transcripts(
tx_geo_df: geopandas.GeoDataFrame,
foreground_nucleus_distance: float = 1,
min_components: int = 2,
max_components: int = 25,
max_components: int = 20,
rng: np.random.Generator = None,
):
# Create a nuclei x gene count matrix
Expand Down
6 changes: 3 additions & 3 deletions src/nuc2seg/celltyping_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_estimate_cell_types2():
data,
gene_names=[f"gene_{i}" for i in range(n_genes)],
min_components=2,
max_components=25,
max_components=5,
max_em_steps=10,
tol=1e-4,
warm_start=False,
Expand All @@ -88,8 +88,8 @@ def test_estimate_cell_types2():
celltyping_results.relative_expression,
)

assert len(aic_scores) == 24
assert len(bic_scores) == 24
assert len(aic_scores) == 4
assert len(bic_scores) == 4
assert aic_scores.argmin() == bic_scores.argmin() == 1


Expand Down
2 changes: 1 addition & 1 deletion src/nuc2seg/cli/celltyping.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_parser():
"--max-n-celltypes",
help="Maximum number of cell types to consider (inclusive).",
type=int,
default=25,
default=20,
)
parser.add_argument(
"--min-n-celltypes",
Expand Down

0 comments on commit b87b264

Please sign in to comment.