@@ -53,7 +53,7 @@ def run_neighbors(outfile):
53
53
if any ([PARAMS ['neighbors' ][mod ]['use_existing' ] is False for mod in mods ]):
54
54
# this means we want to rerun neighbors for at least one assay
55
55
#we want to replace thhe scaled obj with the new neighbors
56
- log_file = "logs/run_single_mod_neighbors .log"
56
+ log_file = "logs/1_run_neighbors .log"
57
57
cmd = """
58
58
python %(py_path)s/rerun_find_neighbors_for_clustering.py \
59
59
--infile %(scaled_obj)s \
@@ -88,7 +88,7 @@ def gen_umap_jobs():
88
88
for md in PARAMS ['umap' ][mod ]['mindist' ]:
89
89
if PARAMS ['umap' ][mod ]['mindist' ] is not None :
90
90
output_file = os .path .join (mod , 'md' + str (md ) + "_umap.txt.gz" )
91
- log_file = os .path .join ("logs" ,"_" .join ([mod , 'md ' + str (md ) + "_umap .log" ]))
91
+ log_file = os .path .join ("logs" ,"_" .join (["2_run_UMAP" , mod + '_md ' + str (md ) + " .log" ]))
92
92
yield [infile , output_file , mod , md , log_file ]
93
93
94
94
@follows (run_neighbors )
@@ -132,7 +132,7 @@ def gen_cluster_jobs():
132
132
if PARAMS ['clusterspecs' ][mod ]['resolutions' ] is not None :
133
133
alg = PARAMS ['clusterspecs' ][mod ]['algorithm' ]
134
134
output_file = os .path .join (mod , 'alg' + alg + '_res' + str (res ), "clusters.txt.gz" )
135
- log_file = os .path .join ("logs" , "_" .join ([mod , 'alg ' + alg + '_res' + str (res ), "clusters .log" ]))
135
+ log_file = os .path .join ("logs" , "_" .join (["3_run_clustering_" , mod + '_alg ' + alg + '_res' + str (res ), ".log" ]))
136
136
yield [infile , output_file , mod , res , alg , log_file ]
137
137
138
138
@follows (set_up_dirs )
@@ -160,13 +160,11 @@ def calc_cluster(infile, outfile, mod, res, alg, log_file):
160
160
regex ("(.*)/(.*)/clusters.txt.gz" ),
161
161
r"\1/all_res_clusters_list.txt.gz" )
162
162
def aggregate_clusters (infiles , outfile ):
163
- print (infiles )
164
- print (outfile )
165
163
infiles_str = ',' .join (infiles )
166
164
cmd = "python %(py_path)s/aggregate_csvs.py \
167
165
--input_files_str %(infiles_str)s \
168
166
--output_file %(outfile)s \
169
- --clusters_or_markers clusters > logs/aggregate_clusters .log"
167
+ --clusters_or_markers clusters > logs/4_aggregate_clusters .log"
170
168
job_kwargs ["job_threads" ] = PARAMS ['resources_threads_low' ]
171
169
P .run (cmd , ** job_kwargs )
172
170
@@ -197,14 +195,14 @@ def collate_mdata(infiles,outfile):
197
195
cmd += "--input_mudata %(mdata_in)s"
198
196
else :
199
197
cmd += "--input_mudata %(full_obj)s"
200
- cmd += " > logs/collate_data .log"
198
+ cmd += " > logs/5_collate_data .log"
201
199
job_kwargs ["job_threads" ] = PARAMS ['resources_threads_medium' ]
202
200
P .run (cmd , ** job_kwargs )
203
201
204
202
205
203
@transform (collate_mdata ,
206
204
formatter ("" ),
207
- 'logs/plot_clusters_umaps .log' )
205
+ 'logs/6_plot_clusters_umaps .log' )
208
206
def plot_cluster_umaps (infile , log_file ,):
209
207
# get associated umap
210
208
mods = [key for key , value in PARAMS ['modalities' ].items () if value is True ]
@@ -219,8 +217,9 @@ def plot_cluster_umaps(infile, log_file,):
219
217
job_kwargs ["job_threads" ] = PARAMS ['resources_threads_medium' ]
220
218
P .run (cmd , jobs_limit = 1 , ** job_kwargs )
221
219
220
+
222
221
@transform (aggregate_clusters , regex ("(.*)/all_res_clusters_list.txt.gz" ),
223
- r'logs/\1_clustree .log' ,
222
+ r'logs/7_\1_run_clustree .log' ,
224
223
r'\1/figures/clustree.png' , )
225
224
def plot_clustree (infile , log_file , outfile ):
226
225
# convert infiles to comma sep. string
@@ -260,7 +259,7 @@ def gen_marker_jobs(infile, outfile, base_dir):
260
259
@follows (collate_mdata )
261
260
@transform (gen_marker_jobs ,
262
261
regex ("(.*)/(.*)/(.*)_markers.txt" ),
263
- r"logs/\1_\2_\3_markers .log" ,
262
+ r"logs/8_find_markers_ \1_\2_\3 .log" ,
264
263
r"\1/\2/\3_markers" ,
265
264
r"\1" ,
266
265
r"\1/\2" ,
@@ -324,7 +323,7 @@ def find_markers(infile, log_file, outfile_prefix, base_mod, cluster_dir, data_m
324
323
@follows (find_markers )
325
324
@transform (gen_marker_jobs ,
326
325
regex (r"(.*)/alg(.*)/(.*)_markers.txt" ),
327
- r"logs/cluster \1_alg\2_exprs_\3_dotplots .log" ,
326
+ r"logs/9_plot_markers_ \1_alg\2_exprs_\3 .log" ,
328
327
r"\1/alg\2/figures/dotplot_top_markers_\3.png" ,
329
328
r"\1/alg\2/figures" ,
330
329
r"\1" , r"\2" , r"\3" )
0 commit comments