Skip to content

Commit 2f146df

Browse files
authored
Various memory and method fixes (#53)
1 parent 27a08e6 commit 2f146df

File tree

12 files changed

+26
-12
lines changed

12 files changed

+26
-12
lines changed

src/methods_cell_type_annotation/moscot/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ runners:
5757
- type: executable
5858
- type: nextflow
5959
directives:
60-
label: [ midtime, midcpu, midmem ]
60+
label: [ hightime, midcpu, veryhighmem ]

src/methods_cell_type_annotation/ssam/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ runners:
3535
- type: executable
3636
- type: nextflow
3737
directives:
38-
label: [ midtime, midcpu, midmem ]
38+
label: [ hightime, midcpu, midmem ]

src/methods_expression_correction/resolvi_correction/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ runners:
5454
- type: executable
5555
- type: nextflow
5656
directives:
57-
label: [ midtime, highcpu, highmem ]
57+
label: [ hightime, highcpu, highmem, gpu ]

src/methods_normalization/spanorm/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ runners:
3636
- type: executable
3737
- type: nextflow
3838
directives:
39-
label: [ midtime, lowcpu, lowmem ]
39+
label: [ veryhightime, midcpu, highmem ]

src/methods_normalization/spanorm/script.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,17 @@ spatial_coords <- matrix(c(centroid_x, centroid_y), ncol = 2)
2626
spatialCoords(sce) <- spatial_coords
2727

2828
# Apply SpaNorm normalization to the spatial data
29-
result <- SpaNorm(sce)
29+
set.seed(777)
30+
31+
# Calculate sample.p based on number of cells (following recommendations of https://github.com/bhuvad/SpaNorm/issues/10#issuecomment-2918248535)
32+
n_cells <- ncol(sce)
33+
if (n_cells > 100000) {
34+
sample_p <- 25000 / n_cells
35+
} else {
36+
sample_p <- 0.25
37+
}
38+
39+
result <- SpaNorm(sce, sample.p = sample_p)
3040

3141
# Get the normalized matrix from SpaNorm result (log-transformed normalized counts)
3242
normalized_matrix <- assay(result, "logcounts")

src/methods_segmentation/binning/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ runners:
3333
- type: executable
3434
- type: nextflow
3535
directives:
36-
label: [ midtime, midcpu, midmem ]
36+
label: [ midtime, midcpu, highmem ]

src/methods_segmentation/cellpose/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ runners:
9393
- type: executable
9494
- type: nextflow
9595
directives:
96-
label: [ midtime, midcpu, highmem, gpu ]
96+
label: [ midtime, midcpu, veryhighmem, gpu ]

src/methods_transcript_assignment/basic_transcript_assignment/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ runners:
3535
- type: executable
3636
- type: nextflow
3737
directives:
38-
label: [ midtime, lowcpu, lowmem ]
38+
label: [ midtime, midcpu, midmem ]

src/methods_transcript_assignment/baysor/config.vsh.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ runners:
110110
- type: executable
111111
- type: nextflow
112112
directives:
113-
label: [ midtime, midcpu, midmem ]
113+
label: [ veryhightime, midcpu, highmem ]

src/methods_transcript_assignment/baysor/script.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
}
3030
meta = {
3131
'name': 'baysor_transcript_assignment',
32-
'temp_dir': "./temp/methods/baysor"
32+
'temp_dir': "./temp/methods/baysor",
33+
'cpus': 4,
3334
}
3435
## VIASH END
3536

@@ -96,6 +97,9 @@
9697

9798

9899
# Run Baysor
100+
n_threads = meta['cpus'] or os.cpu_count()
101+
n_threads = max(n_threads-2, 1)
102+
os.environ['JULIA_NUM_THREADS'] = str(n_threads)
99103
print('Running Baysor', flush=True)
100104
baysor_cmd = f"baysor run -c {CONFIG_TOML} -o {BAYSOR_OUTPUT} {TRANSCRIPTS_CSV} {SEGMENTATION_TIF}"
101105
print("\t" + baysor_cmd, flush=True)

0 commit comments

Comments
 (0)