Skip to content

Commit

Permalink
Change echo output of example 01, to be used in fractal-containers
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompa committed Oct 5, 2023
1 parent 1939dae commit 943cd68
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions examples/01_cardio_tiny_dataset/run_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ OUTPUT_PATH=`pwd`/output_${LABEL}
cp ../00_user_setup/.fractal.env .fractal.env

# Set useful variables
PRJ_NAME="proj-$LABEL"
PROJECT_NAME="proj-$LABEL"
DS_IN_NAME="input-ds-$LABEL"
DS_OUT_NAME="output-ds-$LABEL"
WF_NAME="Workflow $LABEL"
WORKFLOW_NAME="Workflow $LABEL"

# Set cache path and remove any previous file from there
export FRACTAL_CACHE_PATH=`pwd`/".cache"
Expand All @@ -25,26 +25,26 @@ rm -rv ${FRACTAL_CACHE_PATH} 2> /dev/null
###############################################################################

# Create project
OUTPUT=`fractal --batch project new $PRJ_NAME`
PRJ_ID=`echo $OUTPUT | cut -d ' ' -f1`
OUTPUT=`fractal --batch project new $PROJECT_NAME`
PROJECT_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"
echo "PROJECT_ID=$PROJECT_ID" # Do not remove this line, it's used in fractal-containers
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
fractal dataset edit --new-name "$DS_IN_NAME" --new-type image --make-read-only $PROJECT_ID $DS_IN_ID
fractal dataset add-resource $PROJECT_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"
DS_OUT_ID=`fractal --batch project add-dataset $PROJECT_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
fractal dataset edit --new-type zarr --remove-read-only $PROJECT_ID $DS_OUT_ID
fractal dataset add-resource $PROJECT_ID $DS_OUT_ID $OUTPUT_PATH

# Create workflow
WF_ID=`fractal --batch workflow new "$WF_NAME" $PRJ_ID`
echo "WF_ID: $WF_ID"
WORKFLOW_ID=`fractal --batch workflow new "$WORKFLOW_NAME" $PROJECT_ID`
echo "WORKFLOW_ID=$WORKFLOW_ID"

###############################################################################

Expand All @@ -68,12 +68,13 @@ echo "{
###############################################################################

# 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" --args-file Parameters/copy_ome_zarr.json
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
fractal --batch workflow add-task $PROJECT_ID $WORKFLOW_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 $PROJECT_ID $WORKFLOW_ID --task-name "Convert Yokogawa to OME-Zarr"
fractal --batch workflow add-task $PROJECT_ID $WORKFLOW_ID --task-name "Copy OME-Zarr structure" --args-file Parameters/copy_ome_zarr.json
fractal --batch workflow add-task $PROJECT_ID $WORKFLOW_ID --task-name "Maximum Intensity Projection"
fractal --batch workflow add-task $PROJECT_ID $WORKFLOW_ID --task-name "Cellpose Segmentation" --args-file Parameters/args_cellpose_segmentation.json #--meta-file Parameters/cellpose_meta.json
fractal --batch workflow add-task $PROJECT_ID $WORKFLOW_ID --task-name "Napari workflows wrapper" --args-file Parameters/args_measurement.json --meta-file Parameters/example_meta.json

# Apply workflow
fractal --batch workflow apply $PRJ_ID $WF_ID $DS_IN_ID $DS_OUT_ID
JOB_ID=`fractal --batch workflow apply $PROJECT_ID $WORKFLOW_ID $DS_IN_ID $DS_OUT_ID`
echo "JOB_ID=$JOB_ID" # Do not remove this line, it's used in fractal-containers

0 comments on commit 943cd68

Please sign in to comment.