@@ -31,9 +31,7 @@ rule to_spatialdata:
3131 paths .sdata_zgroup if paths .data_path else [],
3232 conda :
3333 "sopa2"
34- threads : 2
35- resources :
36- lsf_extra = "-gpu num=1"
34+ threads : 4
3735 params :
3836 reader = args ['read' ].as_cli (),
3937 data_path = paths .data_path ,
@@ -50,7 +48,7 @@ rule tissue_segmentation:
5048 touch (paths .smk_tissue_segmentation ),
5149 conda :
5250 "sopa2"
53- threads : 2
51+ threads : 4
5452 params :
5553 tissue_segmentation = args ["segmentation" ]["tissue" ].as_cli (),
5654 sdata_path = paths .sdata_path ,
@@ -71,7 +69,7 @@ checkpoint patchify_image:
7169 sdata_path = paths .sdata_path ,
7270 conda :
7371 "sopa2"
74- threads : 2
72+ threads : 4
7573 shell :
7674 """
7775 sopa patchify image {params.sdata_path} {params.patchify_image}
@@ -90,7 +88,7 @@ checkpoint patchify_transcripts:
9088 sdata_path = paths .sdata_path ,
9189 conda :
9290 "sopa2"
93- threads : 2
91+ threads : 4
9492 shell :
9593 """
9694 sopa patchify transcripts {params.sdata_path} {params.patchify_transcripts}
@@ -104,7 +102,6 @@ rule patch_segmentation_cellpose:
104102 paths .smk_cellpose_temp_dir / "{index}.parquet" ,
105103 conda :
106104 "sopa2"
107- threads : 2
108105 resources :
109106 lsf_extra = "-gpu num=1"
110107 params :
@@ -127,6 +124,8 @@ rule patch_segmentation_baysor:
127124 sdata_path = paths .sdata_path ,
128125 shell :
129126 """
127+ ml gcc/11.2.0
128+
130129 export JULIA_NUM_THREADS={resources.cpus_per_task} # parallelize within each patch for Baysor >= v0.7
131130
132131
@@ -167,7 +166,7 @@ rule resolve_cellpose:
167166 touch (paths .smk_cellpose_boundaries ),
168167 conda :
169168 "sopa2"
170- threads : 2
169+ threads : 4
171170 params :
172171 sdata_path = paths .sdata_path ,
173172 shell :
@@ -183,7 +182,7 @@ rule resolve_baysor:
183182 touch (paths .smk_table ),
184183 conda :
185184 "sopa2"
186- threads : 2
185+ threads : 4
187186 params :
188187 resolve = args .resolve_transcripts (),
189188 sdata_path = paths .sdata_path ,
@@ -203,7 +202,7 @@ rule resolve_comseg:
203202 touch (paths .smk_table ),
204203 conda :
205204 "sopa2"
206- threads : 2
205+ threads : 4
207206 params :
208207 resolve = args .resolve_transcripts (),
209208 sdata_path = paths .sdata_path ,
@@ -232,12 +231,18 @@ rule aggregate:
232231 touch (paths .smk_aggregation ),
233232 conda :
234233 "sopa2"
235- threads : 2
234+ threads : 4
236235 params :
237236 aggregate = args ["aggregate" ].as_cli (),
238237 sdata_path = paths .sdata_path ,
238+ gene_exclude_pattern = config .get ("gene_exclude_pattern" , "negcontrol.*|blank.*|antisense.*|unassigned.*|deprecated.*|intergenic.*" ),
239239 shell :
240240 """
241+ python -c "
242+ import sopa
243+ pattern = '{params.gene_exclude_pattern}'
244+ sopa.settings.gene_exclude_pattern = None if pattern == 'None' else pattern
245+ "
241246 sopa aggregate {params.sdata_path} {params.aggregate}
242247 """
243248
@@ -248,7 +253,7 @@ rule annotate:
248253 directory (paths .annotations ),
249254 conda :
250255 "sopa2"
251- threads : 2
256+ threads : 4
252257 resources :
253258 lsf_extra = "-gpu num=1"
254259 params :
@@ -289,7 +294,7 @@ rule image_write:
289294 paths .explorer_image ,
290295 conda :
291296 "sopa2"
292- threads : 2
297+ threads : 4
293298 params :
294299 explorer = args ["explorer" ].as_cli (keys = ['lazy' , 'ram_threshold_gb' , 'pixel_size' , 'pixelsize' ]),
295300 sdata_path = paths .sdata_path ,
@@ -312,7 +317,7 @@ rule report:
312317 report = paths .report ,
313318 conda :
314319 "sopa2"
315- threads : 2
320+ threads : 4
316321 shell :
317322 """
318323 sopa report {params.sdata_path} {params.report}
@@ -328,7 +333,7 @@ rule explorer:
328333 paths .explorer_experiment ,
329334 conda :
330335 "sopa2"
331- threads : 2
336+ threads : 4
332337 params :
333338 explorer = args ["explorer" ].as_cli (),
334339 sdata_path = paths .sdata_path ,
0 commit comments