|
| 1 | + |
| 2 | +BUCKET=XXXXXX |
| 3 | +PROJECT=XXXXXX |
| 4 | +BATCH=XXXXXX |
| 5 | + |
| 6 | +export S3_PATH="s3://${BUCKET}/projects/${PROJECT}/${BATCH}" |
| 7 | +export INPUT_DIR='./scratch/starrynight_example_input' |
| 8 | +export OUTPUT_BASELINE_DIR='./scratch/starrynight_example_output_baseline' |
| 9 | + |
| 10 | +# Inputs |
| 11 | + |
| 12 | +## SBS images |
| 13 | + |
| 14 | +parallel mkdir -p ${INPUT_DIR}/Source1/Batch1/images/Plate1/20X_c{1}_SBS-{1}/ ::: 1 2 3 |
| 15 | + |
| 16 | +parallel --match '.*' --match '(.*) (.*) (.*)' \ |
| 17 | + aws s3 cp "${S3_PATH}/images/Plate1/20X_c{1}_SBS-{1}/Well{2.1}_Point{2.1}_{2.2}_ChannelC,A,T,G,DAPI_Seq{2.3}.ome.tiff" \ |
| 18 | + "${INPUT_DIR}/Source1/Batch1/images/Plate1/20X_c{1}_SBS-{1}/" ::: \ |
| 19 | + 1 2 3 ::: \ |
| 20 | + "A1 0000 0000" "A1 0001 0001" "A2 0000 1025" "A2 0001 1026" "B1 0000 3075" "B1 0001 3076" |
| 21 | + |
| 22 | +## Cell Painting images |
| 23 | + |
| 24 | +mkdir -p ${INPUT_DIR}/Source1/Batch1/images/20X_CP_Plate1_20240319_122800_179 |
| 25 | + |
| 26 | +parallel --match '(.*) (.*) (.*)' \ |
| 27 | + aws s3 cp "${S3_PATH}/images/Plate1/20X_CP_Plate1_20240319_122800_179/Well{1.1}_Point{1.1}_{1.2}_ChannelPhalloAF750,ZO1-AF488,DAPI_Seq{1.3}.ome.tiff" \ |
| 28 | + "${INPUT_DIR}/Source1/Batch1/images/Plate1/20X_CP_Plate1_20240319_122800_179/" ::: \ |
| 29 | + "A1 0000 0000" "A1 0001 0001" "A2 0000 1025" "A2 0001 1026" "B1 0000 3075" "B1 0001 3076" |
| 30 | + |
| 31 | +# Outputs |
| 32 | + |
| 33 | +## Illumination correction images |
| 34 | + |
| 35 | +mkdir -p ${OUTPUT_BASELINE_DIR}/Source1/Batch1/illum/Plate1 |
| 36 | +parallel \ |
| 37 | + aws s3 cp "${S3_PATH}/illum/Plate1/Plate1_Cycle{1}_Illum{2}.npy" "${OUTPUT_BASELINE_DIR}/Source1/Batch1/illum/Plate1/" ::: \ |
| 38 | + 1 2 3 ::: \ |
| 39 | + DNA A T G C |
| 40 | + |
| 41 | +parallel \ |
| 42 | + aws s3 cp "${S3_PATH}/illum/Plate1/Plate1_Illum{1}.npy" "${OUTPUT_BASELINE_DIR}/Source1/Batch1/illum/Plate1/" ::: \ |
| 43 | + DNA Phalloidin ZO1 |
| 44 | + |
| 45 | +## Cell Painting images: Illumination corrected |
| 46 | + |
| 47 | +parallel \ |
| 48 | + aws s3 cp "${S3_PATH}/images_corrected/painting/Plate1-Well{1}/Plate_Plate1_Well_Well{1}_Site_{2}_Corr{3}.tiff" \ |
| 49 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_corrected/painting/Plate1-Well{1}/" ::: \ |
| 50 | + A1 A2 B1 ::: 0 1 ::: DNA Phalloidin ZO1 |
| 51 | + |
| 52 | +parallel \ |
| 53 | + aws s3 cp "${S3_PATH}/images_corrected/painting/Plate1-Well{1}/PaintingIllumApplication_{2}.csv" \ |
| 54 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_corrected/painting/Plate1-Well{1}/" ::: \ |
| 55 | + A1 A2 B1 ::: Cells ConfluentRegions Experiment Image Nuclei |
| 56 | + |
| 57 | +# SBS images: Illumination aligned |
| 58 | + |
| 59 | +parallel \ |
| 60 | + aws s3 cp "${S3_PATH}/images_aligned/barcoding/Plate1-Well{1}-{2}/Plate_Plate1_Well_{1}_Site_{2}_Cycle0{3}_{4}.tiff" \ |
| 61 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_aligned/barcoding/Plate1-Well{1}-{2}/" ::: \ |
| 62 | + A1 A2 B1 ::: 0 1 ::: 1 2 3 ::: A T G C DAPI |
| 63 | + |
| 64 | + |
| 65 | +parallel \ |
| 66 | + aws s3 cp "${S3_PATH}/images_aligned/barcoding/Plate1-Well{1}-{2}/BarcodingApplication_{3}.csv" \ |
| 67 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_aligned/barcoding/Plate1-Well{1}-{2}/" ::: \ |
| 68 | + A1 A2 B1 ::: 0 1 ::: Experiment Image |
| 69 | + |
| 70 | +## SBS images: Illumination corrected |
| 71 | + |
| 72 | +parallel \ |
| 73 | + aws s3 cp "${S3_PATH}/images_corrected/barcoding/Plate1-Well{1}-{2}/Plate_Plate1_Well_{1}_Site_{2}_Cycle0{3}_{4}.tiff" \ |
| 74 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_corrected/barcoding/Plate1-Well{1}-{2}/" ::: \ |
| 75 | + A1 A2 B1 ::: 0 1 ::: 1 2 3 ::: A T G C |
| 76 | + |
| 77 | +parallel \ |
| 78 | + aws s3 cp "${S3_PATH}/images_corrected/barcoding/Plate1-Well{1}-{2}/Plate_Plate1_Well_{1}_Site_{2}_Cycle0{3}_{4}.tiff" \ |
| 79 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_corrected/barcoding/Plate1-Well{1}-{2}/" ::: \ |
| 80 | + A1 A2 B1 ::: 0 1 ::: 1 ::: DAPI |
| 81 | +# DAPI is present only in the first cycle |
| 82 | + |
| 83 | + |
| 84 | +parallel \ |
| 85 | + aws s3 cp "${S3_PATH}/images_corrected/barcoding/Plate1-Well{1}-{2}/BarcodePreprocessing_{3}.csv" \ |
| 86 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_corrected/barcoding/Plate1-Well{1}-{2}/" ::: \ |
| 87 | + A1 A2 B1 ::: 0 1 ::: BarcodeFoci PreFoci Experiment Image Nuclei |
| 88 | + |
| 89 | +## Segmentation images |
| 90 | + |
| 91 | +parallel \ |
| 92 | + aws s3 cp "${S3_PATH}/images_segmentation/Plate1/Plate_Plate1_Well_Well{1}_Site_{2}_Corr{3}_SegmentCheck.png" \ |
| 93 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_segmentation/Plate1/" ::: \ |
| 94 | + A1 A2 B1 ::: 0 ::: DNA |
| 95 | + |
| 96 | +parallel \ |
| 97 | + aws s3 cp "${S3_PATH}/images_segmentation/Plate1/Plate_Plate1_Well_Well{1}_Site_{2}_Corr{3}_SegmentCheck.png" \ |
| 98 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_segmentation/Plate1/" ::: \ |
| 99 | + A1 A2 B1 ::: 0 ::: DNA |
| 100 | + |
| 101 | +parallel \ |
| 102 | + aws s3 cp "${S3_PATH}/images_segmentation/Plate1/SegmentationCheck_{1}.csv" \ |
| 103 | + "${OUTPUT_BASELINE_DIR}/Source1/Batch1/images_segmentation/Plate1/" ::: \ |
| 104 | + Experiment Image Nuclei Cells PreCells ConfluentRegions |
| 105 | + |
| 106 | +## Load Data CSVs |
| 107 | + |
| 108 | +export S3_PATH_WORKSPACE="s3://${BUCKET}/projects/${PROJECT}/workspace" |
| 109 | + |
| 110 | +aws s3 sync \ |
| 111 | + "${S3_PATH_WORKSPACE}/load_data_csv/${BATCH}/Plate1/" \ |
| 112 | + "${OUTPUT_BASELINE_DIR}/Source1/workspace_example/load_data_csv/Batch1/Plate1/" |
| 113 | + |
| 114 | +## Analysis CSVs |
| 115 | + |
| 116 | +parallel \ |
| 117 | + aws s3 sync \ |
| 118 | + "${S3_PATH_WORKSPACE}/analysis/${BATCH}/Plate1-Well{1}-{2}/" \ |
| 119 | + "${OUTPUT_BASELINE_DIR}/Source1/workspace_example/analysis/${BATCH}/Plate1-Well{1}-{2}/" \ |
| 120 | + --exclude \""*.csv\"" ::: \ |
| 121 | + A1 A2 B1 ::: 0 1 |
| 122 | + |
| 123 | + |
| 124 | +parallel \ |
| 125 | + aws s3 sync \ |
| 126 | + "${S3_PATH_WORKSPACE}/analysisfix/${BATCH}/Plate1-Well{1}-{2}/" \ |
| 127 | + "${OUTPUT_BASELINE_DIR}/Source1/workspace_example/analysis/${BATCH}/Plate1-Well{1}-{2}/" ::: \ |
| 128 | + A1 A2 B1 ::: 0 1 |
| 129 | +# Note that the analysis files are synced from two different locations: analysis and analysisfix. |
| 130 | +# analysisfix was a rerun of analysis |
| 131 | + |
| 132 | +# Compress files to reduce disk usage after downloading |
| 133 | +echo "Compressing files to reduce disk usage..." |
| 134 | + |
| 135 | +## Compress all TIFF files |
| 136 | +find ${OUTPUT_BASELINE_DIR} -type f -name "*.tiff" | parallel 'magick {} -compress jpeg -quality 80 {}' |
| 137 | +find ${INPUT_DIR} -type f -name "*.tiff" | parallel 'magick {} -compress jpeg -quality 80 {}' |
| 138 | + |
| 139 | +# Compress CSV files |
| 140 | +find ${OUTPUT_BASELINE_DIR} -type f -name "*.csv" | parallel 'gzip -9 {}' |
0 commit comments