cpg0026-lacoste_haghighi-rare-diseases #56
Replies: 11 comments
-
I'm suggesting changes in folder naming to make the structure consistent across various batches in this project and they will reflect in the following transfers commands: Transferring image folders:
|
Beta Was this translation helpful? Give feedback.
-
import subprocess
source_prefix = "s3://imaging-platform/projects/"
destination_prefix = "s3://cellpainting-gallery/cpg0026-lacoste_haghighi-rare-diseases/broad/images/"
paths = {
"2017_09_27_RareDiseases_Taipale/PILOT_1/": "PILOT_1/unprojected_images/",
"2017_09_27_RareDiseases_Taipale/PILOT_1_maxproj/": "PILOT_1/images/",
"2017_09_27_RareDiseases_Taipale/Cancer_Mutations_Screen/": "Cancer_Mutations_Screen/unprojected_images/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Cancer_Mutations_Screen/": "Cancer_Mutations_Screen/images/",
"2017_09_27_RareDiseases_Taipale/Common_Variants/": "Common_Variants/unprojected_images/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Common_Variants/": "Common_Variants/images/",
"2017_09_27_RareDiseases_Taipale/Kinase_Plates/": "Kinase_Plates/unprojected_images/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Kinase_Plates/": "Kinase_Plates/images/",
"2017_09_27_RareDiseases_Taipale/Replicates_Original_Screen/": "Replicates_Original_Screen/unprojected_images/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Replicates_Original_Screen/": "Replicates_Original_Screen/images/",
"2017_10_19_Profiling_rare_ORFs/2021_05_21_QualityControlPathwayArrayedScreen/": "2021_05_21_QualityControlPathwayArrayedScreen/",
"2017_10_19_Profiling_rare_ORFs/2022_01_12_Batch1/": "2022_01_12_Batch1/",
"2017_10_19_Profiling_rare_ORFs/2022_01_12_Batch2/": "2022_01_12_Batch2/"
}
for source_suffix, destination_suffix in paths.items():
source = source_prefix + source_suffix
destination = destination_prefix + destination_suffix
subprocess.run(["aws", "sync", source, destination])
|
Beta Was this translation helpful? Give feedback.
-
@MarziehHaghighi Would you be able to do a spot check to verify that the code above matches what you had? |
Beta Was this translation helpful? Give feedback.
-
Looks correct to me! Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi @shntnu Shantanu, If granting the access to do the transfer is not possible, could you please transfer the analysis folder of the above batches to the gallery as well? Thanks |
Beta Was this translation helpful? Give feedback.
-
@MarziehHaghighi First, one q about the folder structure. Do you mean to handle structuring the unprotected images differently? For example, consider the My guess is you'd want this to be transferred like this: paths = {
"2017_09_27_RareDiseases_Taipale/Cancer_Mutations_Screen/images/": "Cancer_Mutations_Screen/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Cancer_Mutations_Screen/images/": "Cancer_Mutations_Screen/images/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Cancer_Mutations_Screen/illum/": "Cancer_Mutations_Screen/illum/",
] This is different from how you have it. If my version is correct, then this is the updated script: import subprocess
source_prefix = "s3://imaging-platform/projects/"
destination_prefix = (
"s3://cellpainting-gallery/cpg0026-lacoste_haghighi-rare-diseases/broad/images/"
)
paths = {
# unprojected images: copy the `images` to `images_unprojected`
"2017_09_27_RareDiseases_Taipale/PILOT_1/images/": "PILOT_1/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Cancer_Mutations_Screen/images/": "Cancer_Mutations_Screen/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Common_Variants/images/": "Common_Variants/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Kinase_Plates/images/": "Kinase_Plates/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Replicates_Original_Screen/images/": "Replicates_Original_Screen/images_unprojected/",
# projected images: copy the `images` to `images` and `illum` to `illum`
# (which is the same as just copying the whole batch folder)
"2017_09_27_RareDiseases_Taipale/PILOT_1_maxproj/": "PILOT_1/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Cancer_Mutations_Screen/": "Cancer_Mutations_Screen/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Common_Variants/": "Common_Variants/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Kinase_Plates/": "Kinase_Plates/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Replicates_Original_Screen/": "Replicates_Original_Screen/",
# these batches already have folders organized as `images`, `images_unprojected`, and `illum`, so we can just sync the whole batch folder
"2017_10_19_Profiling_rare_ORFs/2021_05_21_QualityControlPathwayArrayedScreen/": "2021_05_21_QualityControlPathwayArrayedScreen/",
"2017_10_19_Profiling_rare_ORFs/2022_01_12_Batch1/": "2022_01_12_Batch1/",
"2017_10_19_Profiling_rare_ORFs/2022_01_12_Batch2/": "2022_01_12_Batch2/",
}
for source_suffix, destination_suffix in paths.items():
source = source_prefix + source_suffix
destination = destination_prefix + destination_suffix
subprocess.run(["aws", "s3", "sync", source, destination]) |
Beta Was this translation helpful? Give feedback.
-
@shntnu sorry I'm a bit confused but basically I want to have a consistent structure for various batches in the gallery although the structure for different batches is not consistent in the imaging bucket. I wrote these commands so that we have the below final structure for all batches in the gallery. Maybe my visual inspection of your commands was not perfect for making sure it follows my structure but my initial version should be accurate.
|
Beta Was this translation helpful? Give feedback.
-
Ah ok -- so we are on the same page but your commands would result in a discrepancy, which I've addressed. We can discuss this when we chat. Most of the
|
Beta Was this translation helpful? Give feedback.
-
@MarziehHaghighi I confirm that all the images, except the 6 that need to be restored, are copied over successfully. The restore for the remaining is underway
You can proceed with the |
Beta Was this translation helpful? Give feedback.
-
@MarziehHaghighi This is all set 🎉 Script source_prefix = "s3://imaging-platform/projects/"
destination_prefix = (
"s3://cellpainting-gallery/cpg0026-lacoste_haghighi-rare-diseases/broad/images/"
)
paths = {
# unprojected images: copy the `images` to `images_unprojected`
"2017_09_27_RareDiseases_Taipale/PILOT_1/images/": "PILOT_1/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Cancer_Mutations_Screen/images/": "Cancer_Mutations_Screen/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Common_Variants/images/": "Common_Variants/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Kinase_Plates/images/": "Kinase_Plates/images_unprojected/",
"2017_09_27_RareDiseases_Taipale/Replicates_Original_Screen/images/": "Replicates_Original_Screen/images_unprojected/",
# projected images: copy the `images` to `images` and `illum` to `illum`
# (which is the same as just copying the whole batch folder)
"2017_09_27_RareDiseases_Taipale/PILOT_1_maxproj/": "PILOT_1/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Cancer_Mutations_Screen/": "Cancer_Mutations_Screen/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Common_Variants/": "Common_Variants/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Kinase_Plates/": "Kinase_Plates/",
"2017_09_27_RareDiseases_Taipale/Maxproj_Replicates_Original_Screen/": "Replicates_Original_Screen/",
# these batches already have folders organized as `images`, `images_unprojected`, and `illum`, so we can just sync the whole batch folder
"2017_10_19_Profiling_rare_ORFs/2021_05_21_QualityControlPathwayArrayedScreen/": "2021_05_21_QualityControlPathwayArrayedScreen/",
"2017_10_19_Profiling_rare_ORFs/2022_01_12_Batch1/": "2022_01_12_Batch1/",
"2017_10_19_Profiling_rare_ORFs/2022_01_12_Batch2/": "2022_01_12_Batch2/",
}
import subprocess
from concurrent.futures import ThreadPoolExecutor
def sync(source_suffix, destination_suffix):
source = source_prefix + source_suffix
destination = destination_prefix + destination_suffix
# subprocess.run(["aws", "s3", "sync", "--quiet", source, destination])
subprocess.run(["aws", "s3", "sync", source, destination])
with ThreadPoolExecutor(max_workers=8) as executor:
futures = {executor.submit(sync, source_suffix, destination_suffix) for source_suffix, destination_suffix in paths.items()} |
Beta Was this translation helpful? Give feedback.
-
Analysis folders transfer is done. I update the same comment here when I'm done with the profiles and results transfers.
|
Beta Was this translation helpful? Give feedback.
-
Imaging Platform project tag = 2023_04_14_Lacoste-Haghighi
Segmentation/ Feature extraction is being performed by Cimini lab
Profile creation is being performed by (Cimini lab / Carpenter-Singh lab)
Data can be public in RODA Immediately
Update as generated:
[Link to profile repo]
[Link to publication repo]
Transfer to CellPainting Gallery:
If data is being published, prepare for publication:
Once published:
Beta Was this translation helpful? Give feedback.
All reactions