annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
1 #!/bin/bash
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
2 omero_server="$1"
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
3 omero_user="$(cat $2 | awk 'NR==2{print $0}')"
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
4 omero_password="$(cat $2 | awk 'NR==3{print $0}')"
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
5 to_create=$3
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
6 project_name_or_id=$4
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
7 dataset_name_or_id=$5
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
8
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
9 if [ "$to_create" = "both" ]; then
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
10 # Create a project:
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
11 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}')
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
12 echo "Just created the new project ${project_name_or_id}"
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
13 fi
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
14 if [ "$to_create" = "both" ] || [ "$to_create" = "dataset" ]; then
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
15 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}')
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
16 echo "Just created the new dataset ${dataset_name_or_id}"
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
17 ${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}
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
18 fi
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
19 echo "Start upload"
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
20 omero import -s ${omero_server} -u ${omero_user} -w ${omero_password} --depth 1 -T Dataset:id:"${dataset_name_or_id}" output 2>&1
a02156aa8bda planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 69a86e0a8ef82ce3c2232b99f72717a184f4d4cf
lldelisle
parents:
diff changeset
21 echo "Upload finished"