galaxy.metadata package

Define abstraction for capturing the metadata of job’s output datasets.

galaxy.metadata.get_metadata_compute_strategy(config, job_id, metadata_strategy_override=None, tool_id=None, tool_type=None)[source]
class galaxy.metadata.MetadataCollectionStrategy[source]

Bases: object

Interface describing the abstract process of writing out and collecting output metadata.

extended = False
abstract setup_external_metadata(datasets_dict, out_collections, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, output_fnames=None, config_root=None, use_bin=False, config_file=None, datatypes_config=None, job_metadata=None, provided_metadata_style=None, compute_tmp_dir=None, include_command=True, max_metadata_value_size=0, max_discovered_files=None, object_store_conf=None, tool=None, job=None, kwds=None)[source]

Setup files needed for external metadata collection.

If include_command is True, return full Python command to externally compute metadata otherwise just the arguments to galaxy_ext.metadata.set_metadata required to build.

abstract external_metadata_set_successfully(dataset, name, sa_session, working_directory)[source]

Return boolean indicating if metadata for specified dataset was written properly.

abstract load_metadata(dataset, name, sa_session, working_directory, remote_metadata_directory=None)[source]

Load metadata calculated externally into specified dataset.

class galaxy.metadata.PortableDirectoryMetadataGenerator(job_id)[source]

Bases: MetadataCollectionStrategy

portable = True
write_object_store_conf = False
__init__(job_id)[source]
setup_external_metadata(datasets_dict, out_collections, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, output_fnames=None, config_root=None, use_bin=False, config_file=None, datatypes_config=None, job_metadata=None, provided_metadata_style=None, compute_tmp_dir=None, compute_version_path=None, include_command=True, max_metadata_value_size=0, max_discovered_files=None, validate_outputs=False, object_store_conf=None, tool=None, job=None, link_data_only=False, kwds=None)[source]

Setup files needed for external metadata collection.

If include_command is True, return full Python command to externally compute metadata otherwise just the arguments to galaxy_ext.metadata.set_metadata required to build.

load_metadata(dataset, name, sa_session, working_directory, remote_metadata_directory=None)[source]

Load metadata calculated externally into specified dataset.

external_metadata_set_successfully(dataset, name, sa_session, working_directory)[source]

Return boolean indicating if metadata for specified dataset was written properly.

class galaxy.metadata.ExtendedDirectoryMetadataGenerator(job_id)[source]

Bases: PortableDirectoryMetadataGenerator

extended = True
write_object_store_conf = True
__init__(job_id)[source]
setup_external_metadata(datasets_dict, out_collections, sa_session, **kwd)[source]

Setup files needed for external metadata collection.

If include_command is True, return full Python command to externally compute metadata otherwise just the arguments to galaxy_ext.metadata.set_metadata required to build.

load_metadata(dataset, name, sa_session, working_directory, remote_metadata_directory=None)[source]

Load metadata calculated externally into specified dataset.

Submodules

galaxy.metadata.set_metadata module

Execute an external process to set_meta() on a provided list of pickled datasets.

This was formerly scripts/set_metadata.py and expects these arguments:

%prog datatypes_conf.xml job_metadata_file metadata_kwds,metadata_out,metadata_results_code,output_filename_override,metadata_override… max_metadata_value_size

Galaxy should be importable on sys.path and output_filename_override should be set to the path of the dataset on which metadata is being set (output_filename_override could previously be left empty and the path would be constructed automatically).

galaxy.metadata.set_metadata.reset_external_filename(dataset_instance: DatasetInstance)[source]
galaxy.metadata.set_metadata.push_if_necessary(object_store: ObjectStore, dataset: DatasetInstance, external_filename)[source]
galaxy.metadata.set_metadata.set_validated_state(dataset_instance)[source]
galaxy.metadata.set_metadata.set_meta_with_tool_provided(dataset_instance, file_dict, set_meta_kwds, datatypes_registry, max_metadata_value_size)[source]
galaxy.metadata.set_metadata.set_metadata()[source]
galaxy.metadata.set_metadata.get_metadata_params(tool_job_working_directory)[source]
galaxy.metadata.set_metadata.get_object_store(tool_job_working_directory, object_store=None)[source]
galaxy.metadata.set_metadata.set_metadata_portable(tool_job_working_directory=None, object_store: ObjectStore | None = None, extended_metadata_collection: bool | None = None)[source]
galaxy.metadata.set_metadata.validate_and_load_datatypes_config(datatypes_config)[source]
galaxy.metadata.set_metadata.load_job_metadata(job_metadata, provided_metadata_style)[source]
galaxy.metadata.set_metadata.write_job_metadata(tool_job_working_directory, job_metadata, set_meta, tool_provided_metadata)[source]