Skip to content

Commit 7b5ad47

Browse files
author
SarahOuologuem
committed
rename log files
1 parent 5a09f00 commit 7b5ad47

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

panpipes/panpipes/pipeline_clustering.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run_neighbors(outfile):
5353
if any([PARAMS['neighbors'][mod]['use_existing'] is False for mod in mods]):
5454
# this means we want to rerun neighbors for at least one assay
5555
#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"
5757
cmd="""
5858
python %(py_path)s/rerun_find_neighbors_for_clustering.py \
5959
--infile %(scaled_obj)s \
@@ -88,7 +88,7 @@ def gen_umap_jobs():
8888
for md in PARAMS['umap'][mod]['mindist']:
8989
if PARAMS['umap'][mod]['mindist'] is not None:
9090
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"]))
9292
yield [infile, output_file, mod, md, log_file]
9393

9494
@follows(run_neighbors)
@@ -132,7 +132,7 @@ def gen_cluster_jobs():
132132
if PARAMS['clusterspecs'][mod]['resolutions'] is not None:
133133
alg = PARAMS['clusterspecs'][mod]['algorithm']
134134
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"]))
136136
yield [infile, output_file, mod, res, alg, log_file]
137137

138138
@follows(set_up_dirs)
@@ -160,13 +160,11 @@ def calc_cluster(infile, outfile, mod, res, alg, log_file):
160160
regex("(.*)/(.*)/clusters.txt.gz"),
161161
r"\1/all_res_clusters_list.txt.gz")
162162
def aggregate_clusters(infiles, outfile):
163-
print(infiles)
164-
print(outfile)
165163
infiles_str = ','.join(infiles)
166164
cmd = "python %(py_path)s/aggregate_csvs.py \
167165
--input_files_str %(infiles_str)s \
168166
--output_file %(outfile)s \
169-
--clusters_or_markers clusters > logs/aggregate_clusters.log"
167+
--clusters_or_markers clusters > logs/4_aggregate_clusters.log"
170168
job_kwargs["job_threads"] = PARAMS['resources_threads_low']
171169
P.run(cmd, **job_kwargs)
172170

@@ -197,14 +195,14 @@ def collate_mdata(infiles,outfile):
197195
cmd += "--input_mudata %(mdata_in)s"
198196
else:
199197
cmd += "--input_mudata %(full_obj)s"
200-
cmd += " > logs/collate_data.log"
198+
cmd += " > logs/5_collate_data.log"
201199
job_kwargs["job_threads"] = PARAMS['resources_threads_medium']
202200
P.run(cmd, **job_kwargs)
203201

204202

205203
@transform(collate_mdata,
206204
formatter(""),
207-
'logs/plot_clusters_umaps.log')
205+
'logs/6_plot_clusters_umaps.log')
208206
def plot_cluster_umaps(infile, log_file,):
209207
# get associated umap
210208
mods = [key for key, value in PARAMS['modalities'].items() if value is True]
@@ -219,8 +217,9 @@ def plot_cluster_umaps(infile, log_file,):
219217
job_kwargs["job_threads"] = PARAMS['resources_threads_medium']
220218
P.run(cmd, jobs_limit=1, **job_kwargs)
221219

220+
222221
@transform(aggregate_clusters, regex("(.*)/all_res_clusters_list.txt.gz"),
223-
r'logs/\1_clustree.log',
222+
r'logs/7_\1_run_clustree.log',
224223
r'\1/figures/clustree.png', )
225224
def plot_clustree(infile, log_file, outfile):
226225
# convert infiles to comma sep. string
@@ -260,7 +259,7 @@ def gen_marker_jobs(infile, outfile, base_dir):
260259
@follows(collate_mdata)
261260
@transform(gen_marker_jobs,
262261
regex("(.*)/(.*)/(.*)_markers.txt"),
263-
r"logs/\1_\2_\3_markers.log",
262+
r"logs/8_find_markers_\1_\2_\3.log",
264263
r"\1/\2/\3_markers",
265264
r"\1",
266265
r"\1/\2",
@@ -324,7 +323,7 @@ def find_markers(infile, log_file, outfile_prefix, base_mod, cluster_dir, data_m
324323
@follows(find_markers)
325324
@transform(gen_marker_jobs,
326325
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",
328327
r"\1/alg\2/figures/dotplot_top_markers_\3.png",
329328
r"\1/alg\2/figures",
330329
r"\1", r"\2", r"\3")

0 commit comments

Comments
 (0)