Warning
This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
galaxy.model.store package¶
-
class
galaxy.model.store.
ImportOptions
(allow_edit=False, allow_library_creation=False, allow_dataset_object_edit=None)[source]¶ Bases:
object
-
class
galaxy.model.store.
ModelImportStore
(import_options=None, app=None, user=None, object_store=None)[source]¶ Bases:
object
-
__init__
(import_options=None, app=None, user=None, object_store=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
abstract
new_history_properties
()[source]¶ Dict of history properties if defines_new_history() is truthy.
-
abstract property
object_key
¶ Key used to connect objects in metadata.
Legacy exports used ‘hid’ but associated objects may not be from the same history and a history may contain multiple objects with the same ‘hid’.
-
-
class
galaxy.model.store.
ObjectImportTracker
[source]¶ Bases:
object
Keep track of new and existing imported objects.
Needed to re-establish connections and such in multiple passes.
-
class
galaxy.model.store.
BaseDirectoryImportModelStore
(import_options=None, app=None, user=None, object_store=None)[source]¶
-
class
galaxy.model.store.
DirectoryImportModelStore1901
(archive_dir, **kwd)[source]¶ Bases:
galaxy.model.store.BaseDirectoryImportModelStore
-
object_key
= 'hid'¶
-
-
class
galaxy.model.store.
DirectoryImportModelStoreLatest
(archive_dir, **kwd)[source]¶ Bases:
galaxy.model.store.BaseDirectoryImportModelStore
-
object_key
= 'encoded_id'¶
-
-
class
galaxy.model.store.
ModelExportStore
[source]¶ Bases:
object
-
class
galaxy.model.store.
DirectoryModelExportStore
(export_directory, app=None, for_edit=False, serialize_dataset_objects=None, export_files=None, strip_metadata_files=True, serialize_jobs=True)[source]¶ Bases:
galaxy.model.store.ModelExportStore
-
__init__
(export_directory, app=None, for_edit=False, serialize_dataset_objects=None, export_files=None, strip_metadata_files=True, serialize_jobs=True)[source]¶ - Parameters
export_directory – path to export directory. Will be created if it does not exist.
app – Galaxy App or app-like object. Must be provided if for_edit and/or serialize_dataset_objects are True
for_edit – Allow modifying existing HDA and dataset metadata during import.
serialize_dataset_objects – If True will encode IDs using the host secret. Defaults for_edit.
export_files – How files should be exported, can be ‘symlink’, ‘copy’ or None, in which case files will not be serialized.
serialize_jobs – Include job data in model export. Not needed for set_metadata script.
-
-
class
galaxy.model.store.
TarModelExportStore
(out_file, gzip=True, **kwds)[source]¶ Bases:
galaxy.model.store.DirectoryModelExportStore
-
__init__
(out_file, gzip=True, **kwds)[source]¶ - Parameters
export_directory – path to export directory. Will be created if it does not exist.
app – Galaxy App or app-like object. Must be provided if for_edit and/or serialize_dataset_objects are True
for_edit – Allow modifying existing HDA and dataset metadata during import.
serialize_dataset_objects – If True will encode IDs using the host secret. Defaults for_edit.
export_files – How files should be exported, can be ‘symlink’, ‘copy’ or None, in which case files will not be serialized.
serialize_jobs – Include job data in model export. Not needed for set_metadata script.
-
-
class
galaxy.model.store.
BagDirectoryModelExportStore
(out_directory, **kwds)[source]¶ Bases:
galaxy.model.store.DirectoryModelExportStore
-
__init__
(out_directory, **kwds)[source]¶ - Parameters
export_directory – path to export directory. Will be created if it does not exist.
app – Galaxy App or app-like object. Must be provided if for_edit and/or serialize_dataset_objects are True
for_edit – Allow modifying existing HDA and dataset metadata during import.
serialize_dataset_objects – If True will encode IDs using the host secret. Defaults for_edit.
export_files – How files should be exported, can be ‘symlink’, ‘copy’ or None, in which case files will not be serialized.
serialize_jobs – Include job data in model export. Not needed for set_metadata script.
-
-
class
galaxy.model.store.
BagArchiveModelExportStore
(out_file, bag_archiver='tgz', **kwds)[source]¶ Bases:
galaxy.model.store.BagDirectoryModelExportStore
-
__init__
(out_file, bag_archiver='tgz', **kwds)[source]¶ - Parameters
export_directory – path to export directory. Will be created if it does not exist.
app – Galaxy App or app-like object. Must be provided if for_edit and/or serialize_dataset_objects are True
for_edit – Allow modifying existing HDA and dataset metadata during import.
serialize_dataset_objects – If True will encode IDs using the host secret. Defaults for_edit.
export_files – How files should be exported, can be ‘symlink’, ‘copy’ or None, in which case files will not be serialized.
serialize_jobs – Include job data in model export. Not needed for set_metadata script.
-
-
galaxy.model.store.
get_export_dataset_filename
(name, ext, hid)[source]¶ Builds a filename for a dataset using its name an extension.
Submodules¶
galaxy.model.store.discover module¶
Utilities for discovering files to add to a model store.
Working with input “JSON” format used for Fetch API, galaxy.json imports, etc… High-level utilities in this file can be used during job output discovery or for persisting Galaxy model objects corresponding to files in other contexts.
-
class
galaxy.model.store.discover.
ModelPersistenceContext
[source]¶ Bases:
object
Class for creating datasets while finding files.
This class implement the create_dataset method that takes care of populating metadata required for datasets and other potential model objects.
-
create_dataset
(ext, designation, visible, dbkey, name, filename=None, extra_files=None, metadata_source_name=None, info=None, library_folder=None, link_data=False, primary_data=None, init_from=None, dataset_attributes=None, tag_list=None, sources=None, hashes=None, created_from_basename=None, final_job_state='ok', creating_job_id=None)[source]¶
-
populate_collection_elements
(collection, root_collection_builder, filenames, name=None, metadata_source_name=None, final_job_state='ok')[source]¶
-
abstract property
tag_handler
¶ Return a galaxy.model.tags.TagHandler-like object for persisting tags.
-
abstract property
user
¶ If bound to a database, return the user the datasets should be created for.
Return None otherwise.
-
abstract
add_library_dataset_to_folder
(library_folder, ld)[source]¶ Add library dataset to persisted library folder.
-
abstract
create_library_folder
(parent_folder, name, description)[source]¶ Create a library folder ready from supplied attributes for supplied parent.
-
abstract
add_output_dataset_association
(name, dataset)[source]¶ If discovering outputs for a job, persist output dataset association.
-
-
class
galaxy.model.store.discover.
PermissionProvider
[source]¶ Bases:
object
Interface for working with permissions while importing datasets with ModelPersistenceContext.
-
property
permissions
¶
-
property
-
class
galaxy.model.store.discover.
MetadataSourceProvider
[source]¶ Bases:
object
Interface for working with fetching input dataset metadata with ModelPersistenceContext.
-
class
galaxy.model.store.discover.
SessionlessModelPersistenceContext
(object_store, export_store, working_directory)[source]¶ Bases:
galaxy.model.store.discover.ModelPersistenceContext
A variant of ModelPersistenceContext that persists to an export store instead of database directly.
-
__init__
(object_store, export_store, working_directory)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
tag_handler
¶ Return a galaxy.model.tags.TagHandler-like object for persisting tags.
-
property
user
¶ If bound to a database, return the user the datasets should be created for.
Return None otherwise.
-
add_library_dataset_to_folder
(library_folder, ld)[source]¶ Add library dataset to persisted library folder.
-
create_library_folder
(parent_folder, name, description)[source]¶ Create a library folder ready from supplied attributes for supplied parent.
-
add_datasets_to_history
(datasets, for_output_dataset=None)[source]¶ Add datasets to the history this context points at.
-
-
galaxy.model.store.discover.
persist_extra_files
(object_store, src_extra_files_path, primary_data)[source]¶
-
galaxy.model.store.discover.
persist_target_to_export_store
(target_dict, export_store, object_store, work_directory)[source]¶
-
galaxy.model.store.discover.
persist_elements_to_hdca
(model_persistence_context, elements, hdca, collector=None)[source]¶
-
galaxy.model.store.discover.
persist_elements_to_folder
(model_persistence_context, elements, library_folder)[source]¶
-
galaxy.model.store.discover.
persist_hdas
(elements, model_persistence_context, final_job_state='ok')[source]¶
-
class
galaxy.model.store.discover.
DiscoveredFile
(path, collector, match)¶ Bases:
tuple
-
property
collector
¶ Alias for field number 1
-
property
match
¶ Alias for field number 2
-
property
path
¶ Alias for field number 0
-
property
-
galaxy.model.store.discover.
discovered_file_for_element
(dataset, job_working_directory, parent_identifiers=None, collector=None)[source]¶
-
class
galaxy.model.store.discover.
JsonCollectedDatasetMatch
(as_dict, collector, filename, path=None, parent_identifiers=None)[source]¶ Bases:
object
-
__init__
(as_dict, collector, filename, path=None, parent_identifiers=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
designation
¶
-
property
element_identifiers
¶
-
property
raw_element_identifiers
¶
-
property
name
¶ Return name or None if not defined by the discovery pattern.
-
property
dbkey
¶
-
property
ext
¶
-
property
visible
¶
-
property
link_data
¶
-
property
tag_list
¶
-
property
object_id
¶
-
property
sources
¶
-
property
hashes
¶
-
property
created_from_basename
¶
-
property
extra_files
¶
-
-
class
galaxy.model.store.discover.
RegexCollectedDatasetMatch
(re_match, collector, filename, path=None)[source]¶ Bases:
galaxy.model.store.discover.JsonCollectedDatasetMatch