Mercurial > repos > lldelisle > max_projections_stack_and_upload_omero
diff upload_omero.sh @ 0:a02156aa8bda draft
planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
author | lldelisle |
---|---|
date | Thu, 12 Dec 2024 12:42:20 +0000 |
parents | |
children | 9be687213bc9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/upload_omero.sh Thu Dec 12 12:42:20 2024 +0000 @@ -0,0 +1,21 @@ +#!/bin/bash +omero_server="$1" +omero_user="$(cat $2 | awk 'NR==2{print $0}')" +omero_password="$(cat $2 | awk 'NR==3{print $0}')" +to_create=$3 +project_name_or_id=$4 +dataset_name_or_id=$5 + +if [ "$to_create" = "both" ]; then + # Create a project: + project_name_or_id=$(${omero_path} obj -s ${omero_server} -u ${omero_user} -w ${omero_password} new Project name="${project_name_or_id}" | awk -F ":" 'END{print $NF}') + echo "Just created the new project ${project_name_or_id}" +fi +if [ "$to_create" = "both" ] || [ "$to_create" = "dataset" ]; then + dataset_name_or_id=$(${omero_path} obj -s ${omero_server} -u ${omero_user} -w ${omero_password} new Dataset name="${dataset_name_or_id}" | awk -F ":" 'END{print $NF}') + echo "Just created the new dataset ${dataset_name_or_id}" + ${omero_path} obj -s ${omero_server} -u ${omero_user} -w ${omero_password} new ProjectDatasetLink parent=Project:${project_name_or_id} child=Dataset:${dataset_name_or_id} +fi +echo "Start upload" +omero import -s ${omero_server} -u ${omero_user} -w ${omero_password} --depth 1 -T Dataset:id:"${dataset_name_or_id}" output 2>&1 +echo "Upload finished"