From d6b4b25d313a9d8aa3df38c460983dba6fb026d8 Mon Sep 17 00:00:00 2001 From: ErinWeisbart <54687786+ErinWeisbart@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:37:31 -0800 Subject: [PATCH 1/4] add assaydev_persite --- run_batch_general.py | 69 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/run_batch_general.py b/run_batch_general.py index 600427b..4072c28 100644 --- a/run_batch_general.py +++ b/run_batch_general.py @@ -26,7 +26,7 @@ def scheduleBatch(self, data): def run_batch_general( - step, # (zproj, illum, qc, qc_persite, assaydev, or analysis) + step, # (zproj, illum, qc, qc_persite, assaydev, assaydev_persite, or analysis) identifier="", # (e.g. cpg0000-jump-pilot) batch="", # (e.g. 2020_11_04_CPJUMP1) platelist=[], # (e.g. ['Plate1','Plate2']) @@ -427,6 +427,71 @@ def run_batch_general( print("AssayDev job submitted. Check your queue") + elif step == "assaydev_bysite": + assaydevqueue = JobQueue(f"{identifier}_AssayDev") + if not outpath: + outpath = path_dict[path_style]["assaydevoutpath"] + if not usebatch: + if not pipeline: + pipeline = "assaydev.cppipe" + if not csvname: + csvname = "load_data_with_illum.csv" + + for plate in platelist: + if all(len(ele) == 0 for ele in wells): + for eachrow in rows: + for eachcol in columns: + for site in sites: + templateMessage_ad = { + "Metadata": f"Metadata_Plate={plate},Metadata_Well={eachrow}{int(eachcol):{well_format}},Metadata_Site={site}", + "pipeline": posixpath.join(pipelinepath, pipeline), + "output": outpath, + "input": inputpath, + "data_file": posixpath.join(datafilepath, plate, csvname), + } + assaydevqueue.scheduleBatch(templateMessage_ad) + else: + for well in wells: + for site in sites: + templateMessage_ad = { + "Metadata": f"Metadata_Plate={plate},Metadata_Well={eachwell},Metadata_Site={site}", + "pipeline": posixpath.join(pipelinepath, pipeline), + "output": outpath, + "input": inputpath, + "data_file": posixpath.join(datafilepath, plate, csvname), + } + assaydevqueue.scheduleBatch(templateMessage_ad) + else: + if not batchfile: + batchfile = "Batch_data_assaydev.h5" + for plate in platelist: + if all(len(ele) == 0 for ele in wells): + for eachrow in rows: + for eachcol in columns: + for site in sites: + templateMessage_ad = { + "Metadata": f"Metadata_Plate={plate},Metadata_Well={eachrow}{int(eachcol):{well_format}},Metadata_Site={site}", + "pipeline": posixpath.join(batchpath, batchfile), + "output": outpath, + "input": inputpath, + "data_file": posixpath.join(batchpath, batchfile), + } + assaydevqueue.scheduleBatch(templateMessage_ad) + else: + for eachwell in wells: + for site in sites: + templateMessage_ad = { + "Metadata": f"Metadata_Plate={plate},Metadata_Well={eachwell},Metadata_Site={site}", + "pipeline": posixpath.join(batchpath, batchfile), + "output": outpath, + "input": inputpath, + "data_file": posixpath.join(batchpath, batchfile), + } + assaydevqueue.scheduleBatch(templateMessage_ad) + + print("AssayDev job submitted. Check your queue") + + elif step == "analysis": analysisqueue = JobQueue(f"{identifier}_Analysis") if not outputstructure: @@ -512,7 +577,7 @@ def run_batch_general( ) parser.add_argument( "step", - help="Step to make jobs for. Supported steps are zproj, illum, qc, qc_persite, assaydev, analysis", + help="Step to make jobs for. Supported steps are zproj, illum, qc, qc_persite, assaydev, assdev_persite, analysis", ) parser.add_argument("identifier", help="Project identifier") parser.add_argument("batch", help="Name of batch") From 323edec949fabd081b76dd35db1bc901f2b5febc Mon Sep 17 00:00:00 2001 From: ErinWeisbart <54687786+ErinWeisbart@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:40:03 -0800 Subject: [PATCH 2/4] typo --- run_batch_general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_batch_general.py b/run_batch_general.py index 4072c28..84fc804 100644 --- a/run_batch_general.py +++ b/run_batch_general.py @@ -427,7 +427,7 @@ def run_batch_general( print("AssayDev job submitted. Check your queue") - elif step == "assaydev_bysite": + elif step == "assaydev_persite": assaydevqueue = JobQueue(f"{identifier}_AssayDev") if not outpath: outpath = path_dict[path_style]["assaydevoutpath"] From b8d5898a4f1f43067210a75e2e199ac8a276c7ff Mon Sep 17 00:00:00 2001 From: ErinWeisbart <54687786+ErinWeisbart@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:10:11 -0800 Subject: [PATCH 3/4] add to docs --- documentation/DCP-documentation/step_2_submit_jobs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/DCP-documentation/step_2_submit_jobs.md b/documentation/DCP-documentation/step_2_submit_jobs.md index 0433078..ff21d8e 100644 --- a/documentation/DCP-documentation/step_2_submit_jobs.md +++ b/documentation/DCP-documentation/step_2_submit_jobs.md @@ -60,7 +60,7 @@ As of Distributed-CellProfiler 2.2.0, `run_batch_general.py` has been reformatte ### Required inputs * `step` is the step that you would like to make jobs for. -Supported steps are `zproj`, `illum`, `qc`, `qc_persite`, `assaydev`, and`analysis` +Supported steps are `zproj`, `illum`, `qc`, `qc_persite`, `assaydev`, `assaydev_persite`, and `analysis` * `identifier` is the project identifier (e.g. "cpg0000-jump-pilot" or "2024_11_07_Collaborator_Cell_Painting") * `batch` is the name of the data batch (e.g. "2020_11_04_CPJUMP1") * `platelist` is the list of plates to process. From ab41b74341c05151c94357bd8f2676645e14e667 Mon Sep 17 00:00:00 2001 From: Erin Weisbart <54687786+ErinWeisbart@users.noreply.github.com> Date: Wed, 4 Dec 2024 13:05:35 -0800 Subject: [PATCH 4/4] typo --- run_batch_general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_batch_general.py b/run_batch_general.py index 84fc804..fa140e3 100644 --- a/run_batch_general.py +++ b/run_batch_general.py @@ -577,7 +577,7 @@ def run_batch_general( ) parser.add_argument( "step", - help="Step to make jobs for. Supported steps are zproj, illum, qc, qc_persite, assaydev, assdev_persite, analysis", + help="Step to make jobs for. Supported steps are zproj, illum, qc, qc_persite, assaydev, assaydev_persite, analysis", ) parser.add_argument("identifier", help="Project identifier") parser.add_argument("batch", help="Name of batch")