Skip to content

Commit 45f1bcb

Browse files
authored
Assaydev persite (#185)
1 parent 85e1246 commit 45f1bcb

2 files changed

Lines changed: 68 additions & 3 deletions

File tree

documentation/DCP-documentation/step_2_submit_jobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ As of Distributed-CellProfiler 2.2.0, `run_batch_general.py` has been reformatte
6060
### Required inputs
6161

6262
* `step` is the step that you would like to make jobs for.
63-
Supported steps are `zproj`, `illum`, `qc`, `qc_persite`, `assaydev`, and`analysis`
63+
Supported steps are `zproj`, `illum`, `qc`, `qc_persite`, `assaydev`, `assaydev_persite`, and `analysis`
6464
* `identifier` is the project identifier (e.g. "cpg0000-jump-pilot" or "2024_11_07_Collaborator_Cell_Painting")
6565
* `batch` is the name of the data batch (e.g. "2020_11_04_CPJUMP1")
6666
* `platelist` is the list of plates to process.

run_batch_general.py

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def scheduleBatch(self, data):
2626

2727

2828
def run_batch_general(
29-
step, # (zproj, illum, qc, qc_persite, assaydev, or analysis)
29+
step, # (zproj, illum, qc, qc_persite, assaydev, assaydev_persite, or analysis)
3030
identifier="", # (e.g. cpg0000-jump-pilot)
3131
batch="", # (e.g. 2020_11_04_CPJUMP1)
3232
platelist=[], # (e.g. ['Plate1','Plate2'])
@@ -427,6 +427,71 @@ def run_batch_general(
427427

428428
print("AssayDev job submitted. Check your queue")
429429

430+
elif step == "assaydev_persite":
431+
assaydevqueue = JobQueue(f"{identifier}_AssayDev")
432+
if not outpath:
433+
outpath = path_dict[path_style]["assaydevoutpath"]
434+
if not usebatch:
435+
if not pipeline:
436+
pipeline = "assaydev.cppipe"
437+
if not csvname:
438+
csvname = "load_data_with_illum.csv"
439+
440+
for plate in platelist:
441+
if all(len(ele) == 0 for ele in wells):
442+
for eachrow in rows:
443+
for eachcol in columns:
444+
for site in sites:
445+
templateMessage_ad = {
446+
"Metadata": f"Metadata_Plate={plate},Metadata_Well={eachrow}{int(eachcol):{well_format}},Metadata_Site={str(site)}",
447+
"pipeline": posixpath.join(pipelinepath, pipeline),
448+
"output": outpath,
449+
"input": inputpath,
450+
"data_file": posixpath.join(datafilepath, plate, csvname),
451+
}
452+
assaydevqueue.scheduleBatch(templateMessage_ad)
453+
else:
454+
for well in wells:
455+
for site in sites:
456+
templateMessage_ad = {
457+
"Metadata": f"Metadata_Plate={plate},Metadata_Well={eachwell},Metadata_Site={str(site)}",
458+
"pipeline": posixpath.join(pipelinepath, pipeline),
459+
"output": outpath,
460+
"input": inputpath,
461+
"data_file": posixpath.join(datafilepath, plate, csvname),
462+
}
463+
assaydevqueue.scheduleBatch(templateMessage_ad)
464+
else:
465+
if not batchfile:
466+
batchfile = "Batch_data_assaydev.h5"
467+
for plate in platelist:
468+
if all(len(ele) == 0 for ele in wells):
469+
for eachrow in rows:
470+
for eachcol in columns:
471+
for site in sites:
472+
templateMessage_ad = {
473+
"Metadata": f"Metadata_Plate={plate},Metadata_Well={eachrow}{int(eachcol):{well_format}},Metadata_Site={str(site)}",
474+
"pipeline": posixpath.join(batchpath, batchfile),
475+
"output": outpath,
476+
"input": inputpath,
477+
"data_file": posixpath.join(batchpath, batchfile),
478+
}
479+
assaydevqueue.scheduleBatch(templateMessage_ad)
480+
else:
481+
for eachwell in wells:
482+
for site in sites:
483+
templateMessage_ad = {
484+
"Metadata": f"Metadata_Plate={plate},Metadata_Well={eachwell},Metadata_Site={str(site)}",
485+
"pipeline": posixpath.join(batchpath, batchfile),
486+
"output": outpath,
487+
"input": inputpath,
488+
"data_file": posixpath.join(batchpath, batchfile),
489+
}
490+
assaydevqueue.scheduleBatch(templateMessage_ad)
491+
492+
print("AssayDev job submitted. Check your queue")
493+
494+
430495
elif step == "analysis":
431496
analysisqueue = JobQueue(f"{identifier}_Analysis")
432497
if not outputstructure:
@@ -512,7 +577,7 @@ def run_batch_general(
512577
)
513578
parser.add_argument(
514579
"step",
515-
help="Step to make jobs for. Supported steps are zproj, illum, qc, qc_persite, assaydev, analysis",
580+
help="Step to make jobs for. Supported steps are zproj, illum, qc, qc_persite, assaydev, assaydev_persite, analysis",
516581
)
517582
parser.add_argument("identifier", help="Project identifier")
518583
parser.add_argument("batch", help="Name of batch")

0 commit comments

Comments
 (0)