# HG changeset patch # User ufz # Date 1749847658 0 # Node ID f5c4f523432dc3979d1a77b4e71acb2a04602f6a # Parent 7a94eb8c345d88c7422a07f4fae4158d534cb660 planemo upload for repository https://github.com/Helmholtz-UFZ/galaxy-tools/tree/main/tools/omero commit 3f4e79a4e8350481f3c8d70bc64f01b4cb0a4bf0 diff -r 7a94eb8c345d -r f5c4f523432d omero_metadata_upload.py --- a/omero_metadata_upload.py Tue Apr 08 15:13:16 2025 +0000 +++ b/omero_metadata_upload.py Fri Jun 13 20:47:38 2025 +0000 @@ -19,6 +19,9 @@ headers=True) tb_dict = ez.get_table(conn, id_tb_ann) return tb_dict + elif ann_type == "attachement": + id_file_attach = ez.post_file_annotation(conn, file_path=data_dict, ns=an_name, object_type=obj_type, object_id=int(did)) + return id_file_attach except Exception as e: log_error(f"Error uploading metadata for {obj_type} with ID {did}: {str(e)}") return None @@ -41,6 +44,8 @@ data_dict = df.to_dict(orient='records') elif ann_type == "KV": data_dict = {col: df[col].iloc[0] for col in df.columns} + elif ann_type == "attachement": + data_dict = ann_file try: with ez.connect(user, pws, "", host, port, secure=True) as conn: @@ -86,7 +91,7 @@ 'well ', 'image'], help='Type of OMERO object') parser.add_argument('--did', type=int, help='ID of the object (if it exists)') - parser.add_argument('--ann_type', required=True, choices=['table', 'KV'], help='Annotation type') + parser.add_argument('--ann_type', required=True, choices=['table', 'KV', "attachement"], help='Annotation type') parser.add_argument('--ann_file', required=True, help='Path to the annotation file') parser.add_argument('--an_name', required=True, help='Namespace or title for the annotation') parser.add_argument('--log_file', default='metadata_import_log.txt', help='Path to the log file') diff -r 7a94eb8c345d -r f5c4f523432d test-data/output_attachement_import.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output_attachement_import.txt Fri Jun 13 20:47:38 2025 +0000 @@ -0,0 +1,1 @@ +SUCCESS: Successfully uploaded metadata for dataset with ID 1. Result: 12