galaxy.model package

Galaxy data model classes

Naming: try to use class names that have a distinct plural form so that the relationship cardinalities are obvious (e.g. prefer Dataset to Data)

class galaxy.model.APIKeys(id=None, user_id=None, key=None)[source]

Bases: object

__init__(id=None, user_id=None, key=None)
class galaxy.model.BaseJobMetric(plugin, metric_name, metric_value)[source]

Bases: object

__init__(plugin, metric_name, metric_value)[source]
exception galaxy.model.ConverterDependencyException(value)[source]

Bases: exceptions.Exception

__init__(value)[source]
class galaxy.model.DataManagerHistoryAssociation(id=None, history=None, user=None)[source]

Bases: object

__init__(id=None, history=None, user=None)
class galaxy.model.DataManagerJobAssociation(id=None, job=None, data_manager_id=None)[source]

Bases: object

__init__(id=None, job=None, data_manager_id=None)
class galaxy.model.Dataset(id=None, state=None, external_filename=None, extra_files_path=None, file_size=None, purgable=True, uuid=None)[source]

Bases: galaxy.model.StorableObject

__init__(id=None, state=None, external_filename=None, extra_files_path=None, file_size=None, purgable=True, uuid=None)
conversion_messages = <galaxy.util.bunch.Bunch object>
engine = None
extra_files_path
file_name
file_path = '/tmp/'
full_delete()[source]

Remove the file and extra files, marks deleted and purged

get_access_roles(trans)[source]
get_extra_files_path()[source]
get_file_name()[source]
get_manage_permissions_roles(trans)[source]
get_size(nice_size=False)[source]

Returns the size of the data on disk

get_total_size()[source]
has_data()[source]

Detects whether there is any data

has_manage_permissions_roles(trans)[source]
in_ready_state()[source]
is_multi_byte()[source]
mark_deleted(include_children=True)[source]
non_ready_states = ('new', 'upload', 'queued', 'running', 'setting_metadata')
object_store = None
permitted_actions = <galaxy.util.bunch.Bunch object>
ready_states = ('discarded', 'ok', 'failed_metadata', 'paused', 'error', 'empty')
set_extra_files_path(extra_files_path)[source]
set_file_name(filename)[source]
set_size()[source]

Returns the size of the data on disk

set_total_size()[source]
states = <galaxy.util.bunch.Bunch object>
terminal_states = ('ok', 'empty', 'error', 'discarded', 'failed_metadata')
user_can_purge
valid_input_states = ('ok', 'failed_metadata', 'upload', 'paused', 'running', 'setting_metadata', 'new', 'queued', 'empty')
class galaxy.model.DatasetCollection(id=None, collection_type=None, populated=True)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable, galaxy.model.item_attrs.UsesAnnotations

__init__(id=None, collection_type=None, populated=True)
copy(destination=None, element_destination=None)[source]
dataset_elements
dataset_instances
dict_collection_visible_keys = ('id', 'collection_type')
dict_element_visible_keys = ('id', 'collection_type')
handle_population_failed(message)[source]
has_subcollections
mark_as_populated()[source]
populated
populated_states = <galaxy.util.bunch.Bunch object>
set_from_dict(new_data)[source]
state
validate()[source]
waiting_for_elements
class galaxy.model.DatasetCollectionElement(id=None, collection=None, element=None, element_index=None, element_identifier=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

Associates a DatasetInstance (hda or ldda) with a DatasetCollection.

__init__(id=None, collection=None, element=None, element_index=None, element_identifier=None)
copy_to_collection(collection, destination=None, element_destination=None)[source]
dataset
dataset_instance
dict_collection_visible_keys = ('id', 'element_type', 'element_index', 'element_identifier')
dict_element_visible_keys = ('id', 'element_type', 'element_index', 'element_identifier')
element_object
element_type
first_dataset_instance()[source]
is_collection
class galaxy.model.DatasetCollectionInstance(collection=None, deleted=False)[source]

Bases: object, galaxy.model.HasName

__init__(collection=None, deleted=False)[source]
dataset_instances
display_name()[source]
populated
set_from_dict(new_data)[source]

Set object attributes to the values in dictionary new_data limiting to only those keys in dict_element_visible_keys.

Returns a dictionary of the keys, values that have been changed.

state
class galaxy.model.DatasetInstance(id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None, dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None, parent_id=None, validation_errors=None, visible=True, create_dataset=False, sa_session=None, extended_metadata=None, flush=True)[source]

Bases: object

A base class for all ‘dataset instances’, HDAs, LDAs, etc

__init__(id=None, hid=None, name=None, info=None, blurb=None, peek=None, tool_version=None, extension=None, dbkey=None, metadata=None, history=None, dataset=None, deleted=False, designation=None, parent_id=None, validation_errors=None, visible=True, create_dataset=False, sa_session=None, extended_metadata=None, flush=True)[source]
add_validation_error(validation_error)[source]
as_display_type(type, **kwd)[source]
can_convert_to(format)[source]
change_datatype(new_ext)[source]
clear_associated_files(metadata_safe=False, purge=False)[source]
conversion_messages = <galaxy.util.bunch.Bunch object>
convert_dataset(trans, target_type)[source]

Converts a dataset to the target_type and returns a message indicating status of the conversion. None is returned to indicate that dataset was converted successfully.

copy_attributes(new_dataset)[source]

Copies attributes to a new datasets, used for implicit conversions

creating_job
datatype
dbkey
display_info()[source]
display_name()[source]
display_peek()[source]
ext
extend_validation_errors(validation_errors)[source]
extra_files_path
file_name
find_conversion_destination(accepted_formats, **kwd)[source]

Returns ( target_ext, existing converted dataset )

get_child_by_designation(designation)[source]
get_converted_dataset(trans, target_ext, target_context=None, history=None)[source]

Return converted dataset(s) if they exist, along with a dict of dependencies. If not converted yet, do so and return None (the first time). If unconvertible, raise exception.

get_converted_dataset_deps(trans, target_ext)[source]

Returns dict of { “dependency” => HDA }

get_converted_files_by_type(file_type)[source]
get_converter_types()[source]
get_dataset_state()[source]
get_datasources(trans)[source]

Returns datasources for dataset; if datasources are not available due to indexing, indexing is started. Return value is a dictionary with entries of type (<datasource_type> : {<datasource_name>, <indexing_message>}).

get_dbkey()[source]
get_display_applications(trans)[source]
get_file_name()[source]
get_metadata()[source]
get_metadata_dataset(dataset_ext)[source]

Returns an HDA that points to a metadata file which contains a converted data with the requested extension.

get_mime()[source]

Returns the mime type of the data

get_raw_data()[source]

Returns the full data. To stream it open the file_name and read/write as needed

get_size(nice_size=False)[source]

Returns the size of the data on disk

get_total_size()[source]
get_visualizations()[source]
has_data()[source]

Detects whether there is any data

init_meta(copy_from=None)[source]
is_multi_byte()[source]

Data consists of multi-byte characters

is_ok
is_pending

Return true if the dataset is neither ready nor in error

mark_deleted(include_children=True)[source]
mark_undeleted(include_children=True)[source]
mark_unhidden(include_children=True)[source]
metadata
missing_meta(**kwd)[source]
permitted_actions = <galaxy.util.bunch.Bunch object>
raw_set_dataset_state(state)[source]
set_dataset_state(state)[source]
set_dbkey(value)[source]
set_file_name(filename)[source]
set_meta(**kwd)[source]
set_metadata(bunch)[source]
set_peek(is_multi_byte=False)[source]
set_raw_data(data)[source]

Saves the data on the disc

set_size()[source]

Returns the size of the data on disk

set_total_size()[source]
source_dataset_chain
source_library_dataset
state
states = <galaxy.util.bunch.Bunch object>
undeletable()[source]
write_from_stream(stream)[source]

Writes data from a stream

class galaxy.model.DatasetPermissions(action, dataset, role=None, role_id=None)[source]

Bases: object

__init__(action, dataset, role=None, role_id=None)
class galaxy.model.DatasetTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.DatasetToValidationErrorAssociation(dataset, validation_error)[source]

Bases: object

__init__(dataset, validation_error)[source]
class galaxy.model.DefaultHistoryPermissions(history, action, role)[source]

Bases: object

__init__(history, action, role)
class galaxy.model.DefaultQuotaAssociation(type, quota)[source]

Bases: galaxy.model.Quota, galaxy.util.dictifiable.Dictifiable

__init__(type, quota)
dict_element_visible_keys = ('type',)
types = <galaxy.util.bunch.Bunch object>
class galaxy.model.DefaultUserPermissions(user, action, role)[source]

Bases: object

__init__(user, action, role)
class galaxy.model.DeferredJob(state=None, plugin=None, params=None)[source]

Bases: object

__init__(state=None, plugin=None, params=None)
check_interval
get_check_interval()[source]
get_last_check()[source]
is_check_time
last_check
set_check_interval(seconds)[source]
set_last_check(seconds)[source]
states = <galaxy.util.bunch.Bunch object>
class galaxy.model.Event(message=None, history=None, user=None, galaxy_session=None)[source]

Bases: object

__init__(message=None, history=None, user=None, galaxy_session=None)
class galaxy.model.ExtendedMetadata(data)[source]

Bases: object

__init__(data)
class galaxy.model.ExtendedMetadataIndex(extended_metadata, path, value)[source]

Bases: object

__init__(extended_metadata, path, value)
class galaxy.model.ExternalService(name=None, description=None, external_service_type_id=None, version=None, form_definition_id=None, form_values_id=None, deleted=None)[source]

Bases: object

__init__(name=None, description=None, external_service_type_id=None, version=None, form_definition_id=None, form_values_id=None, deleted=None)
data_transfer_protocol = <galaxy.util.bunch.Bunch object>
get_external_service_type(trans)[source]
load_data_transfer_settings(trans)[source]
populate_actions(trans, item, param_dict=None)[source]
class galaxy.model.FormDefinition(name=None, desc=None, fields=[], form_definition_current=None, form_type=None, layout=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name=None, desc=None, fields=[], form_definition_current=None, form_type=None, layout=None)
dict_collection_visible_keys = ('id', 'name')
dict_element_visible_keys = ('id', 'name', 'desc', 'form_definition_current_id', 'fields', 'layout')
field_as_html(field)[source]

Generates disabled html for a field

get_widgets(user, contents={}, **kwd)[source]

Return the list of widgets that comprise a form definition, including field contents if any.

grid_fields(grid_index)[source]
supported_field_types = [<class 'galaxy.web.form_builder.AddressField'>, <class 'galaxy.web.form_builder.CheckboxField'>, <class 'galaxy.web.form_builder.PasswordField'>, <class 'galaxy.web.form_builder.SelectField'>, <class 'galaxy.web.form_builder.TextArea'>, <class 'galaxy.web.form_builder.TextField'>, <class 'galaxy.web.form_builder.WorkflowField'>, <class 'galaxy.web.form_builder.WorkflowMappingField'>, <class 'galaxy.web.form_builder.HistoryField'>]
to_dict(user=None, values=None, security=None)[source]
types = <galaxy.util.bunch.Bunch object>
class galaxy.model.FormDefinitionCurrent(form_definition=None)[source]

Bases: object

__init__(form_definition=None)
class galaxy.model.FormValues(form_def=None, content=None)[source]

Bases: object

__init__(form_def=None, content=None)
class galaxy.model.GalaxySession(id=None, user=None, remote_host=None, remote_addr=None, referer=None, current_history=None, session_key=None, is_valid=False, prev_session_id=None, last_action=None)[source]

Bases: object

__init__(id=None, user=None, remote_host=None, remote_addr=None, referer=None, current_history=None, session_key=None, is_valid=False, prev_session_id=None, last_action=None)
add_history(history, association=None)[source]
get_disk_usage()[source]
set_disk_usage(bytes)[source]
total_disk_usage
class galaxy.model.GalaxySessionToHistoryAssociation(galaxy_session, history)[source]

Bases: object

__init__(galaxy_session, history)
class galaxy.model.GenomeIndexToolData(job=None, params=None, dataset=None, deferred_job=None, transfer_job=None, fasta_path=None, created_time=None, modified_time=None, dbkey=None, user=None, indexer=None)[source]

Bases: object

__init__(job=None, params=None, dataset=None, deferred_job=None, transfer_job=None, fasta_path=None, created_time=None, modified_time=None, dbkey=None, user=None, indexer=None)
class galaxy.model.Group(name=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name=None)
dict_collection_visible_keys = ('id', 'name')
dict_element_visible_keys = ('id', 'name')
class galaxy.model.GroupQuotaAssociation(group, quota)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(group, quota)
dict_element_visible_keys = ('group',)
class galaxy.model.GroupRoleAssociation(group, role)[source]

Bases: object

__init__(group, role)
class galaxy.model.HasName[source]
get_display_name()[source]

These objects have a name attribute can be either a string or a unicode object. If string, convert to unicode object assuming ‘utf-8’ format.

class galaxy.model.History(id=None, name=None, user=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable, galaxy.model.item_attrs.UsesAnnotations, galaxy.model.HasName

__init__(id=None, name=None, user=None)
activatable_datasets
active_contents

Return all active contents ordered by hid.

active_datasets_and_roles
add_dataset(dataset, parent_id=None, genome_build=None, set_hid=True, quota=True)[source]
add_dataset_collection(history_dataset_collection, set_hid=True)[source]
add_datasets(sa_session, datasets, parent_id=None, genome_build=None, set_hid=True, quota=True, flush=False)[source]

Optimized version of add_dataset above that minimizes database interactions when adding many datasets to history at once.

add_galaxy_session(galaxy_session, association=None)[source]
contents_iter(**kwds)[source]

Fetch filtered list of contents of history.

copy(name=None, target_user=None, activatable=False, all_datasets=False)[source]

Return a copy of this history using the given name and target_user. If activatable, copy only non-deleted datasets. If all_datasets, copy non-deleted, deleted, and purged datasets.

copy_tags_from(target_user, source_history)[source]
default_name = 'Unnamed history'
dict_collection_visible_keys = ('id', 'name', 'published', 'deleted')
dict_element_visible_keys = ('id', 'name', 'genome_build', 'deleted', 'purged', 'update_time', 'published', 'importable', 'slug', 'empty')
disk_nice_size

Returns human readable size of history on disk.

disk_size

Return the size in bytes of this history by summing the ‘total_size’s of all non-purged, unique datasets within it.

empty
latest_export
resume_paused_jobs()[source]
to_dict(view='collection', value_mapper=None)[source]
unhide_datasets()[source]
class galaxy.model.HistoryAnnotationAssociation[source]

Bases: object

class galaxy.model.HistoryDatasetAssociation(hid=None, history=None, copied_from_history_dataset_association=None, copied_from_library_dataset_dataset_association=None, sa_session=None, **kwd)[source]

Bases: galaxy.model.DatasetInstance, galaxy.util.dictifiable.Dictifiable, galaxy.model.item_attrs.UsesAnnotations, galaxy.model.HasName

Resource class that creates a relation between a dataset and a user history.

__init__(hid=None, history=None, copied_from_history_dataset_association=None, copied_from_library_dataset_dataset_association=None, sa_session=None, **kwd)

Create a a new HDA and associate it with the given history.

clear_associated_files(metadata_safe=False, purge=False)[source]
content_type = u'dataset'
copy(copy_children=False, parent_id=None)[source]

Create a copy of this HDA.

copy_attributes(new_dataset)[source]
copy_tags_from(target_user, source_hda)[source]

Copy tags from source_hda to this HDA and assign them the user target_user.

get_access_roles(trans)[source]

Return The access roles associated with this HDA’s dataset.

history_content_type
quota_amount(user)[source]

Return the disk space used for this HDA relevant to user quotas.

If the user has multiple instances of this dataset, it will not affect their disk usage statistic.

to_dict(view='collection', expose_dataset_path=False)[source]

Return attributes of this HDA that are exposed using the API.

to_library_dataset_dataset_association(trans, target_folder, replace_dataset=None, parent_id=None, user=None, roles=None, ldda_message='')[source]

Copy this HDA to a library optionally replacing an existing LDDA.

type_id
class galaxy.model.HistoryDatasetAssociationAnnotationAssociation[source]

Bases: object

class galaxy.model.HistoryDatasetAssociationDisplayAtAuthorization(hda=None, user=None, site=None)[source]

Bases: object

__init__(hda=None, user=None, site=None)
class galaxy.model.HistoryDatasetAssociationRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(history_dataset_association)[source]
class galaxy.model.HistoryDatasetAssociationSubset(hda, subset, location)[source]

Bases: object

__init__(hda, subset, location)
class galaxy.model.HistoryDatasetAssociationTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.HistoryDatasetCollectionAnnotationAssociation[source]

Bases: object

class galaxy.model.HistoryDatasetCollectionAssociation(id=None, hid=None, collection=None, history=None, name=None, deleted=False, visible=True, copied_from_history_dataset_collection_association=None, implicit_output_name=None, implicit_input_collections=[])[source]

Bases: galaxy.model.DatasetCollectionInstance, galaxy.model.item_attrs.UsesAnnotations, galaxy.util.dictifiable.Dictifiable

Associates a DatasetCollection with a History.

__init__(id=None, hid=None, collection=None, history=None, name=None, deleted=False, visible=True, copied_from_history_dataset_collection_association=None, implicit_output_name=None, implicit_input_collections=[])
add_implicit_input_collection(name, history_dataset_collection)[source]
content_type = u'dataset_collection'
copy(element_destination=None)[source]

Create a copy of this history dataset collection association. Copy underlying collection.

editable_keys = ('name', 'deleted', 'visible')
find_implicit_input_collection(name)[source]
history_content_type
to_dict(view='collection')[source]
to_hda_representative(multiple=False)[source]
type_id
class galaxy.model.HistoryDatasetCollectionRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(dataset_collection)[source]
class galaxy.model.HistoryDatasetCollectionTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.HistoryRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(history)[source]
class galaxy.model.HistoryTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.HistoryUserShareAssociation[source]

Bases: object

__init__()
class galaxy.model.ImplicitlyConvertedDatasetAssociation(id=None, parent=None, dataset=None, file_type=None, deleted=False, purged=False, metadata_safe=True)[source]

Bases: object

__init__(id=None, parent=None, dataset=None, file_type=None, deleted=False, purged=False, metadata_safe=True)
clear(purge=False, delete_dataset=True)[source]
class galaxy.model.ImplicitlyCreatedDatasetCollectionInput(name, input_dataset_collection)[source]

Bases: object

__init__(name, input_dataset_collection)
class galaxy.model.ItemRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: object

__init__(id=None, user=None, item=None, rating=0)[source]
set_item(item)[source]

Set association’s item.

class galaxy.model.ItemTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]
copy()[source]
dict_collection_visible_keys = ('id', 'user_tname', 'user_value')
dict_element_visible_keys = ('id', 'user_tname', 'user_value')
class galaxy.model.Job[source]

Bases: object, galaxy.model.JobLike, galaxy.util.dictifiable.Dictifiable

__init__()
add_implicit_output_dataset_collection(name, dataset_collection)[source]
add_input_dataset(name, dataset=None, dataset_id=None)[source]
add_input_dataset_collection(name, dataset_collection)[source]
add_input_library_dataset(name, dataset)[source]
add_output_dataset(name, dataset)[source]
add_output_dataset_collection(name, dataset_collection_instance)[source]
add_output_library_dataset(name, dataset)[source]
add_parameter(name, value)[source]
add_post_job_action(pja)[source]
check_if_output_datasets_deleted()[source]

Return true if all of the output datasets associated with this job are in the deleted state

dict_collection_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time']
dict_element_visible_keys = ['id', 'state', 'exit_code', 'update_time', 'create_time']

A job represents a request to run a tool given input datasets, tool parameters, and output datasets.

finished
get_command_line()[source]
get_dependencies()[source]
get_destination_configuration(config, key, default=None)[source]

Get a destination parameter that can be defaulted back in specified config if it needs to be applied globally.

get_external_output_metadata()[source]

The external_output_metadata is currently a reference from Job to JobExternalOutputMetadata. It exists for a job but not a task.

get_handler()[source]
get_id()[source]
get_id_tag()[source]

Return a tag that can be useful in identifying a Job. This returns the Job’s get_id

get_imported()[source]
get_info()[source]
get_input_datasets()[source]
get_input_library_datasets()[source]
get_job()[source]
get_job_runner_external_id()[source]
get_job_runner_name()[source]
get_output_datasets()[source]
get_output_library_datasets()[source]
get_param_filename()[source]
get_param_values(app, ignore_errors=False)[source]

Read encoded parameter values from the database and turn back into a dict of tool parameter values.

get_parameters()[source]
get_params()[source]
get_post_job_actions()[source]
get_session_id()[source]
get_state()[source]
get_tasks()[source]
get_tool_id()[source]
get_tool_version()[source]
get_user()[source]
get_user_id()[source]
mark_deleted(track_jobs_in_database=False)[source]

Mark this job as deleted, and mark any output datasets as discarded.

non_ready_states = ['new', 'resubmitted', 'upload', 'waiting', 'queued', 'running']

job states where the job hasn’t finished and the model may still change

raw_param_dict()[source]
seconds_since_update
set_command_line(command_line)[source]
set_dependencies(dependencies)[source]
set_final_state(final_state)[source]
set_handler(handler)[source]
set_imported(imported)[source]
set_info(info)[source]
set_input_datasets(input_datasets)[source]
set_input_library_datasets(input_library_datasets)[source]
set_output_datasets(output_datasets)[source]
set_output_library_datasets(output_library_datasets)[source]
set_param_filename(param_filename)[source]
set_parameters(parameters)[source]
set_params(params)[source]
set_post_job_actions(post_job_actions)[source]
set_runner_external_id(job_runner_external_id)[source]
set_runner_name(job_runner_name)[source]
set_session_id(session_id)[source]
set_state(state)[source]

Save state history

set_tool_id(tool_id)[source]
set_tool_version(tool_version)[source]
set_user_id(user_id)[source]
states = <galaxy.util.bunch.Bunch object>
terminal_states = ['ok', 'error', 'deleted']
to_dict(view='collection', system_details=False)[source]
class galaxy.model.JobExportHistoryArchive(job=None, history=None, dataset=None, compressed=False, history_attrs_filename=None, datasets_attrs_filename=None, jobs_attrs_filename=None)[source]

Bases: object

__init__(job=None, history=None, dataset=None, compressed=False, history_attrs_filename=None, datasets_attrs_filename=None, jobs_attrs_filename=None)
export_name
preparing
ready
up_to_date

Return False, if a new export should be generated for corresponding history.

class galaxy.model.JobExternalOutputMetadata(job=None, dataset=None)[source]

Bases: object

__init__(job=None, dataset=None)
dataset
class galaxy.model.JobImportHistoryArchive(job=None, history=None, archive_dir=None)[source]

Bases: object

__init__(job=None, history=None, archive_dir=None)
class galaxy.model.JobLike[source]
add_metric(plugin, metric_name, metric_value)[source]
log_str()[source]
metrics
set_streams(stdout, stderr)[source]
class galaxy.model.JobMetricNumeric(plugin, metric_name, metric_value)[source]

Bases: galaxy.model.BaseJobMetric

class galaxy.model.JobMetricText(plugin, metric_name, metric_value)[source]

Bases: galaxy.model.BaseJobMetric

class galaxy.model.JobParameter(name, value)[source]

Bases: object

__init__(name, value)
class galaxy.model.JobStateHistory(job)[source]

Bases: object

__init__(job)
class galaxy.model.JobToImplicitOutputDatasetCollectionAssociation(name, dataset_collection)[source]

Bases: object

__init__(name, dataset_collection)
class galaxy.model.JobToInputDatasetAssociation(name, dataset)[source]

Bases: object

__init__(name, dataset)
class galaxy.model.JobToInputDatasetCollectionAssociation(name, dataset_collection)[source]

Bases: object

__init__(name, dataset_collection)
class galaxy.model.JobToInputLibraryDatasetAssociation(name, dataset)[source]

Bases: object

__init__(name, dataset)
class galaxy.model.JobToOutputDatasetAssociation(name, dataset)[source]

Bases: object

__init__(name, dataset)
class galaxy.model.JobToOutputDatasetCollectionAssociation(name, dataset_collection_instance)[source]

Bases: object

__init__(name, dataset_collection_instance)
class galaxy.model.JobToOutputLibraryDatasetAssociation(name, dataset)[source]

Bases: object

__init__(name, dataset)
class galaxy.model.Library(name=None, description=None, synopsis=None, root_folder=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable, galaxy.model.HasName

__init__(name=None, description=None, synopsis=None, root_folder=None)
dict_collection_visible_keys = ('id', 'name')
dict_element_visible_keys = ('id', 'deleted', 'name', 'description', 'synopsis', 'root_folder_id', 'create_time')
get_access_roles(trans)[source]
get_active_folders(folder, folders=None)[source]
get_info_association(restrict=False, inherited=False)[source]
get_template_widgets(trans, get_contents=True)[source]
permitted_actions = <galaxy.util.bunch.Bunch object>
to_dict(view='collection', value_mapper=None)[source]

We prepend an F to folders.

class galaxy.model.LibraryDataset(folder=None, order_id=None, name=None, info=None, library_dataset_dataset_association=None, **kwd)[source]

Bases: object

__init__(folder=None, order_id=None, name=None, info=None, library_dataset_dataset_association=None, **kwd)
display_name()[source]
get_info()[source]
get_name()[source]
info
name
set_info(info)[source]
set_library_dataset_dataset_association(ldda)[source]
set_name(name)[source]
to_dict(view='collection')[source]
upload_options = [('upload_file', 'Upload files'), ('upload_directory', 'Upload directory of files'), ('upload_paths', 'Upload files from filesystem paths'), ('import_from_history', 'Import datasets from your current history')]
class galaxy.model.LibraryDatasetCollectionAnnotationAssociation[source]

Bases: object

class galaxy.model.LibraryDatasetCollectionAssociation(id=None, collection=None, name=None, deleted=False, folder=None)[source]

Bases: galaxy.model.DatasetCollectionInstance, galaxy.util.dictifiable.Dictifiable

Associates a DatasetCollection with a library folder.

__init__(id=None, collection=None, name=None, deleted=False, folder=None)
editable_keys = ('name', 'deleted')
to_dict(view='collection')[source]
class galaxy.model.LibraryDatasetCollectionRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(dataset_collection)[source]
class galaxy.model.LibraryDatasetCollectionTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.LibraryDatasetDatasetAssociation(copied_from_history_dataset_association=None, copied_from_library_dataset_dataset_association=None, library_dataset=None, user=None, sa_session=None, **kwd)[source]

Bases: galaxy.model.DatasetInstance, galaxy.model.HasName

__init__(copied_from_history_dataset_association=None, copied_from_library_dataset_dataset_association=None, library_dataset=None, user=None, sa_session=None, **kwd)
clear_associated_files(metadata_safe=False, purge=False)[source]
copy(copy_children=False, parent_id=None, target_folder=None)[source]
get_access_roles(trans)[source]
get_info_association(restrict=False, inherited=False)[source]
get_manage_permissions_roles(trans)[source]
get_template_widgets(trans, get_contents=True)[source]
has_manage_permissions_roles(trans)[source]
templates_dict(use_name=False)[source]

Returns a dict of template info

templates_json(use_name=False)[source]
to_dict(view='collection')[source]
to_history_dataset_association(target_history, parent_id=None, add_to_history=False)[source]
class galaxy.model.LibraryDatasetDatasetAssociationPermissions(action, library_item, role)[source]

Bases: object

__init__(action, library_item, role)
class galaxy.model.LibraryDatasetDatasetInfoAssociation(library_dataset_dataset_association, form_definition, info)[source]

Bases: object

__init__(library_dataset_dataset_association, form_definition, info)
inheritable
class galaxy.model.LibraryDatasetPermissions(action, library_item, role)[source]

Bases: object

__init__(action, library_item, role)
class galaxy.model.LibraryFolder(name=None, description=None, item_count=0, order_id=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable, galaxy.model.HasName

__init__(name=None, description=None, item_count=0, order_id=None)
activatable_library_datasets
add_folder(folder)[source]
add_library_dataset(library_dataset, genome_build=None)[source]
dict_element_visible_keys = ('id', 'parent_id', 'name', 'description', 'item_count', 'genome_build', 'update_time', 'deleted')
get_info_association(restrict=False, inherited=False)[source]
get_template_widgets(trans, get_contents=True)[source]
library_path
parent_library
to_dict(view='collection', value_mapper=None)[source]
class galaxy.model.LibraryFolderInfoAssociation(folder, form_definition, info, inheritable=False)[source]

Bases: object

__init__(folder, form_definition, info, inheritable=False)
class galaxy.model.LibraryFolderPermissions(action, library_item, role)[source]

Bases: object

__init__(action, library_item, role)
class galaxy.model.LibraryInfoAssociation(library, form_definition, info, inheritable=False)[source]

Bases: object

__init__(library, form_definition, info, inheritable=False)
class galaxy.model.LibraryPermissions(action, library_item, role)[source]

Bases: object

__init__(action, library_item, role)
class galaxy.model.MetadataFile(dataset=None, name=None)[source]

Bases: galaxy.model.StorableObject

__init__(dataset=None, name=None)
file_name
exception galaxy.model.NoConverterException(value)[source]

Bases: exceptions.Exception

__init__(value)[source]
class galaxy.model.Page[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__()
dict_element_visible_keys = ['id', 'title', 'latest_revision_id', 'slug', 'published', 'importable', 'deleted']
to_dict(view='element')[source]
class galaxy.model.PageAnnotationAssociation[source]

Bases: object

class galaxy.model.PageRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(page)[source]
class galaxy.model.PageRevision[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__()
dict_element_visible_keys = ['id', 'page_id', 'title', 'content']
to_dict(view='element')[source]
class galaxy.model.PageTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.PageUserShareAssociation[source]

Bases: object

__init__()
class galaxy.model.PasswordResetToken(user, token=None)[source]

Bases: object

__init__(user, token=None)
class galaxy.model.PostJobAction(action_type, workflow_step, output_name=None, action_arguments=None)[source]

Bases: object

__init__(action_type, workflow_step, output_name=None, action_arguments=None)
class galaxy.model.PostJobActionAssociation(pja, job=None, job_id=None)[source]

Bases: object

__init__(pja, job=None, job_id=None)
class galaxy.model.Quota(name='', description='', amount=0, operation='=')[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name='', description='', amount=0, operation='=')
amount
dict_collection_visible_keys = ('id', 'name')
dict_element_visible_keys = ('id', 'name', 'description', 'bytes', 'operation', 'display_amount', 'default', 'users', 'groups')
display_amount
get_amount()[source]
set_amount(amount)[source]
valid_operations = ('+', '-', '=')
class galaxy.model.Request(name=None, desc=None, request_type=None, user=None, form_values=None, notification=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name=None, desc=None, request_type=None, user=None, form_values=None, notification=None)
dict_collection_visible_keys = ('id', 'name', 'state')
get_sample(sample_name)[source]
is_complete
is_new
is_rejected
is_submitted
is_unsubmitted
last_comment
latest_event
samples_have_common_state

Returns the state of this request’s samples when they are all in one common state. Otherwise returns False.

samples_with_bar_code
samples_without_library_destinations
send_email_notification(trans, common_state, final_state=False)[source]
state
states = <galaxy.util.bunch.Bunch object>
class galaxy.model.RequestEvent(request=None, request_state=None, comment='')[source]

Bases: object

__init__(request=None, request_state=None, comment='')
class galaxy.model.RequestType(name=None, desc=None, request_form=None, sample_form=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name=None, desc=None, request_form=None, sample_form=None)
add_external_service_association(trans, external_service)[source]
delete_external_service_associations(trans)[source]

Deletes all external service associations.

dict_collection_visible_keys = ('id', 'name', 'desc')
dict_element_visible_keys = ('id', 'name', 'desc', 'request_form_id', 'sample_form_id')
external_services
final_sample_state
get_external_service(external_service_type_id)[source]
get_external_services_for_manual_data_transfer(trans)[source]

Returns all external services that use manual data transfer

get_template_widgets(trans, get_contents=True)[source]
permitted_actions = <galaxy.util.bunch.Bunch object>
rename_dataset_options = <galaxy.util.bunch.Bunch object>
run_details
class galaxy.model.RequestTypeExternalServiceAssociation(request_type, external_service)[source]

Bases: object

__init__(request_type, external_service)
class galaxy.model.RequestTypePermissions(action, request_type, role)[source]

Bases: object

__init__(action, request_type, role)
class galaxy.model.RequestTypeRunAssociation(request_type, run)[source]

Bases: object

__init__(request_type, run)
class galaxy.model.Role(name='', description='', type='system', deleted=False)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name='', description='', type='system', deleted=False)
dict_collection_visible_keys = ('id', 'name')
dict_element_visible_keys = ('id', 'name', 'description', 'type')
private_id = None
types = <galaxy.util.bunch.Bunch object>
class galaxy.model.Run(form_definition, form_values, subindex=None)[source]

Bases: object

__init__(form_definition, form_values, subindex=None)
class galaxy.model.Sample(name=None, desc=None, request=None, form_values=None, bar_code=None, library=None, folder=None, workflow=None, history=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(name=None, desc=None, request=None, form_values=None, bar_code=None, library=None, folder=None, workflow=None, history=None)
adding_to_library_dataset_files
bulk_operations = <galaxy.util.bunch.Bunch object>
dict_collection_visible_keys = ('id', 'name')
get_template_widgets(trans, get_contents=True)[source]
inprogress_dataset_files
latest_event
populate_external_services(param_dict=None, trans=None)[source]
queued_dataset_files
run_details
state
supported_field_types = [<class 'galaxy.web.form_builder.CheckboxField'>, <class 'galaxy.web.form_builder.SelectField'>, <class 'galaxy.web.form_builder.TextField'>, <class 'galaxy.web.form_builder.WorkflowField'>, <class 'galaxy.web.form_builder.WorkflowMappingField'>, <class 'galaxy.web.form_builder.HistoryField'>]
transfer_error_dataset_files
transferred_dataset_files
transferring_dataset_files
untransferred_dataset_files
class galaxy.model.SampleDataset(sample=None, name=None, file_path=None, status=None, error_msg=None, size=None, external_service=None)[source]

Bases: object

__init__(sample=None, name=None, file_path=None, status=None, error_msg=None, size=None, external_service=None)
transfer_status = <galaxy.util.bunch.Bunch object>
class galaxy.model.SampleEvent(sample=None, sample_state=None, comment='')[source]

Bases: object

__init__(sample=None, sample_state=None, comment='')
class galaxy.model.SampleRunAssociation(sample, run)[source]

Bases: object

__init__(sample, run)
class galaxy.model.SampleState(name=None, desc=None, request_type=None)[source]

Bases: object

__init__(name=None, desc=None, request_type=None)
class galaxy.model.StorableObject(id, **kwargs)[source]

Bases: object

__init__(id, **kwargs)[source]
class galaxy.model.StoredWorkflow[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__()
copy_tags_from(target_user, source_workflow)[source]
dict_collection_visible_keys = ('id', 'name', 'published', 'deleted')
dict_element_visible_keys = ('id', 'name', 'published', 'deleted')
to_dict(view='collection', value_mapper=None)[source]
class galaxy.model.StoredWorkflowAnnotationAssociation[source]

Bases: object

class galaxy.model.StoredWorkflowMenuEntry[source]

Bases: object

__init__()
class galaxy.model.StoredWorkflowRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(stored_workflow)[source]
class galaxy.model.StoredWorkflowTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.StoredWorkflowUserShareAssociation[source]

Bases: object

__init__()
class galaxy.model.Tag(id=None, type=None, parent_id=None, name=None)[source]

Bases: object

__init__(id=None, type=None, parent_id=None, name=None)
class galaxy.model.Task(job, working_directory, prepare_files_cmd)[source]

Bases: object, galaxy.model.JobLike

A task represents a single component of a job.

__init__(job, working_directory, prepare_files_cmd)
get_command_line()[source]
get_external_output_metadata()[source]

The external_output_metadata is currently a backref to JobExternalOutputMetadata. It exists for a job but not a task, and when a task is cancelled its corresponding parent Job will be cancelled. So None is returned now, but that could be changed to self.get_job().get_external_output_metadata().

get_id()[source]
get_id_tag()[source]

Return an id tag suitable for identifying the task. This combines the task’s job id and the task’s own id.

get_info()[source]
get_job()[source]
get_job_runner_external_id()[source]

Runners will use the same methods to get information about the Task class as they will about the Job class, so this method just returns the task’s external id.

get_job_runner_name()[source]

Since runners currently access Tasks the same way they access Jobs, this method just refers to this instance’s runner.

get_param_values(app)[source]

Read encoded parameter values from the database and turn back into a dict of tool parameter values.

get_parameters()[source]
get_prepare_input_files_cmd()[source]
get_session_id()[source]
get_state()[source]
get_stderr()[source]
get_stdout()[source]
get_task_runner_external_id()[source]
get_task_runner_name()[source]
get_working_directory()[source]
set_command_line(command_line)[source]
set_id(id)[source]
set_info(info)[source]
set_job(job)[source]
set_job_runner_external_id(task_runner_external_id)[source]
set_parameters(parameters)[source]
set_prepare_input_files_cmd(prepare_input_files_cmd)[source]
set_state(state)[source]
set_stderr(stderr)[source]
set_stdout(stdout)[source]
set_task_runner_external_id(task_runner_external_id)[source]
set_task_runner_name(task_runner_name)[source]
set_working_directory(working_directory)[source]
states = <galaxy.util.bunch.Bunch object>
class galaxy.model.TaskMetricNumeric(plugin, metric_name, metric_value)[source]

Bases: galaxy.model.BaseJobMetric

class galaxy.model.TaskMetricText(plugin, metric_name, metric_value)[source]

Bases: galaxy.model.BaseJobMetric

class galaxy.model.ToolTagAssociation(id=None, user=None, tool_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

__init__(id=None, user=None, tool_id=None, tag_id=None, user_tname=None, value=None)
class galaxy.model.TransferJob(state=None, path=None, info=None, pid=None, socket=None, params=None)[source]

Bases: object

__init__(state=None, path=None, info=None, pid=None, socket=None, params=None)
states = <galaxy.util.bunch.Bunch object>
terminal_states = ['error', 'done']
class galaxy.model.UCI[source]

Bases: object

__init__()[source]
class galaxy.model.User(email=None, password=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(email=None, password=None)
adjust_total_disk_usage(amount)[source]
all_roles()[source]

Return a unique list of Roles associated with this user or any of their groups.

all_roles_exploiting_cache()[source]
calculate_disk_usage()[source]

Return byte count total of disk space used by all non-purged, non-library HDAs in non-purged histories.

check_password(cleartext)[source]

Check if cleartext matches user password when hashed.

dict_collection_visible_keys = ('id', 'email', 'username')
dict_element_visible_keys = ('id', 'email', 'username', 'total_disk_usage', 'nice_total_disk_usage')
static expand_user_properties(user, in_string)[source]
get_disk_usage(nice_size=False)[source]

Return byte count of disk space used by user or a human-readable string if nice_size is True.

nice_total_disk_usage

Return byte count of disk space used in a human-readable string.

set_disk_usage(bytes)[source]

Manually set the disk space used by a user to bytes.

set_password_cleartext(cleartext)[source]

Set user password to the digest of cleartext.

total_disk_usage

Return byte count of disk space used by user or a human-readable string if nice_size is True.

use_pbkdf2 = True

Data for a Galaxy user or admin and relations to their histories, credentials, and roles.

static user_template_environment(user)[source]
>>> env = User.user_template_environment(None)
>>> env['__user_email__']
'Anonymous'
>>> env['__user_id__']
'Anonymous'
>>> user = User('foo@example.com')
>>> user.id = 6
>>> user.username = 'foo2'
>>> env = User.user_template_environment(user)
>>> env['__user_id__']
'6'
>>> env['__user_name__']
'foo2'
class galaxy.model.UserAction(id=None, create_time=None, user_id=None, session_id=None, action=None, params=None, context=None)[source]

Bases: object

__init__(id=None, create_time=None, user_id=None, session_id=None, action=None, params=None, context=None)
class galaxy.model.UserAddress(user=None, desc=None, name=None, institution=None, address=None, city=None, state=None, postal_code=None, country=None, phone=None)[source]

Bases: object

__init__(user=None, desc=None, name=None, institution=None, address=None, city=None, state=None, postal_code=None, country=None, phone=None)
get_html()[source]
to_dict(trans)[source]
class galaxy.model.UserGroupAssociation(user, group)[source]

Bases: object

__init__(user, group)
class galaxy.model.UserOpenID(user=None, session=None, openid=None)[source]

Bases: object

__init__(user=None, session=None, openid=None)
class galaxy.model.UserPreference(name=None, value=None)[source]

Bases: object

__init__(name=None, value=None)
class galaxy.model.UserQuotaAssociation(user, quota)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(user, quota)
dict_element_visible_keys = ('user',)
class galaxy.model.UserRoleAssociation(user, role)[source]

Bases: object

__init__(user, role)
class galaxy.model.ValidationError(message=None, err_type=None, attributes=None)[source]

Bases: object

__init__(message=None, err_type=None, attributes=None)
class galaxy.model.Visualization(id=None, user=None, type=None, title=None, dbkey=None, slug=None, latest_revision=None)[source]

Bases: object

__init__(id=None, user=None, type=None, title=None, dbkey=None, slug=None, latest_revision=None)
copy(user=None, title=None)[source]

Provide copy of visualization with only its latest revision.

class galaxy.model.VisualizationAnnotationAssociation[source]

Bases: object

class galaxy.model.VisualizationRatingAssociation(id=None, user=None, item=None, rating=0)[source]

Bases: galaxy.model.ItemRatingAssociation

set_item(visualization)[source]
class galaxy.model.VisualizationRevision(visualization=None, title=None, dbkey=None, config=None)[source]

Bases: object

__init__(visualization=None, title=None, dbkey=None, config=None)
copy(visualization=None)[source]

Returns a copy of this object.

class galaxy.model.VisualizationTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

class galaxy.model.VisualizationUserShareAssociation[source]

Bases: object

__init__()
class galaxy.model.WorkRequestTagAssociation(id=None, user=None, workflow_request_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

__init__(id=None, user=None, workflow_request_id=None, tag_id=None, user_tname=None, value=None)[source]
class galaxy.model.Workflow(uuid=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__(uuid=None)
copy()[source]

Copy a workflow (without user information) for a new StoredWorkflow object.

dict_collection_visible_keys = ('name', 'has_cycles', 'has_errors')
dict_element_visible_keys = ('name', 'has_cycles', 'has_errors')
has_outputs_defined()[source]

Returns true or false indicating whether or not a workflow has outputs defined.

input_step_types = ['data_input', 'data_collection_input', 'parameter_input']
input_steps
log_str()[source]
step_by_index(order_index)[source]
steps_by_id
to_dict(view='collection', value_mapper=None)[source]
top_level_stored_workflow

If this workflow is not attached to stored workflow directly, recursively grab its parents until it is the top level workflow which must have a stored workflow associated with it and then grab that stored workflow.

top_level_workflow

If this workflow is not attached to stored workflow directly, recursively grab its parents until it is the top level workflow which must have a stored workflow associated with it.

workflow_outputs
class galaxy.model.WorkflowInvocation[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

__init__()
active

Indicates the workflow invocation is somehow active - and in particular valid actions may be performed on its WorkflowInvocationSteps.

add_input(content, step_id)[source]
attach_subworkflow_invocation_for_step(step, subworkflow_invocation)[source]
cancel()[source]
create_subworkflow_invocation_for_step(step)[source]
dict_collection_visible_keys = ('id', 'update_time', 'workflow_id', 'history_id', 'uuid', 'state')
dict_element_visible_keys = ('id', 'update_time', 'workflow_id', 'history_id', 'uuid', 'state')
fail()[source]
get_subworkflow_invocation_association_for_step(step)[source]
get_subworkflow_invocation_for_step(step)[source]
has_input_for_step(step_id)[source]
static poll_active_workflow_ids(sa_session, scheduler=None, handler=None)[source]
states = <galaxy.util.bunch.Bunch object>
step_invocations_by_step_id()[source]
step_invocations_for_step_id(step_id)[source]
step_states_by_step_id()[source]
to_dict(view='collection', value_mapper=None, step_details=False)[source]
update()
class galaxy.model.WorkflowInvocationStep[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

dict_collection_visible_keys = ('id', 'update_time', 'job_id', 'workflow_step_id', 'action')
dict_element_visible_keys = ('id', 'update_time', 'job_id', 'workflow_step_id', 'action')
to_dict(view='collection', value_mapper=None)[source]
update()[source]
class galaxy.model.WorkflowInvocationToSubworkflowInvocationAssociation[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

dict_collection_visible_keys = ('id', 'workflow_step_id', 'workflow_invocation_id', 'subworkflow_invocation_id')
dict_element_visible_keys = ('id', 'workflow_step_id', 'workflow_invocation_id', 'subworkflow_invocation_id')
class galaxy.model.WorkflowOutput(workflow_step, output_name=None, label=None, uuid=None)[source]

Bases: object

__init__(workflow_step, output_name=None, label=None, uuid=None)
copy(copied_step)[source]
class galaxy.model.WorkflowRequest[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

dict_collection_visible_keys = ['id', 'name', 'type', 'state', 'history_id', 'workflow_id']
dict_element_visible_keys = ['id', 'name', 'type', 'state', 'history_id', 'workflow_id']
to_dict(view='collection', value_mapper=None)[source]
class galaxy.model.WorkflowRequestInputParameter(name=None, value=None, type=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

Workflow-related parameters not tied to steps or inputs.

__init__(name=None, value=None, type=None)
dict_collection_visible_keys = ['id', 'name', 'value', 'type']
types = <galaxy.util.bunch.Bunch object>
class galaxy.model.WorkflowRequestInputStepParmeter[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

Workflow step parameter inputs.

dict_collection_visible_keys = ['id', 'workflow_invocation_id', 'workflow_step_id', 'parameter_value']
class galaxy.model.WorkflowRequestStepState(workflow_step=None, name=None, value=None)[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

Workflow step value parameters.

__init__(workflow_step=None, name=None, value=None)
dict_collection_visible_keys = ['id', 'name', 'value', 'workflow_step_id']
class galaxy.model.WorkflowRequestToInputDatasetAssociation[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

Workflow step input dataset parameters.

dict_collection_visible_keys = ['id', 'workflow_invocation_id', 'workflow_step_id', 'dataset_id', 'name']
class galaxy.model.WorkflowRequestToInputDatasetCollectionAssociation[source]

Bases: object, galaxy.util.dictifiable.Dictifiable

Workflow step input dataset collection parameters.

dict_collection_visible_keys = ['id', 'workflow_invocation_id', 'workflow_step_id', 'dataset_collection_id', 'name']
class galaxy.model.WorkflowStep[source]

Bases: object

__init__()
content_id
copy_to(copied_step, step_mapping)[source]
create_or_update_workflow_output(output_name, label, uuid)[source]
input_connections_by_name
log_str()[source]
setup_input_connections_by_name()[source]
unique_workflow_outputs
workflow_output_for(output_name)[source]
class galaxy.model.WorkflowStepAnnotationAssociation[source]

Bases: object

class galaxy.model.WorkflowStepConnection[source]

Bases: object

NON_DATA_CONNECTION = '__NO_INPUT_OUTPUT_NAME__'
__init__()
copy()[source]
non_data_connection
set_non_data_connection()[source]
class galaxy.model.WorkflowStepTagAssociation(id=None, user=None, item_id=None, tag_id=None, user_tname=None, value=None)[source]

Bases: galaxy.model.ItemTagAssociation

galaxy.model.copy_list(lst, *args, **kwds)[source]
galaxy.model.is_hda(d)[source]
galaxy.model.set_datatypes_registry(d_registry)[source]

Set up datatypes_registry

Submodules

galaxy.model.base module

Shared model and mapping code between Galaxy and Tool Shed, trying to generalize to generic database connections.

class galaxy.model.base.ModelMapping(model_modules, engine)[source]

Bases: galaxy.util.bunch.Bunch

Session

For backward compat., deprecated.

__init__(model_modules, engine)[source]

galaxy.model.custom_types module

class galaxy.model.custom_types.JSONType(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

Represents an immutable structure as a json-encoded string.

If default is, for example, a dict, then a NULL value in the database will be exposed as an empty dict.

compare_values(x, y)[source]
copy_value(value)[source]
impl

alias of LargeBinary

load_dialect_impl(dialect)[source]
process_bind_param(value, dialect)[source]
process_result_value(value, dialect)[source]
class galaxy.model.custom_types.MetadataType(*args, **kwargs)[source]

Bases: galaxy.model.custom_types.JSONType

Backward compatible metadata type. Can read pickles or JSON, but always writes in JSON.

process_bind_param(value, dialect)[source]
process_result_value(value, dialect)[source]
class galaxy.model.custom_types.MutationDict[source]

Bases: galaxy.model.custom_types.MutationObj, dict

classmethod coerce(key, value)[source]

Convert plain dictionary to MutationDict

class galaxy.model.custom_types.MutationList[source]

Bases: galaxy.model.custom_types.MutationObj, list

append(value)[source]
classmethod coerce(key, value)[source]

Convert plain list to MutationList

extend(values)[source]
insert(idx, value)[source]
pop(*args, **kw)[source]
remove(value)[source]
class galaxy.model.custom_types.MutationObj[source]

Bases: sqlalchemy.ext.mutable.Mutable

Mutable JSONType for SQLAlchemy from original gist: https://gist.github.com/dbarnett/1730610

Using minor changes from this fork of the gist: https://gist.github.com/miracle2k/52a031cced285ba9b8cd

And other minor changes to make it work for us.

classmethod coerce(key, value)[source]
class galaxy.model.custom_types.TrimmedString(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

impl

alias of String

process_bind_param(value, dialect)[source]

Automatically truncate string values

class galaxy.model.custom_types.UUIDType(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

Platform-independent UUID type.

Based on http://docs.sqlalchemy.org/en/rel_0_8/core/types.html#backend-agnostic-guid-type Changed to remove sqlalchemy 0.8 specific code

CHAR(32), storing as stringified hex values.

impl

alias of CHAR

load_dialect_impl(dialect)[source]
process_bind_param(value, dialect)[source]
process_result_value(value, dialect)[source]
galaxy.model.custom_types.total_size(o, handlers={}, verbose=False)[source]

Returns the approximate memory footprint an object and all of its contents.

Automatically finds the contents of the following builtin containers and their subclasses: tuple, list, deque, dict, set and frozenset. To search other containers, add handlers to iterate over their contents:

handlers = {SomeContainerClass: iter,
OtherContainerClass: OtherContainerClass.get_elements}

Recipe from: https://code.activestate.com/recipes/577504-compute-memory-footprint-of-an-object-and-its-cont/

galaxy.model.item_attrs module

class galaxy.model.item_attrs.UsesAnnotations[source]

Mixin for getting and setting item annotations.

add_item_annotation(db_session, user, item, annotation)[source]

Add or update an item’s annotation; a user can only have a single annotation for an item.

copy_item_annotation(db_session, source_user, source_item, target_user, target_item)[source]

Copy an annotation from a user/item source to a user/item target.

delete_item_annotation(db_session, user, item)[source]
get_item_annotation_obj(db_session, user, item)[source]

Returns a user’s annotation object for an item.

get_item_annotation_str(db_session, user, item)[source]

Returns a user’s annotation string for an item.

class galaxy.model.item_attrs.UsesItemRatings[source]

Mixin for getting and setting item ratings.

Class makes two assumptions: (1) item-rating association table is named <item_class>RatingAssocation (2) item-rating association table has a column with a foreign key referencing item table that contains the item’s id.

get_ave_item_rating_data(db_session, item, webapp_model=None)[source]

Returns the average rating for an item.

get_user_item_rating(db_session, user, item, webapp_model=None)[source]

Returns user’s rating for an item. Return type is <item_class>RatingAssociation.

rate_item(db_session, user, item, rating, webapp_model=None)[source]

Rate an item. Return type is <item_class>RatingAssociation.

exception galaxy.model.item_attrs.RuntimeException[source]

Bases: exceptions.Exception

galaxy.model.mapping module

Details of how the data model objects are mapped onto the relational database are encapsulated here.

galaxy.model.mapping.annotation_mapping(annotation_class, **kwds)[source]
galaxy.model.mapping.db_next_hid(self)[source]

Override __next_hid to generate from the database in a concurrency safe way. Loads the next history ID from the DB and returns it. It also saves the future next_id into the DB.

Return type:int
Returns:the next history id
galaxy.model.mapping.init(file_path, url, engine_options={}, create_tables=False, map_install_models=False, database_query_profiling_proxy=False, object_store=None, trace_logger=None, use_pbkdf2=True, slow_query_log_threshold=0)[source]

Connect mappings to the database

galaxy.model.mapping.now()

Return a new datetime representing UTC day and time.

galaxy.model.mapping.rating_mapping(rating_class, **kwds)[source]
galaxy.model.mapping.simple_mapping(model, **kwds)[source]
galaxy.model.mapping.tag_mapping(tag_association_class, backref_name)[source]

galaxy.model.search module

The GQL (Galaxy Query Language) search engine parsers a simple ‘SQL-Like’ query syntax to obtain items from the Galaxy installations. Rather then allow/force the user to do queries on the Galaxy schema, it uses a small set of ‘Views’ which are simple table representations of complex galaxy ideas. So while a history and its tags may exist in seperate tables in the real schema, in GQL they exist in the same view

Example Queries:

select name, id, file_size from hda

select name from hda

select name, model_class from ldda

select * from history

select * from workflow

select id, name from history where name=’Unnamed history’

select * from history where name=’Unnamed history’

exception galaxy.model.search.GalaxyParseError[source]

Bases: exceptions.Exception

class galaxy.model.search.GalaxyQuery(field_list, table_name, conditional)[source]

Bases: object

This class represents a data structure of a compiled GQL query

__init__(field_list, table_name, conditional)[source]
class galaxy.model.search.GalaxyQueryAnd(left, right)[source]

Bases: object

This class represents the data structure of the comparison arguments of a compiled GQL query (ie where name=’Untitled History’)

__init__(left, right)[source]
class galaxy.model.search.GalaxyQueryComparison(left, operator, right)[source]

Bases: object

This class represents the data structure of the comparison arguments of a compiled GQL query (ie where name=’Untitled History’)

__init__(left, operator, right)[source]
class galaxy.model.search.GalaxySearchEngine[source]

Bases: object

Primary class for searching. Parses GQL (Galaxy Query Language) queries and returns a ‘SearchQuery’ class

__init__()[source]
query(query_text)[source]
class galaxy.model.search.HistoryDatasetView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

DOMAIN = 'history_dataset'
FIELDS = {'tag': <galaxy.model.search.ViewField object>, 'extended_metadata': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'deleted': <galaxy.model.search.ViewField object>, 'history_id': <galaxy.model.search.ViewField object>, 'copied_from_hda_id': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>, 'copied_from_ldda_id': <galaxy.model.search.ViewField object>}
search(trans)[source]
class galaxy.model.search.HistoryView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

DOMAIN = 'history'
FIELDS = {'deleted': <galaxy.model.search.ViewField object>, 'annotation': <galaxy.model.search.ViewField object>, 'tag': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
search(trans)[source]
class galaxy.model.search.JobView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

DOMAIN = 'job'
FIELDS = {'output_hda': <galaxy.model.search.ViewField object>, 'input_ldda': <galaxy.model.search.ViewField object>, 'param': <galaxy.model.search.ViewField object>, 'state': <galaxy.model.search.ViewField object>, 'input_hda': <galaxy.model.search.ViewField object>, 'tool_name': <galaxy.model.search.ViewField object>}
search(trans)[source]
class galaxy.model.search.LibraryDatasetDatasetView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

FIELDS = {'parent_library_id': <galaxy.model.search.ViewField object>, 'extended_metadata': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'data_type': <galaxy.model.search.ViewField object>, 'deleted': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
VIEW_NAME = 'library_dataset_dataset'
search(trans)[source]
class galaxy.model.search.LibraryDatasetView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

FIELDS = {'folder_id': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
VIEW_NAME = 'library_dataset'
search(trans)[source]
class galaxy.model.search.LibraryFolderView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

FIELDS = {'parent_id': <galaxy.model.search.ViewField object>, 'library_path': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'parent_library_id': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
VIEW_NAME = 'library_folder'
search(trans)[source]
class galaxy.model.search.LibraryView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

FIELDS = {'deleted': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
VIEW_NAME = 'library'
search(trans)[source]
class galaxy.model.search.PageRevisionView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

DOMAIN = 'page_revision'
FIELDS = {'page_id': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>, 'title': <galaxy.model.search.ViewField object>}
search(trans)[source]
class galaxy.model.search.PageView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

DOMAIN = 'page'
FIELDS = {'deleted': <galaxy.model.search.ViewField object>, 'title': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>, 'slug': <galaxy.model.search.ViewField object>}
search(trans)[source]
class galaxy.model.search.SearchQuery(view, query)[source]

Bases: object

__init__(view, query)[source]
decode_query_ids(trans)[source]
item_to_api_value(item)[source]
process(trans)[source]
class galaxy.model.search.ToolView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

FIELDS = {'tool_id': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
VIEW_NAME = 'tool'
search(trans)[source]
class galaxy.model.search.ViewField(name, sqlalchemy_field=None, handler=None, post_filter=None, id_decode=False)[source]

Bases: object

A ViewField defines a field in a view that filter operations can be applied to These filter operations are either handled with standard sqlalchemy filter calls, or passed to specialized handlers (such as when a table join would be needed to do the filtering)

Parameters:

sqlalchemy_field - Simple filtering using existing table columns, the argument is an sqlalchemy column
that the right hand value will be compared against
handler - Requires more specialized code to do filtering, usually requires a table join in order to
process the conditional
post_filter - Unable to do simple sqlalchemy based table filtering, filter is applied to loaded object
Thus methods avalible to the object can be used for filtering. example: a library folder must climb its chain of parents to find out which library it belongs to
__init__(name, sqlalchemy_field=None, handler=None, post_filter=None, id_decode=False)[source]
class galaxy.model.search.ViewQueryBaseClass[source]

Bases: object

FIELDS = {}
VIEW_NAME = 'undefined'
__init__()[source]
decode_query_ids(trans, conditional)[source]
filter(left, operator, right)[source]
get_results(force_query=False)[source]
search(trans)[source]
class galaxy.model.search.WorkflowView[source]

Bases: galaxy.model.search.ViewQueryBaseClass

DOMAIN = 'workflow'
FIELDS = {'deleted': <galaxy.model.search.ViewField object>, 'tag': <galaxy.model.search.ViewField object>, 'name': <galaxy.model.search.ViewField object>, 'id': <galaxy.model.search.ViewField object>}
search(trans)[source]
galaxy.model.search.history_dataset_extended_metadata_filter(view, left, operator, right)[source]
galaxy.model.search.history_dataset_handle_tag(view, left, operator, right)[source]
galaxy.model.search.history_handle_annotation(view, left, operator, right)[source]
galaxy.model.search.history_handle_tag(view, left, operator, right)[source]
galaxy.model.search.job_input_hda_filter(view, left, operator, right)[source]
galaxy.model.search.job_input_ldda_filter(view, left, operator, right)[source]
galaxy.model.search.job_output_hda_filter(view, left, operator, right)[source]
galaxy.model.search.job_param_filter(view, left, operator, right)[source]
galaxy.model.search.ldda_parent_library_filter(item, left, operator, right)[source]
galaxy.model.search.library_dataset_name_filter(item, left, operator, right)[source]
galaxy.model.search.library_extended_metadata_filter(view, left, operator, right)[source]
galaxy.model.search.library_folder_parent_library_id_filter(item, left, operator, right)[source]
galaxy.model.search.library_path_filter(item, left, operator, right)[source]
galaxy.model.search.workflow_tag_handler(view, left, operator, right)[source]

galaxy.model.util module

Utility helpers related to the model

galaxy.model.util.pgcalc(sa_session, id, dryrun=False)[source]

Utility method for quickly recalculating user disk usage in postgres.

TODO: Check against the recently updated versions of sqlalchemy if this ‘special’ postgresql version is even necessary.