-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from fractal-analytics-platform/62-create-01_c…
…ardio_tiny_dataset_with_partial_execution New example: cardio tiny dataset with partial execution
- Loading branch information
Showing
14 changed files
with
96 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION="1.3.2" | ||
VERSION="1.3.3" | ||
|
||
ENVNAME=fractal-client-$VERSION | ||
conda deactivate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ output* | |
task_list | ||
.fractal.env | ||
proj* | ||
workflow.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
81 changes: 81 additions & 0 deletions
81
examples/01_cardio_tiny_dataset/run_example_with_partial_execution.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
LABEL="cardiac-test-partial-1" | ||
|
||
############################################################################### | ||
# IMPORTANT: This defines the location of input & output data | ||
INPUT_PATH=`pwd`/../images/10.5281_zenodo.7059515/ | ||
OUTPUT_PATH=`pwd`/output_${LABEL} | ||
############################################################################### | ||
|
||
# Get the credentials: If you followed the instructions, they can be copied | ||
# from the .fractal.env file in ../00_user_setup. Alternatively, you can write | ||
# a .fractal.env file yourself or add --user & --password entries to all fractal | ||
# commands below | ||
cp ../00_user_setup/.fractal.env .fractal.env | ||
|
||
# Set useful variables | ||
PRJ_NAME="proj-$LABEL" | ||
DS_IN_NAME="input-ds-$LABEL" | ||
DS_OUT_NAME="output-ds-$LABEL" | ||
WF_NAME="Workflow $LABEL" | ||
|
||
# Set cache path and remove any previous file from there | ||
export FRACTAL_CACHE_PATH=`pwd`/".cache" | ||
rm -rv ${FRACTAL_CACHE_PATH} 2> /dev/null | ||
|
||
############################################################################### | ||
|
||
# Create project | ||
OUTPUT=`fractal --batch project new $PRJ_NAME` | ||
PRJ_ID=`echo $OUTPUT | cut -d ' ' -f1` | ||
DS_IN_ID=`echo $OUTPUT | cut -d ' ' -f2` | ||
echo "PRJ_ID: $PRJ_ID" | ||
echo "DS_IN_ID: $DS_IN_ID" | ||
|
||
# Update dataset name/type, and add a resource | ||
fractal dataset edit --new-name "$DS_IN_NAME" --new-type image --make-read-only $PRJ_ID $DS_IN_ID | ||
fractal dataset add-resource $PRJ_ID $DS_IN_ID $INPUT_PATH | ||
|
||
# Add output dataset, and add a resource to it | ||
DS_OUT_ID=`fractal --batch project add-dataset $PRJ_ID "$DS_OUT_NAME"` | ||
echo "DS_OUT_ID: $DS_OUT_ID" | ||
|
||
fractal dataset edit --new-type zarr --remove-read-only $PRJ_ID $DS_OUT_ID | ||
fractal dataset add-resource $PRJ_ID $DS_OUT_ID $OUTPUT_PATH | ||
|
||
# Create workflow | ||
WF_ID=`fractal --batch workflow new "$WF_NAME" $PRJ_ID` | ||
echo "WF_ID: $WF_ID" | ||
|
||
############################################################################### | ||
|
||
# Prepare some JSON files for task arguments (note: this has to happen here, | ||
# because we need to include the path of the current directory) | ||
CURRENT_FOLDER=`pwd` | ||
echo "{ | ||
\"level\": 0, | ||
\"input_ROI_table\": \"well_ROI_table\", | ||
\"workflow_file\": \"$CURRENT_FOLDER/regionprops_from_existing_labels_feature.yaml\", | ||
\"input_specs\": { | ||
\"dapi_img\": { \"type\": \"image\", \"channel\":{ \"wavelength_id\": \"A01_C01\" } }, | ||
\"label_img\": { \"type\": \"label\", \"label_name\": \"nuclei\" } | ||
}, | ||
\"output_specs\": { | ||
\"regionprops_DAPI\": { \"type\": \"dataframe\", \"table_name\": \"nuclei\" } | ||
} | ||
} | ||
" > Parameters/args_measurement.json | ||
|
||
############################################################################### | ||
|
||
# Add tasks to workflow | ||
fractal --batch workflow add-task $PRJ_ID $WF_ID --task-name "Create OME-Zarr structure" --args-file Parameters/args_create_ome_zarr.json --meta-file Parameters/example_meta.json | ||
fractal --batch workflow add-task $PRJ_ID $WF_ID --task-name "Convert Yokogawa to OME-Zarr" | ||
fractal --batch workflow add-task $PRJ_ID $WF_ID --task-name "Copy OME-Zarr structure" | ||
fractal --batch workflow add-task $PRJ_ID $WF_ID --task-name "Maximum Intensity Projection" | ||
fractal --batch workflow add-task $PRJ_ID $WF_ID --task-name "Cellpose Segmentation" --args-file Parameters/args_cellpose_segmentation.json #--meta-file Parameters/cellpose_meta.json | ||
fractal --batch workflow add-task $PRJ_ID $WF_ID --task-name "Napari workflows wrapper" --args-file Parameters/args_measurement.json --meta-file Parameters/example_meta.json | ||
|
||
# Apply workflow | ||
fractal workflow apply $PRJ_ID $WF_ID $DS_IN_ID $DS_OUT_ID --end 1 | ||
sleep 90 | ||
fractal workflow apply $PRJ_ID $WF_ID $DS_OUT_ID $DS_OUT_ID --start 2 |
1 change: 0 additions & 1 deletion
1
examples/01_cardio_tiny_dataset_with_import_export/Parameters/.gitignore
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...ples/01_cardio_tiny_dataset_with_import_export/Parameters/args_cellpose_segmentation.json
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
examples/01_cardio_tiny_dataset_with_import_export/Parameters/args_create_ome_zarr.json
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
examples/01_cardio_tiny_dataset_with_import_export/Parameters/example_meta.json
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
examples/01_cardio_tiny_dataset_with_import_export/README.md
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
examples/01_cardio_tiny_dataset_with_import_export/fetch_test_data_from_zenodo.sh
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...s/01_cardio_tiny_dataset_with_import_export/regionprops_from_existing_labels_feature.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VERSION="1.3.3" | ||
VERSION="1.3.4" | ||
|
||
ENVNAME=fractal-server-$VERSION | ||
conda deactivate | ||
|