Galaxy Code Documentation

Galaxy is an open, web-based platform for accessible, reproducible, and transparent computational biomedical research.

  • Accessible: Users without programming experience can easily specify parameters and run tools and workflows.
  • Reproducible: Galaxy captures information so that any user can repeat and understand a complete computational analysis.
  • Transparent: Users share and publish analyses via the web and create Pages, interactive, web-based documents that describe a complete analysis.

Two copies of the Galaxy code doumentation are published by the Galaxy Project

Both copies are hosted at ReadTheDocs, a publicly supported web site for hosting project documentation.

If you have your own copy of the Galaxy source code, you can also generate your own version of this documentation:

$ cd doc
$ make html

The generated documentation will be in doc/build/html/ and can be viewed with a web browser. Note that you will need to install Sphinx and a fair number of module dependencies before this will produce output.

For more on the Galaxy Project, please visit the project home page.

Contents

Galaxy API Documentation

Background

In addition to being accessible through a web interface, Galaxy can also be accessed programmatically, through shell scripts and other programs. The web interface is appropriate for things like exploratory analysis, visualization, construction of workflows, and rerunning workflows on new datasets.

The web interface is less suitable for things like
  • Connecting a Galaxy instance directly to your sequencer and running workflows whenever data is ready.
  • Running a workflow against multiple datasets (which can be done with the web interface, but is tedious).
  • When the analysis involves complex control, such as looping and branching.

The Galaxy API addresses these and other situations by exposing Galaxy internals through an additional interface, known as an Application Programming Interface, or API.

Quickstart

Log in as your user, navigate to the API Keys page in the User menu, and generate a new API key. Make a note of the API key, and then pull up a terminal. Now we’ll use the display.py script in your galaxy/scripts/api directory for a short example:

% ./display.py my_key http://localhost:4096/api/histories
Collection Members
------------------
#1: /api/histories/8c49be448cfe29bc
  name: Unnamed history
  id: 8c49be448cfe29bc
#2: /api/histories/33b43b4e7093c91f
  name: output test
  id: 33b43b4e7093c91f

The result is a Collection of the histories of the user specified by the API key (you). To look at the details of a particular history, say #1 above, do the following:

% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc
Member Information
------------------
state_details: {'ok': 1, 'failed_metadata': 0, 'upload': 0, 'discarded': 0, 'running': 0, 'setting_metadata': 0, 'error': 0, 'new': 0, 'queued': 0, 'empty': 0}
state: ok
contents_url: /api/histories/8c49be448cfe29bc/contents
id: 8c49be448cfe29bc
name: Unnamed history

This gives detailed information about the specific member in question, in this case the History. To view history contents, do the following:

% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc/contents
Collection Members
------------------
#1: /api/histories/8c49be448cfe29bc/contents/6f91353f3eb0fa4a
  name: Pasted Entry
  type: file
  id: 6f91353f3eb0fa4a

What we have here is another Collection of items containing all of the datasets in this particular history. Finally, to view details of a particular dataset in this collection, execute the following:

% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc/contents/6f91353f3eb0fa4a
Member Information
------------------
misc_blurb: 1 line
name: Pasted Entry
data_type: txt
deleted: False
file_name: /Users/yoplait/work/galaxy-stock/database/files/000/dataset_82.dat
state: ok
download_url: /datasets/6f91353f3eb0fa4a/display?to_ext=txt
visible: True
genome_build: ?
model_class: HistoryDatasetAssociation
file_size: 17
metadata_data_lines: 1
id: 6f91353f3eb0fa4a
misc_info: uploaded txt file
metadata_dbkey: ?

And now you’ve successfully used the API to request and select a history, browse the contents of that history, and then look at detailed information about a particular dataset.

For a more comprehensive Data Library example, set the following option in your galaxy.ini as well, and restart galaxy again:

admin_users = you@example.org
library_import_dir = /path/to/some/directory

In the directory you specified for ‘library_import_dir’, create some subdirectories, and put (or symlink) files to import into Galaxy into those subdirectories.

In Galaxy, create an account that matches the address you put in ‘admin_users’, then browse to that user’s preferences and generate a new API Key. Copy the key to your clipboard and then use these scripts:

% ./display.py my_key http://localhost:4096/api/libraries
Collection Members
------------------

0 elements in collection

% ./library_create_library.py my_key http://localhost:4096/api/libraries api_test 'API Test Library'
Response
--------
/api/libraries/f3f73e481f432006
  name: api_test
  id: f3f73e481f432006

% ./display.py my_key http://localhost:4096/api/libraries
Collection Members
------------------
/api/libraries/f3f73e481f432006
  name: api_test
  id: f3f73e481f432006

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006
Member Information
------------------
synopsis: None
contents_url: /api/libraries/f3f73e481f432006/contents
description: API Test Library
name: api_test

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
Collection Members
------------------
/api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670
  name: /
  type: folder
  id: 28202595c0d2591f61ddda595d2c3670

% ./library_create_folder.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591f61ddda595d2c3670 api_test_folder1 'API Test Folder 1'
Response
--------
/api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89
  name: api_test_folder1
  id: 28202595c0d2591fa4f9089d2303fd89

% ./library_upload_from_import_dir.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591fa4f9089d2303fd89 bed bed hg19
Response
--------
/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
  name: 2.bed
  id: e9ef7fdb2db87d7b
/api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018
  name: 3.bed
  id: 3b7f6a31f80a5018

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
Collection Members
------------------
/api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670
  name: /
  type: folder
  id: 28202595c0d2591f61ddda595d2c3670
/api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89
  name: /api_test_folder1
  type: folder
  id: 28202595c0d2591fa4f9089d2303fd89
/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
  name: /api_test_folder1/2.bed
  type: file
  id: e9ef7fdb2db87d7b
/api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018
  name: /api_test_folder1/3.bed
  type: file
  id: 3b7f6a31f80a5018

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
Member Information
------------------
misc_blurb: 68 regions
metadata_endCol: 3
data_type: bed
metadata_columns: 6
metadata_nameCol: 4
uploaded_by: nate@...
metadata_strandCol: 6
name: 2.bed
genome_build: hg19
metadata_comment_lines: None
metadata_startCol: 2
metadata_chromCol: 1
file_size: 4272
metadata_data_lines: 68
message:
metadata_dbkey: hg19
misc_info: uploaded bed file
date_uploaded: 2010-06-22T17:01:51.266119
metadata_column_types: str, int, int, str, int, str

Other parameters are valid when uploading, they are the same parameters as are used in the web form, like ‘link_data_only’ and etc.

The request and response format should be considered alpha and are subject to change.

API Design Guidelines

The following section outlines guidelines related to extending and/or modifing the Galaxy API. The Galaxy API has grown in an ad-hoc fashion over time by many contributors and so clients SHOULD NOT expect the API will conform to these guidelines - but developers contributing to the Galaxy API SHOULD follow these guidelines.

  • API functionality should include docstring documentation for consumption by readthedocs.org.

  • Developers should familiarize themselves with the HTTP status code definitions http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. The API responses should properly set the status code according to the result - in particular 2XX responses should be used for successful requests, 4XX for various kinds of client errors, and 5XX for the errors on the server side.

  • If there is an error processing some part of request (one item in a list for instance), the status code should be set to reflect the error and the partial result may or may not be returned depending on the controller - this behavior should be documented.

  • API methods should throw a finite number of exceptions (defined in exceptions Package) and these should subclass MessageException and not paste/wsgi HTTP exceptions. When possible, the framework itself should be responsible catching these exceptions, setting the status code, and building an error response.

  • Error responses should not consist of plain text strings - they should be dictionaries describing the error and containing the following:

    {
      "status_code": 400,
      "err_code": 400007,
      "err_msg": "Request contained invalid parameter, action could not be completed.",
      "type": "error",
      "extra_error_info": "Extra information."
    }
    

    Various error conditions (once a format has been chosen and framework to enforce it in place) should be spelled out in this document.

  • Backward compatibility is important and should be maintained when possible. If changing behavior in a non-backward compatibile way please ensure one of the following holds - there is a strong reason to believe no consumers depend on a behavior, the behavior is effectively broken, or the API method being modified has not been part of a tagged dist release.

The following bullet points represent good practices more than guidelines, please consider them when modifying the API.

  • Functionality should not be copied and pasted between controllers - consider refactoring functionality into associated classes or short of that into Mixins (http://en.wikipedia.org/wiki/Composition_over_inheritance) or into Managers (managers Package).
  • API additions are more permanent changes to Galaxy than many other potential changes and so a second opinion on API changes should be sought. (Consider a pull request!)
  • New API functionality should include functional tests. These functional tests should be implemented in Python and placed in test/functional/api. (Once such a framework is in place - it is not right now).
  • Changes to reflect modifications to the API should be pushed upstream to the BioBlend project if possible.

Longer term goals/notes.

  • It would be advantageous to have a clearer separation of anonymous and admin handling functionality.
  • If at some point in the future, functionality needs to be added that breaks backward compatibility in a significant way to a component used by the community - a “dev” variant of the API will be established and the community should be alerted and given a timeframe for when the old behavior will be replaced with the new behavior.
  • Consistent standards for range-based requests, batch requests, filtered requests, etc... should be established and documented here.

API Controllers

Galaxy offers the following API controllers:

annotations Module

API operations on annotations.

class galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesAnnotations

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
undelete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.annotations.HistoryAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'history_annotations'
tagged_item_id = 'history_id'
class galaxy.webapps.galaxy.api.annotations.HistoryContentAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'history_content_annotations'
tagged_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.annotations.WorkflowAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'workflow_annotations'
tagged_item_id = 'workflow_id'
authenticate Module

API key retrieval through BaseAuth Sample usage:

curl –user zipzap@foo.com:password http://localhost:8080/api/authenticate/baseauth

Returns:

{
“api_key”: “baa4d6e3a156d3033f05736255f195f9”

}

class galaxy.webapps.galaxy.api.authenticate.AuthenticationController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

get_api_key(trans, *args, **kwargs)[source]

def get_api_key( self, trans, **kwd ) * GET /api/authenticate/baseauth

returns an API key for authenticated user based on BaseAuth headers
Returns:api_key in json format
Return type:dict
Raises:ObjectNotFound, HTTPBadRequest
configuration Module

API operations allowing clients to determine Galaxy instance’s capabilities and configuration settings.

class galaxy.webapps.galaxy.api.configuration.ConfigurationController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

dynamic_tool_confs(trans, *args, **kwargs)[source]
get_config_dict(trans, return_admin=False, view=None, keys=None, default_view='all')[source]

Return a dictionary with (a subset of) current Galaxy settings.

If return_admin also include a subset of more sensitive keys. Pass in view (String) and comma seperated list of keys to control which configuration settings are returned.

index(trans, *args, **kwargs)[source]

GET /api/configuration Return an object containing exposable configuration settings.

Note: a more complete list is returned if the user is an admin.

tool_lineages(trans, *args, **kwargs)[source]
version(trans, *args, **kwargs)[source]

GET /api/version Return a description of the major version of Galaxy (e.g. 15.03).

Return type:dict
Returns:dictionary with major version keyed on ‘version_major’
dataset_collections Module
class galaxy.webapps.galaxy.api.dataset_collections.DatasetCollectionsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixinItems

create(trans, *args, **kwargs)[source]
  • POST /api/dataset_collections:

    create a new dataset collection instance.

Parameters:payload (dict) – (optional) dictionary structure containing: * collection_type: dataset colltion type to create. * instance_type: Instance type - ‘history’ or ‘library’. * name: the new dataset collections’s name * datasets: object describing datasets for collection
Return type:dict
Returns:element view of new dataset collection
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
datasets Module
datatypes Module

API operations allowing clients to determine datatype supported by Galaxy.

class galaxy.webapps.galaxy.api.datatypes.DatatypesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

converters(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]

GET /api/datatypes Return an object containing upload datatypes.

mapping(trans, *args, **kwargs)[source]

GET /api/datatypes/mapping Return a dictionary of class to class mappings.

sniffers(trans, *args, **kwargs)[source]

GET /api/datatypes/sniffers Return a list of sniffers.

extended_metadata Module

API operations on annotations.

class galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesExtendedMetadataMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesStoredWorkflowMixin

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
undelete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.extended_metadata.HistoryDatasetExtendMetadataController(app)[source]

Bases: galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController

controller_name = 'history_dataset_extended_metadata'
exmeta_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.extended_metadata.LibraryDatasetExtendMetadataController(app)[source]

Bases: galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController

controller_name = 'library_dataset_extended_metadata'
exmeta_item_id = 'library_content_id'
folder_contents Module

API operations on the contents of a library folder.

class galaxy.webapps.galaxy.api.folder_contents.FolderContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

Class controls retrieval, creation and updating of folder contents.

build_path(trans, folder)[source]

Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.

Parameters:
  • folder – current folder for navigating up
  • type – Galaxy LibraryFolder
Returns:

list consisting of full path to the library

Type:

list

create(self, trans, library_id, payload, **kwd)[source]
  • POST /api/folders/{encoded_id}/contents

    create a new library file from an HDA

Parameters:payload – dictionary structure containing:
Returns:a dictionary containing the id, name, and ‘show’ url of the new item
Return type:dict
Raises:ObjectAttributeInvalidException, InsufficientPermissionsException, ItemAccessibilityException, InternalServerError
index(trans, *args, **kwargs)[source]

GET /api/folders/{encoded_folder_id}/contents

Displays a collection (list) of a folder’s contents (files and folders). Encoded folder ID is prepended with ‘F’ if it is a folder as opposed to a data set which does not have it. Full path is provided in response as a separate object providing data for breadcrumb path building.

Parameters:
  • folder_id (encoded string) – encoded ID of the folder which contents should be library_dataset_dict
  • kwd (dict) – keyword dictionary with other params
Returns:

dictionary containing all items and metadata

Type:

dict

Raises:

MalformedId, InconsistentDatabase, ObjectNotFound, InternalServerError

show(trans, *args, **kwargs)[source]

GET /api/folders/{encoded_folder_id}/

update(trans, *args, **kwargs)[source]

PUT /api/folders/{encoded_folder_id}/contents

folders Module

API operations on library folders.

class galaxy.webapps.galaxy.api.folders.FoldersController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

create(self, trans, encoded_parent_folder_id, **kwd)[source]

*POST /api/folders/{encoded_parent_folder_id}

Create a new folder object underneath the one specified in the parameters.

Parameters:
  • encoded_parent_folder_id (an encoded id string (should be prefixed by ‘F’)) – the parent folder’s id (required)
  • name (str) – the name of the new folder (required)
  • description (str) – the description of the new folder
Returns:

information about newly created folder, notably including ID

Return type:

dictionary

Raises:

RequestParameterMissingException

delete(self, trans, id, **kwd)[source]
  • DELETE /api/folders/{id}

    marks the folder with the given id as deleted (or removes the deleted mark if the undelete param is true)

Note

Currently, only admin users can un/delete folders.

Parameters:
  • id (an encoded id string) – the encoded id of the folder to un/delete
  • undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
Returns:

detailed folder information

Return type:

dictionary

Raises:

ItemAccessibilityException, MalformedId, ObjectNotFound

get_permissions(trans, *args, **kwargs)[source]
  • GET /api/folders/{id}/permissions

Load all permissions for the given folder id and return it.

Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder
  • scope (string) – either ‘current’ or ‘available’
Returns:

dictionary with all applicable permissions’ values

Return type:

dictionary

Raises:

ObjectNotFound, InsufficientPermissionsException

index(trans, *args, **kwargs)[source]

*GET /api/folders/ This would normally display a list of folders. However, that would be across multiple libraries, so it’s not implemented.

set_permissions(trans, *args, **kwargs)[source]
def set_permissions( self, trans, encoded_folder_id, **kwd ):
*POST /api/folders/{encoded_folder_id}/permissions
Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to set the permissions of
  • action (string) – (required) describes what action should be performed available actions: set_permissions
  • add_ids[] (string or list) – list of Role.id defining roles that should have add item permission on the folder
  • manage_ids[] (string or list) – list of Role.id defining roles that should have manage permission on the folder
  • modify_ids[] (string or list) – list of Role.id defining roles that should have modify permission on the folder
Return type:

dictionary

Returns:

dict of current roles for all available permission types.

Raises:

RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

show(self, trans, id, **kwd)[source]

*GET /api/folders/{encoded_folder_id}

Displays information about a folder.

Parameters:id (an encoded id string (has to be prefixed by ‘F’)) – the folder’s encoded id (required)
Returns:dictionary including details of the folder
Return type:dict
update(trans, *args, **kwargs)[source]

PUT /api/folders/{encoded_folder_id}

forms Module

API operations on FormDefinition objects.

class galaxy.webapps.galaxy.api.forms.FormDefinitionAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/forms Creates a new form.

index(trans, *args, **kwargs)[source]

GET /api/forms Displays a collection (list) of forms.

show(trans, *args, **kwargs)[source]

GET /api/forms/{encoded_form_id} Displays information about a form.

ftp_files Module
genomes Module
class galaxy.webapps.galaxy.api.genomes.GenomesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with genome data.

index(trans, *args, **kwargs)[source]

GET /api/genomes: returns a list of installed genomes

show(trans, *args, **kwargs)[source]

GET /api/genomes/{id}

Returns information about build <id>

galaxy.webapps.galaxy.api.genomes.get_id(base, format)[source]
group_roles Module

API operations on Group objects.

class galaxy.webapps.galaxy.api.group_roles.GroupRolesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

delete(trans, *args, **kwargs)[source]

DELETE /api/groups/{encoded_group_id}/roles/{encoded_role_id} Removes a role from a group

index(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/roles Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/roles/{encoded_role_id} Displays information about a group role.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id}/roles/{encoded_role_id} Adds a role to a group

group_users Module

API operations on Group objects.

class galaxy.webapps.galaxy.api.group_users.GroupUsersAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

delete(trans, *args, **kwargs)[source]

DELETE /api/groups/{encoded_group_id}/users/{encoded_user_id} Removes a user from a group

index(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/users Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/users/{encoded_user_id} Displays information about a group user.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id}/users/{encoded_user_id} Adds a user to a group

groups Module

API operations on Group objects.

class galaxy.webapps.galaxy.api.groups.GroupAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/groups Creates a new group.

index(trans, *args, **kwargs)[source]

GET /api/groups Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id} Displays information about a group.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id} Modifies a group.

histories Module

API operations on a history.

class galaxy.webapps.galaxy.api.histories.HistoriesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.ExportsHistoryMixin, galaxy.web.base.controller.ImportsHistoryMixin

archive_download(trans, *args, **kwargs)[source]

export_download( self, trans, id, jeha_id ) * GET /api/histories/{id}/exports/{jeha_id}:

If ready and available, return raw contents of exported history. Use/poll “PUT /api/histories/{id}/exports” to initiate the creation of such an export - when ready that route will return 200 status code (instead of 202) with a JSON dictionary containing a download_url.
archive_export(trans, *args, **kwargs)[source]

export_archive( self, trans, id, payload ) * PUT /api/histories/{id}/exports:

start job (if needed) to create history export for corresponding history.
Parameters:id (str) – the encoded id of the history to export
Return type:dict
Returns:object containing url to fetch export from.
citations(trans, *args, **kwargs)[source]
create(trans, payload)[source]
  • POST /api/histories:

    create a new history

Parameters:
  • payload (dict) – (optional) dictionary structure containing: * name: the new history’s name * history_id: the id of the history to copy * archive_source: the url that will generate the archive to import * archive_type: ‘url’ (default)
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

element view of new history

delete(self, trans, id, **kwd)[source]
  • DELETE /api/histories/{id}

    delete the history with the given id

Note

Stops all active jobs in the history if purge is set.

Parameters:
  • id (str) – the encoded id of the history to delete
  • kwd (dict) – (optional) dictionary structure containing extra parameters

You can purge a history, removing all it’s datasets from disk (if unshared), by passing in purge=True in the url.

Parameters:
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

the deleted or purged history

index(trans, deleted='False')[source]
  • GET /api/histories:

    return undeleted histories for the current user

  • GET /api/histories/deleted:

    return deleted histories for the current user

Note

Anonymous users are allowed to get their current history

Parameters:deleted (boolean) – if True, show only deleted histories, if False, non-deleted
Return type:list
Returns:list of dictionaries containing summary history information
The following are optional parameters:
view: string, one of (‘summary’,’detailed’), defaults to ‘summary’
controls which set of properties to return
keys: comma separated strings, unused by default
keys/names of individual properties to return

If neither keys or views are sent, the default view (set of keys) is returned. If both a view and keys are sent, the key list and the view’s keys are combined. If keys are send and no view, only those properties in keys are returned.

For which properties are available see:
galaxy/managers/histories/HistorySerializer
The list returned can be filtered by using two optional parameters:
q: string, generally a property name to filter by followed
by an (often optional) hyphen and operator string.

qv: string, the value to filter by

..example:

To filter the list to only those created after 2015-01-29, the query string would look like:

‘?q=create_time-gt&qv=2015-01-29’
Multiple filters can be sent in using multiple q/qv pairs:
‘?q=create_time-gt&qv=2015-01-29&q=tag-has&qv=experiment-1’
The list returned can be paginated using two optional parameters:
limit: integer, defaults to no value and no limit (return all)
how many items to return
offset: integer, defaults to 0 and starts at the beginning
skip the first ( offset - 1 ) items and begin returning at the Nth item
..example:
limit and offset can be combined. Skip the first two and return five:
‘?limit=5&offset=3’
show(trans, id, deleted='False')[source]
  • GET /api/histories/{id}:

    return the history with id

  • GET /api/histories/deleted/{id}:

    return the deleted history with id

  • GET /api/histories/most_recently_used:

    return the most recently used history

Parameters:
  • id (an encoded id string) – the encoded id of the history to query or the string ‘most_recently_used’
  • deleted (boolean) – if True, allow information on a deleted history to be shown.
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dictionary

Returns:

detailed history information

undelete(self, trans, id, **kwd)[source]
  • POST /api/histories/deleted/{id}/undelete:

    undelete history (that hasn’t been purged) with the given id

Parameters:
  • id (str) – the encoded id of the history to undelete
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

str

Returns:

‘OK’ if the history was undeleted

update(self, trans, id, payload, **kwd)[source]
  • PUT /api/histories/{id}

    updates the values for the history with the given id

Parameters:
  • id (str) – the encoded id of the history to update
  • payload (dict) –

    a dictionary containing any or all the fields in galaxy.model.History.to_dict() and/or the following:

    • annotation: an annotation for the history
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated

history_contents Module

API operations on the contents of a history.

class galaxy.webapps.galaxy.api.history_contents.HistoryContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesTagsMixin

create(self, trans, history_id, payload, **kwd)[source]
  • POST /api/histories/{history_id}/contents/{type}

    create a new HDA by copying an accessible LibraryDataset

Parameters:
  • history_id (str) – encoded id string of the new HDA’s History
  • type (str) – Type of history content - ‘dataset’ (default) or ‘dataset_collection’.
  • payload (dict) –

    dictionary structure containing:: copy from library (for type ‘dataset’): ‘source’ = ‘library’ ‘content’ = [the encoded id from the library dataset]

    copy from history dataset (for type ‘dataset’): ‘source’ = ‘hda’ ‘content’ = [the encoded id from the HDA]

    copy from history dataset collection (for type ‘dataset_collection’) ‘source’ = ‘hdca’ ‘content’ = [the encoded id from the HDCA]

    create new history dataset collection (for type ‘dataset_collection’) ‘source’ = ‘new_collection’ (default ‘source’ if type is

    ‘dataset_collection’ - no need to specify this)

    ‘collection_type’ = For example, “list”, “paired”, “list:paired”. ‘name’ = Name of new dataset collection. ‘element_identifiers’ = Recursive list structure defining collection.

    Each element must have ‘src’ which can be ‘hda’, ‘ldda’, ‘hdca’, or ‘new_collection’, as well as a ‘name’ which is the name of element (e.g. “forward” or “reverse” for paired datasets, or arbitrary sample names for instance for lists). For all src’s except ‘new_collection’ - a encoded ‘id’ attribute must be included wiht element as well. ‘new_collection’ sources must defined a ‘collection_type’ and their own list of (potentially) nested ‘element_identifiers’.
..note:
Currently, a user can only copy an HDA from a history that the user owns.
Return type:dict
Returns:dictionary containing detailed information for the new HDA
delete(self, trans, history_id, id, **kwd)[source]
  • DELETE /api/histories/{history_id}/contents/{id}

    delete the HDA with the given id

Note

Currently does not stop any active jobs for which this dataset is an output.

Parameters:
  • id (str) – the encoded id of the history to delete
  • purge (bool) – if True, purge the HDA
  • kwd (dict) –

    (optional) dictionary structure containing:

    • payload: a dictionary itself containing:
      • purge: if True, purge the HDA

Note

that payload optionally can be placed in the query string of the request. This allows clients that strip the request body to still purge the dataset.

Return type:dict
Returns:an error object if an error occurred or a dictionary containing: * id: the encoded id of the history, * deleted: if the history was marked as deleted, * purged: if the history was purged
index(self, trans, history_id, ids=None, **kwd)[source]
  • GET /api/histories/{history_id}/contents

    return a list of HDA data for the history with the given id

Note

Anonymous users are allowed to get their current history contents

If Ids is not given, index returns a list of summary objects for every HDA associated with the given history_id.

If ids is given, index returns a more complete json object for each HDA in the ids list.

Parameters:
  • history_id (str) – encoded id string of the HDA’s History
  • ids (str) – (optional) a comma separated list of encoded HDA ids
  • types (str) – (optional) kinds of contents to index (currently just dataset, but dataset_collection will be added shortly).
Return type:

list

Returns:

dictionaries containing summary or detailed HDA information

show(self, trans, id, history_id, **kwd)[source]
  • GET /api/histories/{history_id}/contents/{id}

    return detailed information about an HDA within a history

Note

Anonymous users are allowed to get their current history contents

Parameters:
  • ids – the encoded id of the HDA to return
  • history_id (str) – encoded id string of the HDA’s History
Return type:

dict

Returns:

dictionary containing detailed HDA information

update(self, trans, history_id, id, payload, **kwd)[source]
  • PUT /api/histories/{history_id}/contents/{id}

    updates the values for the HDA with the given id

Parameters:
  • history_id (str) – encoded id string of the HDA’s History
  • id (str) – the encoded id of the history to undelete
  • payload (dict) –

    a dictionary containing any or all the fields in galaxy.model.HistoryDatasetAssociation.to_dict() and/or the following:

    • annotation: an annotation for the HDA
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated

item_tags Module

API operations related to tagging items.

class galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesTagsMixin

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
update(trans, *args, **kwargs)
class galaxy.webapps.galaxy.api.item_tags.HistoryContentTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'history_content_tags'
tagged_item_class = 'HistoryDatasetAssociation'
tagged_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.item_tags.HistoryTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'history_tags'
tagged_item_class = 'History'
tagged_item_id = 'history_id'
class galaxy.webapps.galaxy.api.item_tags.WorkflowTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'workflow_tags'
tagged_item_class = 'StoredWorkflow'
tagged_item_id = 'workflow_id'
job_files Module

API for asynchronous job running mechanisms can use to fetch or put files related to running and queued jobs.

class galaxy.webapps.galaxy.api.job_files.JobFilesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

This job files controller allows remote job running mechanisms to read and modify the current state of files for queued and running jobs. It is certainly not meant to represent part of Galaxy’s stable, user facing API.

Furthermore, even if a user key corresponds to the user running the job, it should not be accepted for authorization - this API allows access to low-level unfiltered files and such authorization would break Galaxy’s security model for tool execution.

create(self, trans, job_id, payload, **kwargs)[source]
  • POST /api/jobs/{job_id}/files

    Populate an output file (formal dataset, task split part, working directory file (such as those related to metadata)). This should be a multipart post with a ‘file’ parameter containing the contents of the actual file to create.

Parameters:
  • job_id (str) – encoded id string of the job
  • payload (dict) – dictionary structure containing:: ‘job_key’ = Key authenticating ‘path’ = Path to file to create.
..note:
This API method is intended only for consumption by job runners, not end users.
Return type:dict
Returns:an okay message
index(self, trans, job_id, **kwargs)[source]
  • GET /api/jobs/{job_id}/files

    Get a file required to staging a job (proper datasets, extra inputs, task-split inputs, working directory files).

Parameters:
  • job_id (str) – encoded id string of the job
  • path (str) – Path to file.
  • job_key (str) – A key used to authenticate this request as acting on behalf or a job runner for the specified job.
..note:
This API method is intended only for consumption by job runners, not end users.
Return type:binary
Returns:contents of file
jobs Module

API operations on a jobs.

See also

galaxy.model.Jobs

class galaxy.webapps.galaxy.api.jobs.JobController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixinItems

create(trans, *args, **kwargs)[source]

See the create method in tools.py in order to submit a job.

index(trans, state=None, tool_id=None, history_id=None, date_range_min=None, date_range_max=None, user_details=False)[source]
  • GET /api/jobs:

    return jobs for current user

    !! if user is admin and user_details is True, then

    return jobs for all galaxy users based on filtering - this is an extended service

Parameters:state (string or list) – limit listing of jobs to those that match one of the included states. If none, all are returned.
Valid Galaxy job states include:
‘new’, ‘upload’, ‘waiting’, ‘queued’, ‘running’, ‘ok’, ‘error’, ‘paused’, ‘deleted’, ‘deleted_new’
Parameters:
  • tool_id (string or list) – limit listing of jobs to those that match one of the included tool_ids. If none, all are returned.
  • user_details (boolean) – if true, and requestor is an admin, will return external job id and user email.
  • date_range_min (string ‘2014-01-01’) – limit the listing of jobs to those updated on or after requested date
  • date_range_max (string ‘2014-12-31’) – limit the listing of jobs to those updated on or before requested date
  • history_id (string) – limit listing of jobs to those that match the history_id. If none, all are returned.
Return type:

list

Returns:

list of dictionaries containing summary job information

inputs(trans, *args, **kwargs)[source]

show( trans, id ) * GET /api/jobs/{job_id}/inputs

returns input datasets created by job
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing input dataset associations
outputs(trans, *args, **kwargs)[source]

show( trans, id ) * GET /api/jobs/{job_id}/outputs

returns output datasets created by job
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing output dataset associations
search(trans, payload)[source]
  • POST /api/jobs/search:

    return jobs for current user

Parameters:payload (dict) – Dictionary containing description of requested job. This is in the same format as a request to POST /apt/tools would take to initiate a job
Return type:list
Returns:list of dictionaries containing summary job information of the jobs that match the requested job run

This method is designed to scan the list of previously run jobs and find records of jobs that had the exact some input parameters and datasets. This can be used to minimize the amount of repeated work, and simply recycle the old results.

show(trans, id)[source]
  • GET /api/jobs/{job_id}:

    return jobs for current user

Parameters:
  • id (string) – Specific job id
  • full (boolean) – whether to return extra information
Return type:

dictionary

Returns:

dictionary containing full description of job data

lda_datasets Module

API operations on the library datasets.

class galaxy.webapps.galaxy.api.lda_datasets.LibraryDatasetsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin

delete(trans, *args, **kwargs)[source]

delete( self, trans, encoded_dataset_id, **kwd ): * DELETE /api/libraries/datasets/{encoded_dataset_id}

Marks the dataset deleted or undeleted based on the value of the undelete flag. If the flag is not present it is considered False and the item is marked deleted.
Parameters:encoded_dataset_id (an encoded id string) – the encoded id of the dataset to change
Returns:dict containing information about the dataset
Return type:dictionary
download(self, trans, format, **kwd)[source]
  • GET /api/libraries/datasets/download/{format}

  • POST /api/libraries/datasets/download/{format}

    Downloads requested datasets (identified by encoded IDs) in requested format.

example: GET localhost:8080/api/libraries/datasets/download/tbz?ld_ids%255B%255D=a0d84b45643a2678&ld_ids%255B%255D=fe38c84dcd46c828

Note

supported format values are: ‘zip’, ‘tgz’, ‘tbz’, ‘uncompressed’

Parameters:
  • format (string) – string representing requested archive format
  • ld_ids[] (an array) – an array of encoded ids
Return type:

file

Returns:

either archive with the requested datasets packed inside or a single uncompressed dataset

Raises:

MessageException, ItemDeletionException, ItemAccessibilityException, HTTPBadRequest, OSError, IOError, ObjectNotFound

load(trans, *args, **kwargs)[source]

load( self, trans, **kwd ): * POST /api/libraries/datasets Load dataset from the given source into the library. Source can be:

user directory - root folder specified in galaxy.ini as “$user_library_import_dir”
example path: path/to/galaxy/$user_library_import_dir/user@example.com/{user can browse everything here} the folder with the user login has to be created beforehand
(admin)import directory - root folder specified in galaxy ini as “$library_import_dir”
example path: path/to/galaxy/$library_import_dir/{admin can browse everything here}

(admin)any absolute or relative path - option allowed with “allow_library_path_paste” in galaxy.ini

Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to import dataset(s) to
  • source (str) – source the datasets should be loaded form
  • link_data (bool) – flag whether to link the dataset to data or copy it to Galaxy, defaults to copy while linking is set to True all symlinks will be resolved _once_
  • preserve_dirs (bool) – flag whether to preserve the directory structure when importing dir if False only datasets will be imported
  • file_type (str) – file type of the loaded datasets, defaults to ‘auto’ (autodetect)
  • dbkey (str) – dbkey of the loaded genome, defaults to ‘?’ (unknown)
Returns:

dict containing information about the created upload job

Return type:

dictionary

show(self, trans, id, **kwd)[source]
  • GET /api/libraries/datasets/{encoded_dataset_id}:

    Displays information about the dataset identified by the encoded ID.

Parameters:id (an encoded id string) – the encoded id of the dataset to query
Returns:detailed dataset information from base controller
Return type:dictionary
show_roles(trans, *args, **kwargs)[source]

show_roles( self, trans, id, **kwd ): * GET /api/libraries/datasets/{encoded_dataset_id}/permissions

Displays information about current or available roles for a given dataset permission.
Parameters:
  • encoded_dataset_id (an encoded id string) – the encoded id of the dataset to query
  • scope (string) – either ‘current’ or ‘available’
Return type:

dictionary

Returns:

either dict of current roles for all permission types or dict of available roles to choose from (is the same for any permission type)

show_version(trans, *args, **kwargs)[source]

show_version( self, trans, encoded_dataset_id, encoded_ldda_id, **kwd ): * GET /api/libraries/datasets/:encoded_dataset_id/versions/:encoded_ldda_id

Displays information about specific version of the library_dataset (i.e. ldda).
Parameters:
  • encoded_dataset_id (an encoded id string) – the encoded id of the dataset to query
  • encoded_ldda_id (an encoded id string) – the encoded id of the ldda to query
Return type:

dictionary

Returns:

dict of ldda’s details

update_permissions(trans, *args, **kwargs)[source]
def update( self, trans, encoded_dataset_id, **kwd ):
*POST /api/libraries/datasets/{encoded_dataset_id}/permissions
Parameters:
  • encoded_dataset_id (an encoded id string) – the encoded id of the dataset to update permissions of
  • action (string) – (required) describes what action should be performed available actions: make_private, remove_restrictions, set_permissions
  • access_ids[] (string or list) – list of Role.name defining roles that should have access permission on the dataset
  • manage_ids[] (string or list) – list of Role.name defining roles that should have manage permission on the dataset
  • modify_ids[] (string or list) – list of Role.name defining roles that should have modify permission on the library dataset item
Return type:

dictionary

Returns:

dict of current roles for all available permission types

Raises:

RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

libraries Module

API operations on a data library.

class galaxy.webapps.galaxy.api.libraries.LibrariesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(self, trans, payload, **kwd)[source]
  • POST /api/libraries:

    Creates a new library. Only name parameter is required.

Note

Currently, only admin users can create libraries.

Parameters:payload (dict) – dictionary structure containing:: ‘name’: the new library’s name (required) ‘description’: the new library’s description (optional) ‘synopsis’: the new library’s synopsis (optional)
Returns:detailed library information
Return type:dict
Raises:ItemAccessibilityException, RequestParameterMissingException
delete(self, trans, id, **kwd)[source]
  • DELETE /api/libraries/{id}

    marks the library with the given id as deleted (or removes the deleted mark if the undelete param is true)

Note

Currently, only admin users can un/delete libraries.

Parameters:
  • id (an encoded id string) – the encoded id of the library to un/delete
  • undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
Returns:

detailed library information

Return type:

dictionary

Raises:ItemAccessibilityException, MalformedId, ObjectNotFound
get_permissions(trans, *args, **kwargs)[source]
  • GET /api/libraries/{id}/permissions

Load all permissions for the given library id and return it.

Parameters:
  • encoded_library_id (an encoded id string) – the encoded id of the library
  • scope (string) – either ‘current’ or ‘available’
  • is_library_access (bool) – indicates whether the roles available for the library access are requested
Returns:

dictionary with all applicable permissions’ values

Return type:

dictionary

Raises:

ObjectNotFound, InsufficientPermissionsException

index(self, trans, **kwd)[source]
  • GET /api/libraries:

    Returns a list of summary data for all libraries.

Parameters:deleted (boolean (optional)) – if True, show only deleted libraries, if False show only non-deleted
Returns:list of dictionaries containing library information
Return type:list
set_permissions(trans, *args, **kwargs)[source]
def set_permissions( self, trans, encoded_dataset_id, **kwd ):
*POST /api/libraries/{encoded_library_id}/permissions
Parameters:
  • encoded_library_id (an encoded id string) – the encoded id of the library to set the permissions of
  • action (string) – (required) describes what action should be performed available actions: remove_restrictions, set_permissions
  • access_ids[] (string or list) – list of Role.id defining roles that should have access permission on the library
  • add_ids[] (string or list) – list of Role.id defining roles that should have add item permission on the library
  • manage_ids[] (string or list) – list of Role.id defining roles that should have manage permission on the library
  • modify_ids[] (string or list) – list of Role.id defining roles that should have modify permission on the library
Return type:

dictionary

Returns:

dict of current roles for all available permission types

Raises:

RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

set_permissions_old(trans, library, payload, **kwd)[source]

* old implementation for backward compatibility *

POST /api/libraries/{encoded_library_id}/permissions Updates the library permissions.

show(self, trans, id, deleted='False', **kwd)[source]
  • GET /api/libraries/{encoded_id}:

    returns detailed information about a library

  • GET /api/libraries/deleted/{encoded_id}:

    returns detailed information about a deleted library

Parameters:
  • id (an encoded id string) – the encoded id of the library
  • deleted (boolean) – if True, allow information on a deleted library
Returns:

detailed library information

Return type:

dictionary

Raises:MalformedId, ObjectNotFound
update(trans, *args, **kwargs)[source]
  • PATCH /api/libraries/{encoded_id}

    Updates the library defined by an encoded_id with the data in the payload.

Note

Currently, only admin users can update libraries. Also the library must not be deleted.

param id:the encoded id of the library
type id:an encoded id string
param payload:(required) dictionary structure containing:: ‘name’: new library’s name, cannot be empty ‘description’: new library’s description ‘synopsis’: new library’s synopsis
type payload:dict
returns:detailed library information
rtype:dict
raises:ItemAccessibilityException, MalformedId, ObjectNotFound, RequestParameterInvalidException, RequestParameterMissingException
library_contents Module

API operations on the contents of a data library.

class galaxy.webapps.galaxy.api.library_contents.LibraryContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

create(self, trans, library_id, payload, **kwd)[source]
  • POST /api/libraries/{library_id}/contents:

    create a new library file or folder

To copy an HDA into a library send create_type of ‘file’ and the HDA’s encoded id in from_hda_id (and optionally ldda_message).

Parameters:
  • library_id (str) – the encoded id of the library where to create the new item
  • payload (dict) –

    dictionary structure containing:

    • folder_id: the encoded id of the parent folder of the new item
    • create_type: the type of item to create (‘file’, ‘folder’ or ‘collection’)
    • from_hda_id: (optional, only if create_type is ‘file’) the
      encoded id of an accessible HDA to copy into the library
    • ldda_message: (optional) the new message attribute of the LDDA created
    • extended_metadata: (optional) dub-dictionary containing any extended
      metadata to associate with the item
    • upload_option: (optional) one of ‘upload_file’ (default), ‘upload_directory’ or ‘upload_paths’
    • server_dir: (optional, only if upload_option is
      ‘upload_directory’) relative path of the subdirectory of Galaxy library_import_dir to upload. All and only the files (i.e. no subdirectories) contained in the specified directory will be uploaded.
    • filesystem_paths: (optional, only if upload_option is
      ‘upload_paths’ and the user is an admin) file paths on the Galaxy server to upload to the library, one file per line
    • link_data_only: (optional, only when upload_option is
      ‘upload_directory’ or ‘upload_paths’) either ‘copy_files’ (default) or ‘link_to_files’. Setting to ‘link_to_files’ symlinks instead of copying the files
    • name: (optional, only if create_type is ‘folder’) name of the
      folder to create
    • description: (optional, only if create_type is ‘folder’)
      description of the folder to create
Return type:

dict

Returns:

a dictionary containing the id, name, and ‘show’ url of the new item

delete(self, trans, library_id, id, **kwd)[source]
  • DELETE /api/libraries/{library_id}/contents/{id}

    delete the LibraryDataset with the given id

Parameters:
  • id (str) – the encoded id of the library dataset to delete
  • kwd (dict) –

    (optional) dictionary structure containing:

    • payload: a dictionary itself containing:
      • purge: if True, purge the LD
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing: * id: the encoded id of the library dataset, * deleted: if the library dataset was marked as deleted, * purged: if the library dataset was purged

index(self, trans, library_id, **kwd)[source]
  • GET /api/libraries/{library_id}/contents:

    Returns a list of library files and folders.

Note

May be slow! Returns all content traversing recursively through all folders.

See also

galaxy.webapps.galaxy.api.FolderContentsController.index for a non-recursive solution

Parameters:library_id (str) – the encoded id of the library
Returns:list of dictionaries of the form: * id: the encoded id of the library item * name: the ‘library path’
or relationship of the library item to the root
  • type: ‘file’ or ‘folder’
  • url: the url to get detailed information on the library item
Return type:list
Raises:MalformedId, InconsistentDatabase, RequestParameterInvalidException, InternalServerError
show(self, trans, id, library_id, **kwd)[source]
  • GET /api/libraries/{library_id}/contents/{id}

    Returns information about library file or folder.

Parameters:
  • id (str) – the encoded id of the library item to return
  • library_id (str) – the encoded id of the library that contains this item
Returns:

detailed library item information

Return type:

dict

update(self, trans, id, library_id, payload, **kwd)[source]
  • PUT /api/libraries/{library_id}/contents/{id}

    create a ImplicitlyConvertedDatasetAssociation

Parameters:
  • id (str) – the encoded id of the library item to return
  • library_id (str) – the encoded id of the library that contains this item
  • payload (dict) – dictionary structure containing:: ‘converted_dataset_id’:
Return type:

None

Returns:

None

metrics Module

API operations for for querying and recording user metrics from some client (typically a user’s browser).

class galaxy.webapps.galaxy.api.metrics.MetricsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, payload)[source]
  • POST /api/metrics:

    record any metrics sent and return some status object

Note

Anonymous users can post metrics

Parameters:payload (dict) –

(optional) dictionary structure containing: * metrics: a list containing dictionaries of the form:

** namespace: label indicating the source of the metric ** time: isoformat datetime when the metric was recorded ** level: an integer representing the metric’s log level ** args: a json string containing an array of extra data
Return type:dict
Returns:status object
debugging = None

set to true to send additional debugging info to the log

page_revisions Module

API for updating Galaxy Pages

class galaxy.webapps.galaxy.api.page_revisions.PageRevisionsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

create(self, trans, page_id, payload **kwd)[source]
  • POST /api/pages/{page_id}/revisions

    Create a new revision for a page

Parameters:
  • page_id – Add revision to Page with ID=page_id
  • payload – A dictionary containing:: ‘title’ = New title of the page ‘content’ = New content of the page
Return type:

dictionary

Returns:

Dictionary with ‘success’ or ‘error’ element to indicate the result of the request

index(self, trans, page_id, **kwd)[source]
  • GET /api/pages/{page_id}/revisions

    return a list of Page revisions

Parameters:page_id – Display the revisions of Page with ID=page_id
Return type:list
Returns:dictionaries containing different revisions of the page
pages Module

API for updating Galaxy Pages

class galaxy.webapps.galaxy.api.pages.PagesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

create(self, trans, payload, **kwd)[source]
  • POST /api/pages

    Create a page and return dictionary containing Page summary

Parameters:payload – dictionary structure containing:: ‘slug’ = The title slug for the page URL, must be unique ‘title’ = Title of the page ‘content’ = HTML contents of the page ‘annotation’ = Annotation that will be attached to the page
Return type:dict
Returns:Dictionary return of the Page.to_dict call
delete(self, trans, id, **kwd)[source]
  • DELETE /api/pages/{id}

    Create a page and return dictionary containing Page summary

Parameters:id – ID of page to be deleted
Return type:dict
Returns:Dictionary with ‘success’ or ‘error’ element to indicate the result of the request
index(self, trans, deleted=False, **kwd)[source]
  • GET /api/pages

    return a list of Pages viewable by the user

Parameters:deleted – Display deleted pages
Return type:list
Returns:dictionaries containing summary or detailed Page information
show(self, trans, id, **kwd)[source]
  • GET /api/pages/{id}

    View a page summary and the content of the latest revision

Parameters:id – ID of page to be displayed
Return type:dict
Returns:Dictionary return of the Page.to_dict call with the ‘content’ field populated by the most recent revision
provenance Module

API operations provenance

class galaxy.webapps.galaxy.api.provenance.BaseProvenanceController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.provenance.HDAProvenanceController(app)[source]

Bases: galaxy.webapps.galaxy.api.provenance.BaseProvenanceController

controller_name = 'history_content_provenance'
provenance_item_class = 'HistoryDatasetAssociation'
provenance_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.provenance.LDDAProvenanceController(app)[source]

Bases: galaxy.webapps.galaxy.api.provenance.BaseProvenanceController

controller_name = 'ldda_provenance'
provenance_item_class = 'LibraryDatasetDatasetAssociation'
provenance_item_id = 'library_content_id'
quotas Module

API operations on Quota objects.

class galaxy.webapps.galaxy.api.quotas.QuotaAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controllers.admin.Admin, galaxy.actions.admin.AdminActions, galaxy.web.base.controller.UsesQuotaMixin, galaxy.web.params.QuotaParamParser

create(trans, *args, **kwargs)[source]

POST /api/quotas Creates a new quota.

delete(trans, *args, **kwargs)[source]

DELETE /api/quotas/{encoded_quota_id} Deletes a quota

index(trans, *args, **kwargs)[source]

GET /api/quotas GET /api/quotas/deleted Displays a collection (list) of quotas.

show(trans, *args, **kwargs)[source]

GET /api/quotas/{encoded_quota_id} GET /api/quotas/deleted/{encoded_quota_id} Displays information about a quota.

undelete(trans, *args, **kwargs)[source]

POST /api/quotas/deleted/{encoded_quota_id}/undelete Undeletes a quota

update(trans, *args, **kwargs)[source]

PUT /api/quotas/{encoded_quota_id} Modifies a quota.

request_types Module

API operations on RequestType objects.

class galaxy.webapps.galaxy.api.request_types.RequestTypeAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/request_types Creates a new request type (external_service configuration).

index(trans, *args, **kwargs)[source]

GET /api/request_types Displays a collection (list) of request_types.

show(trans, *args, **kwargs)[source]

GET /api/request_types/{encoded_request_type_id} Displays information about a request_type.

requests Module

API operations on a sample tracking system.

class galaxy.webapps.galaxy.api.requests.RequestsAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/requests Displays a collection (list) of sequencing requests.

show(trans, *args, **kwargs)[source]

GET /api/requests/{encoded_request_id} Displays details of a sequencing request.

update(trans, *args, **kwargs)[source]

PUT /api/requests/{encoded_request_id} Updates a request state, sample state or sample dataset transfer status depending on the update_type

v = ('REQUEST', 'request_state')
roles Module

API operations on Role objects.

class galaxy.webapps.galaxy.api.roles.RoleAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/roles Creates a new role.

index(trans, *args, **kwargs)[source]

GET /api/roles Displays a collection (list) of roles.

show(trans, *args, **kwargs)[source]

GET /api/roles/{encoded_role_id} Displays information about a role.

samples Module

API operations for samples in the Galaxy sample tracking system.

class galaxy.webapps.galaxy.api.samples.SamplesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/requests/{encoded_request_id}/samples Displays a collection (list) of sample of a sequencing request.

k = 'SAMPLE_DATASET'
update(trans, *args, **kwargs)[source]

PUT /api/samples/{encoded_sample_id} Updates a sample or objects related ( mapped ) to a sample.

update_type_values = ['sample_state', 'run_details', 'sample_dataset_transfer_status']
update_types = <galaxy.util.bunch.Bunch object>
v = ['sample_dataset_transfer_status']
search Module

API for searching Galaxy Datasets

class galaxy.webapps.galaxy.api.search.SearchController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin

create(trans, *args, **kwargs)[source]

POST /api/search Do a search of the various elements of Galaxy.

tool_data Module
class galaxy.webapps.galaxy.api.tool_data.ToolData(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool data

delete(trans, *args, **kwargs)[source]

DELETE /api/tool_data/{id} Removes an item from a data table

Parameters:
  • id (str) – the id of the data table containing the item to delete
  • kwd (dict) –

    (required) dictionary structure containing:

    • payload: a dictionary itself containing:
      • values: <TAB> separated list of column contents, there must be a value for all the columns of the data table
download_field_file(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]

GET /api/tool_data: returns a list tool_data tables:

reload(trans, *args, **kwargs)[source]

GET /api/tool_data/{id}/reload

Reloads a tool_data table.

show(trans, *args, **kwargs)[source]
show_field(trans, *args, **kwargs)[source]

GET /api/tool_data/<id>/fields/<value>

Get information about a partiular field in a tool_data table

tool_shed_repositories Module
class galaxy.webapps.galaxy.api.tool_shed_repositories.ToolShedRepositoriesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool shed repositories.

exported_workflows(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{encoded_tool_shed_repository_id}/exported_workflows

Display a list of dictionaries containing information about this tool shed repository’s exported workflows.

Parameters:id – the encoded id of the ToolShedRepository object
get_latest_installable_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/get_latest_installable_revision Get the latest installable revision of a specified repository from a specified Tool Shed.

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed from which to retrieve the Repository revision. :param name (required): the name of the Repository :param owner (required): the owner of the Repository

import_workflow(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/import_workflow

Import the specified exported workflow contained in the specified installed tool shed repository into Galaxy.

Parameters:
  • key – the API key of the Galaxy user with which the imported workflow will be associated.
  • id – the encoded id of the ToolShedRepository object

The following parameters are included in the payload. :param index: the index location of the workflow tuple in the list of exported workflows stored in the metadata for the specified repository

import_workflows(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/import_workflows

Import all of the exported workflows contained in the specified installed tool shed repository into Galaxy.

Parameters:
  • key – the API key of the Galaxy user with which the imported workflows will be associated.
  • id – the encoded id of the ToolShedRepository object
index(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories Display a list of dictionaries containing information about installed tool shed repositories.

install_repository_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install_repository_revision Install a specified repository revision from a specified tool shed into Galaxy.

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed from which to install the Repository :param name (required): the name of the Repository :param owner (required): the owner of the Repository :param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository :param new_tool_panel_section_label (optional): label of a new section to be added to the Galaxy tool panel in which to load

tools contained in the Repository. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string or both must be an empty string (both cannot be used simultaneously).
Parameters:
  • (optional) (shed_tool_conf) – id of the Galaxy tool panel section in which to load tools contained in the Repository. If this parameter is an empty string and the above new_tool_panel_section_label parameter is an empty string, tools will be loaded outside of any sections in the tool panel. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string of both must be an empty string (both cannot be used simultaneously).
  • (optional) – Set to True if you want to install repository dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – Set to True if you want to install tool dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – The shed-related tool panel configuration file configured in the “tool_config_file” setting in the Galaxy config file (e.g., galaxy.ini). At least one shed-related tool panel config file is required to be configured. Setting this parameter to a specific file enables you to choose where the specified repository will be installed because the tool_path attribute of the <toolbox> from the specified file is used as the installation location (e.g., <toolbox tool_path=”../shed_tools”>). If this parameter is not set, a shed-related tool panel configuration file will be selected automatically.
install_repository_revisions(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install_repository_revisions Install one or more specified repository revisions from one or more specified tool sheds into Galaxy. The received parameters must be ordered lists so that positional values in tool_shed_urls, names, owners and changeset_revisions are associated.

It’s questionable whether this method is needed as the above method for installing a single repository can probably cover all desired scenarios. We’ll keep this one around just in case...

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_urls: the base URLs of the Tool Sheds from which to install a specified Repository :param names: the names of the Repositories to be installed :param owners: the owners of the Repositories to be installed :param changeset_revisions: the changeset_revisions of each RepositoryMetadata object associated with each Repository to be installed :param new_tool_panel_section_label: optional label of a new section to be added to the Galaxy tool panel in which to load

tools contained in the Repository. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string, as both cannot be used.
Parameters:
  • tool_panel_section_id – optional id of the Galaxy tool panel section in which to load tools contained in the Repository. If not set, tools will be loaded outside of any sections in the tool panel. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string, as both cannot be used.
  • (optional) (shed_tool_conf) – Set to True if you want to install repository dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – Set to True if you want to install tool dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – The shed-related tool panel configuration file configured in the “tool_config_file” setting in the Galaxy config file (e.g., galaxy.ini). At least one shed-related tool panel config file is required to be configured. Setting this parameter to a specific file enables you to choose where the specified repository will be installed because the tool_path attribute of the <toolbox> from the specified file is used as the installation location (e.g., <toolbox tool_path=”../shed_tools”>). If this parameter is not set, a shed-related tool panel configuration file will be selected automatically.
repair_repository_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/repair_repository_revision Repair a specified repository revision previously installed into Galaxy.

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository was installed :param name (required): the name of the Repository :param owner (required): the owner of the Repository :param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository

reset_metadata_on_installed_repositories(trans, *args, **kwargs)[source]

PUT /api/tool_shed_repositories/reset_metadata_on_installed_repositories

Resets all metadata on all repositories installed into Galaxy in an “orderly fashion”.

Parameters:key – the API key of the Galaxy admin user.
show(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{encoded_tool_shed_repsository_id} Display a dictionary containing information about a specified tool_shed_repository.

Parameters:id – the encoded id of the ToolShedRepository object
galaxy.webapps.galaxy.api.tool_shed_repositories.get_message_for_no_shed_tool_config()[source]
tools Module
users Module

API operations on User objects.

class galaxy.webapps.galaxy.api.users.UserAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesTagsMixin, galaxy.web.base.controller.CreatesUsersMixin, galaxy.web.base.controller.CreatesApiKeysMixin

anon_user_api_value(trans)[source]

Returns data for an anonymous user, truncated to only usage and quota_percent

api_key(trans, *args, **kwargs)[source]

POST /api/users/{encoded_user_id}/api_key Creates a new API key for specified user.

create(trans, *args, **kwargs)[source]

POST /api/users Creates a new Galaxy user.

delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]

GET /api/users GET /api/users/deleted Displays a collection (list) of users.

show(trans, *args, **kwargs)[source]

GET /api/users/{encoded_user_id} GET /api/users/deleted/{encoded_user_id} GET /api/users/current Displays information about a user.

undelete(trans, *args, **kwargs)[source]
update(trans, *args, **kwargs)[source]
visualizations Module

Visualizations resource control over the API.

NOTE!: this is a work in progress and functionality and data structures may change often.

class galaxy.webapps.galaxy.api.visualizations.VisualizationsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin, galaxy.web.base.controller.SharableMixin, galaxy.model.item_attrs.UsesAnnotations

RESTful controller for interactions with visualizations.

create(trans, *args, **kwargs)[source]

POST /api/visualizations creates a new visualization using the given payload

POST /api/visualizations?import_id={encoded_visualization_id} imports a copy of an existing visualization into the user’s workspace

index(trans, *args, **kwargs)[source]

GET /api/visualizations:

show(trans, *args, **kwargs)[source]

GET /api/visualizations/{viz_id}

update(trans, *args, **kwargs)[source]

PUT /api/visualizations/{encoded_visualization_id}

workflows Module

API operations for Workflows

class galaxy.webapps.galaxy.api.workflows.WorkflowsAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

build_module(trans, *args, **kwargs)[source]

POST /api/workflows/build_module Builds module details including a tool model for the workflow editor.

cancel_invocation(trans, *args, **kwargs)[source]

DELETE /api/workflows/{workflow_id}/invocation/{invocation_id} Cancel the specified workflow invocation.

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the usage id (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

create(trans, *args, **kwargs)[source]

POST /api/workflows

Run or create workflows from the api.

If installed_repository_file or from_history_id is specified a new workflow will be created for this user. Otherwise, workflow_id must be specified and this API method will cause a workflow to execute.

:param installed_repository_file The path of a workflow to import. Either workflow_id, installed_repository_file or from_history_id must be specified :type installed_repository_file str

Parameters:
  • workflow_id (str) – An existing workflow id. Either workflow_id, installed_repository_file or from_history_id must be specified
  • parameters (dict) – If workflow_id is set - see _update_step_parameters()
  • ds_map (dict) – If workflow_id is set - a dictionary mapping each input step id to a dictionary with 2 keys: ‘src’ (which can be ‘ldda’, ‘ld’ or ‘hda’) and ‘id’ (which should be the id of a LibraryDatasetDatasetAssociation, LibraryDataset or HistoryDatasetAssociation respectively)
  • no_add_to_history (str) – If workflow_id is set - if present in the payload with any value, the input datasets will not be added to the selected history
  • history (str) – If workflow_id is set - optional history where to run the workflow, either the name of a new history or “hist_id=HIST_ID” where HIST_ID is the id of an existing history. If not specified, the workflow will be run a new unnamed history
  • replacement_params (dict) – If workflow_id is set - an optional dictionary used when renaming datasets
  • from_history_id (str) – Id of history to extract a workflow from. Either workflow_id, installed_repository_file or from_history_id must be specified
  • job_ids (str) – If from_history_id is set - optional list of jobs to include when extracting a workflow from history
  • dataset_ids (str) – If from_history_id is set - optional list of HDA `hid`s corresponding to workflow inputs when extracting a workflow from history
  • dataset_collection_ids (str) – If from_history_id is set - optional list of HDCA `hid`s corresponding to workflow inputs when extracting a workflow from history
  • workflow_name (str) – If from_history_id is set - name of the workflow to create when extracting a workflow from history
delete(trans, *args, **kwargs)[source]

DELETE /api/workflows/{encoded_workflow_id} Deletes a specified workflow Author: rpark

copied from galaxy.web.controllers.workflows.py (delete)

import_new_workflow_deprecated(trans, *args, **kwargs)[source]

POST /api/workflows/upload Importing dynamic workflows from the api. Return newly generated workflow id. Author: rpark

# currently assumes payload[‘workflow’] is a json representation of a workflow to be inserted into the database

Deprecated in favor to POST /api/workflows with encoded ‘workflow’ in payload the same way.

import_shared_workflow_deprecated(trans, *args, **kwargs)[source]

POST /api/workflows/import Import a workflow shared by other users.

Parameters:workflow_id (str) – the workflow id (required)
Raises:exceptions.MessageException, exceptions.ObjectNotFound
index(trans, *args, **kwargs)[source]

GET /api/workflows

Displays a collection of workflows.

Parameters:show_published (boolean) – if True, show also published workflows
index_invocations(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocations

Get the list of the workflow invocations

Parameters:workflow_id (str) – the workflow id (required)
Raises:exceptions.MessageException, exceptions.ObjectNotFound
invocation_step(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id}

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the invocation id (required)
  • step_id (str) – encoded id of the WorkflowInvocationStep (required)
  • payload – payload containing update action information for running workflow.
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

invoke(trans, *args, **kwargs)[source]

POST /api/workflows/{encoded_workflow_id}/invocations

Schedule the workflow specified by workflow_id to run.

show(trans, *args, **kwargs)[source]

GET /api/workflows/{encoded_workflow_id}

Displays information needed to run a workflow from the command line.

show_invocation(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocation/{invocation_id} Get detailed description of workflow invocation

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the invocation id (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

update(trans, *args, **kwargs)[source]
  • PUT /api/workflows/{id}

    updates the workflow stored with id

Parameters:
  • id (str) – the encoded id of the workflow to update
  • payload (dict) –

    a dictionary containing any or all the * workflow the json description of the workflow as would be

    produced by GET workflows/<id>/download or given to POST workflows

    The workflow contents will be updated to target this.

Return type:

dict

Returns:

serialized version of the workflow

update_invocation_step(trans, *args, **kwargs)[source]

PUT /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id} Update state of running workflow step invocation - still very nebulous but this would be for stuff like confirming paused steps can proceed etc....

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the usage id (required)
  • step_id (str) – encoded id of the WorkflowInvocationStep (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

workflow_dict(trans, *args, **kwargs)[source]

GET /api/workflows/{encoded_workflow_id}/download Returns a selected workflow as a json dictionary.

lib

fpconst Module

galaxy Package

galaxy Package

Galaxy root package – this is a namespace package.

app Module
config Module

Universe configuration builder.

class galaxy.config.Configuration(**kwargs)[source]

Bases: object

check()[source]
deprecated_options = ('database_file',)
ensure_tempdir()[source]
get(key, default)[source]
get_bool(key, default)[source]
guess_galaxy_port()[source]
is_admin_user(user)[source]

Determine if the provided user is listed in admin_users.

NOTE: This is temporary, admin users will likely be specified in the
database in the future.
resolve_path(path)[source]

Resolve a path relative to Galaxy’s root.

sentry_dsn_public

Sentry URL with private key removed for use in client side scripts, sentry server will need to be configured to accept events

class galaxy.config.ConfiguresGalaxyMixin[source]

Shared code for configuring Galaxy-like app objects.

galaxy.config.configure_logging(config)[source]

Allow some basic logging configuration to be read from ini file.

galaxy.config.get_database_engine_options(kwargs, model_prefix='')[source]

Allow options for the SQLAlchemy database engine to be passed by using the prefix “database_engine_option”.

galaxy.config.resolve_path(path, root)[source]

If ‘path’ is relative make absolute by prepending ‘root’

Subpackages
actions Package
admin Module

Contains administrative functions

class galaxy.actions.admin.AdminActions[source]

Bases: object

Mixin for controllers that provide administrative functionality.

datatypes Package
assembly Module

velvet datatypes James E Johnson - University of Minnesota for velvet assembler tool in galaxy

class galaxy.datatypes.assembly.Amos(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing the AMOS assembly file

file_ext = 'afg'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]

Determines whether the file is an amos assembly file format Example:

{CTG
iid:1
eid:1
seq:
CCTCTCCTGTAGAGTTCAACCGA-GCCGGTAGAGTTTTATCA
.
qlt:
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
.
{TLE
src:1027
off:0
clr:618,0
gap:
250 612
.
}
}
class galaxy.datatypes.assembly.Roadmaps(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing the Sequences file generated by velveth

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]
Determines whether the file is a velveth produced RoadMap::
142858 21 1 ROADMAP 1 ROADMAP 2 ...
class galaxy.datatypes.assembly.Sequences(**kwd)[source]

Bases: galaxy.datatypes.sequence.Fasta

Class describing the Sequences file generated by velveth

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
sniff(filename)[source]

Determines whether the file is a velveth produced fasta format The id line has 3 fields separated by tabs: sequence_name sequence_index cataegory:

>SEQUENCE_0_length_35   1       1
GGATATAGGGCCAACCCAACTCAACGGCCTGTCTT
>SEQUENCE_1_length_35   2       1
CGACGAATGACAGGTCACGAATTTGGCGGGGATTA
class galaxy.datatypes.assembly.Velvet(**kwd)[source]

Bases: galaxy.datatypes.images.Html

allow_datatype_change = False
composite_type = 'auto_primary_file'
file_ext = 'html'
generate_primary_file(dataset=None)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for velveth dataset, defaults to 'velvet', paired_end_reads (MetadataParameter): has paired-end reads, defaults to 'False', long_reads (MetadataParameter): has long reads, defaults to 'False', short2_reads (MetadataParameter): has 2nd short reads, defaults to 'False'
regenerate_primary_file(dataset)[source]

cannot do this until we are setting metadata

set_meta(dataset, **kwd)[source]
binary Module

Binary classes

class galaxy.datatypes.binary.Ab1(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing an ab1 binary sequence file

display_peek(dataset)[source]
file_ext = 'ab1'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
class galaxy.datatypes.binary.Bam(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing a BAM binary file

column_dataprovider(*args, **kwargs)[source]
data_sources = {'index': 'bigwig', 'data': 'bai'}
dataproviders = {'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'id-seq-qual': <function id_seq_qual_dataprovider at 0x7f2ab0244488>, 'header': <function header_dataprovider at 0x7f2ab0244320>, 'column': <function column_dataprovider at 0x7f2ab0244050>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'samtools': <function samtools_dataprovider at 0x7f2ab02448c0>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab023de60>, 'genomic-region': <function genomic_region_dataprovider at 0x7f2ab02445f0>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab02441b8>, 'line': <function line_dataprovider at 0x7f2ab023dcf8>, 'genomic-region-dict': <function genomic_region_dict_dataprovider at 0x7f2ab0244758>}
dataset_content_needs_grooming(file_name)[source]

See if file_name is a sorted BAM file

dict_dataprovider(*args, **kwargs)[source]
display_peek(dataset)[source]
file_ext = 'bam'
genomic_region_dataprovider(*args, **kwargs)[source]
genomic_region_dict_dataprovider(*args, **kwargs)[source]
groom_dataset_content(file_name)[source]

Ensures that the Bam file contents are sorted. This function is called on an output dataset after the content is initially generated.

header_dataprovider(*args, **kwargs)[source]
id_seq_qual_dataprovider(*args, **kwargs)[source]
init_meta(dataset, copy_from=None)[source]
line_dataprovider(*args, **kwargs)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', bam_index (FileParameter): BAM Index File, defaults to 'None', bam_version (MetadataParameter): BAM Version, defaults to 'None', sort_order (MetadataParameter): Sort Order, defaults to 'None', read_groups (MetadataParameter): Read Groups, defaults to '[]', reference_names (MetadataParameter): Chromosome Names, defaults to '[]', reference_lengths (MetadataParameter): Chromosome Lengths, defaults to '[]', bam_header (MetadataParameter): Dictionary of BAM Headers, defaults to '{}'
regex_line_dataprovider(*args, **kwargs)[source]
samtools_dataprovider(*args, **kwargs)[source]

Generic samtools interface - all options available through settings.

set_meta(dataset, overwrite=True, **kwd)[source]

Creates the index for the BAM file.

set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
track_type = 'ReadTrack'
class galaxy.datatypes.binary.Bcf(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing a BCF file

file_ext = 'bcf'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename)[source]
class galaxy.datatypes.binary.BigBed(**kwd)[source]

Bases: galaxy.datatypes.binary.BigWig

BigBed support from UCSC.

data_sources = {'data_standalone': 'bigbed'}
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
class galaxy.datatypes.binary.BigWig(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Accessing binary BigWig files from UCSC. The supplemental info in the paper has the binary details: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btq351v1

data_sources = {'data_standalone': 'bigwig'}
display_peek(dataset)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
track_type = 'LineTrack'
class galaxy.datatypes.binary.Binary(**kwd)[source]

Bases: galaxy.datatypes.data.Data

Binary data

display_data(trans, dataset, preview=False, filename=None, to_ext=None, size=None, offset=None, **kwd)[source]
get_mime()[source]

Returns the mime type of the datatype

static is_ext_unsniffable(ext)[source]
static is_sniffable_binary(filename)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
static register_sniffable_binary_format(data_type, ext, type_class)[source]
static register_unsniffable_binary_ext(ext)[source]
set_peek(dataset, is_multi_byte=False)[source]

Set the peek and blurb text

sniffable_binary_formats = [{'ext': 'bam', 'type': 'bam', 'class': <class 'galaxy.datatypes.binary.Bam'>}, {'ext': 'bcf', 'type': 'bcf', 'class': <class 'galaxy.datatypes.binary.Bcf'>}, {'ext': 'sff', 'type': 'sff', 'class': <class 'galaxy.datatypes.binary.Sff'>}, {'ext': 'bigwig', 'type': 'bigwig', 'class': <class 'galaxy.datatypes.binary.BigWig'>}, {'ext': 'bigbed', 'type': 'bigbed', 'class': <class 'galaxy.datatypes.binary.BigBed'>}, {'ext': 'twobit', 'type': 'twobit', 'class': <class 'galaxy.datatypes.binary.TwoBit'>}, {'ext': 'gemini.sqlite', 'type': 'gemini.sqlite', 'class': <class 'galaxy.datatypes.binary.GeminiSQLite'>}, {'ext': 'sqlite', 'type': 'sqlite', 'class': <class 'galaxy.datatypes.binary.SQlite'>}, {'ext': 'xlsx', 'type': 'xlsx', 'class': <class 'galaxy.datatypes.binary.Xlsx'>}, {'ext': 'sra', 'type': 'sra', 'class': <class 'galaxy.datatypes.binary.Sra'>}, {'ext': 'pdf', 'type': 'pdf', 'class': <class 'galaxy.datatypes.images.Pdf'>}]
unsniffable_binary_formats = ['ab1', 'compressed_archive', 'asn1-binary', 'h5', 'scf']
class galaxy.datatypes.binary.CompressedArchive(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing an compressed binary file This class can be sublass’ed to implement archive filetypes that will not be unpacked by upload.py.

compressed = True
display_peek(dataset)[source]
file_ext = 'compressed_archive'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
class galaxy.datatypes.binary.GeminiSQLite(**kwd)[source]

Bases: galaxy.datatypes.binary.SQlite

Class describing a Gemini Sqlite database

display_peek(dataset)[source]
file_ext = 'gemini.sqlite'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', tables (ListParameter): Database Tables, defaults to '[]', table_columns (DictParameter): Database Table Columns, defaults to '{}', table_row_count (DictParameter): Database Table Row Count, defaults to '{}', gemini_version (MetadataParameter): Gemini Version, defaults to '0.10.0'
set_meta(dataset, overwrite=True, **kwd)[source]
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
class galaxy.datatypes.binary.GenericAsn1Binary(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class for generic ASN.1 binary format

file_ext = 'asn1-binary'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
class galaxy.datatypes.binary.H5(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing an HDF5 file

display_peek(dataset)[source]
file_ext = 'h5'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
class galaxy.datatypes.binary.SQlite(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing a Sqlite database

dataproviders = {'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'sqlite': <function sqlite_dataprovider at 0x7f2ab024b578>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'sqlite-dict': <function sqlite_datadictprovider at 0x7f2ab024b848>, 'sqlite-table': <function sqlite_datatableprovider at 0x7f2ab024b6e0>}
display_peek(dataset)[source]
file_ext = 'sqlite'
init_meta(dataset, copy_from=None)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', tables (ListParameter): Database Tables, defaults to '[]', table_columns (DictParameter): Database Table Columns, defaults to '{}', table_row_count (DictParameter): Database Table Row Count, defaults to '{}'
set_meta(dataset, overwrite=True, **kwd)[source]
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
sqlite_datadictprovider(*args, **kwargs)[source]
sqlite_dataprovider(*args, **kwargs)[source]
sqlite_datatableprovider(*args, **kwargs)[source]
class galaxy.datatypes.binary.Scf(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing an scf binary sequence file

display_peek(dataset)[source]
file_ext = 'scf'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
class galaxy.datatypes.binary.Sff(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Standard Flowgram Format (SFF)

display_peek(dataset)[source]
file_ext = 'sff'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
class galaxy.datatypes.binary.Sra(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Sequence Read Archive (SRA) datatype originally from mdshw5/sra-tools-galaxy

display_peek(dataset)[source]
file_ext = 'sra'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]

The first 8 bytes of any NCBI sra file is ‘NCBI.sra’, and the file is binary. For details about the format, see http://www.ncbi.nlm.nih.gov/books/n/helpsra/SRA_Overview_BK/#SRA_Overview_BK.4_SRA_Data_Structure

class galaxy.datatypes.binary.TwoBit(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class describing a TwoBit format nucleotide file

display_peek(dataset)[source]
file_ext = 'twobit'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
class galaxy.datatypes.binary.Xlsx(**kwd)[source]

Bases: galaxy.datatypes.binary.Binary

Class for Excel 2007 (xlsx) files

file_ext = 'xlsx'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename)[source]
checkers Module
galaxy.datatypes.checkers.check_binary(name, file_path=True)[source]
galaxy.datatypes.checkers.check_bz2(file_path)[source]
galaxy.datatypes.checkers.check_gzip(file_path)[source]
galaxy.datatypes.checkers.check_html(file_path, chunk=None)[source]
galaxy.datatypes.checkers.check_image(file_path)[source]
galaxy.datatypes.checkers.check_zip(file_path)[source]
galaxy.datatypes.checkers.is_bz2(file_path)[source]
galaxy.datatypes.checkers.is_gzip(file_path)[source]
chrominfo Module
class galaxy.datatypes.chrominfo.ChromInfo(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

file_ext = 'len'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chrom (ColumnParameter): Chrom column, defaults to '1', length (ColumnParameter): Length column, defaults to '2'
coverage Module

Coverage datatypes

class galaxy.datatypes.coverage.LastzCoverage(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

file_ext = 'coverage'
get_track_resolution(dataset, start, end)[source]
get_track_window(dataset, data, start, end)[source]

Assumes we have a numpy file.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', positionCol (ColumnParameter): Position column, defaults to '2', forwardCol (ColumnParameter): Forward or aggregate read column, defaults to '3', reverseCol (ColumnParameter): Optional reverse read column, defaults to 'None'
data Module
class galaxy.datatypes.data.Data(**kwd)[source]

Bases: object

Base class for all datatypes. Implements basic interfaces as well as class methods for metadata.

>>> class DataTest( Data ):
...     MetadataElement( name="test" )
...
>>> DataTest.metadata_spec.test.name
'test'
>>> DataTest.metadata_spec.test.desc
'test'
>>> type( DataTest.metadata_spec.test.param )
<class 'galaxy.datatypes.metadata.MetadataParameter'>
CHUNKABLE = False
add_composite_file(name, **kwds)[source]
add_display_app(app_id, label, file_function, links_function)[source]

Adds a display app to the datatype. app_id is a unique id label is the primary display label, e.g., display at ‘UCSC’ file_function is a string containing the name of the function that returns a properly formatted display links_function is a string containing the name of the function that returns a list of (link_name,link)

add_display_application(display_application)[source]

New style display applications

after_setting_metadata(dataset)[source]

This function is called on the dataset after metadata is set.

allow_datatype_change = True
as_display_type(dataset, type, **kwd)[source]

Returns modified file contents for a particular display type

base_dataprovider(*args, **kwargs)[source]
before_setting_metadata(dataset)[source]

This function is called on the dataset before metadata is set.

chunk64_dataprovider(*args, **kwargs)[source]
chunk_dataprovider(*args, **kwargs)[source]
clear_display_apps()[source]
composite_files = {}
composite_type = None
convert_dataset(trans, original_dataset, target_type, return_output=False, visible=True, deps=None, set_output_history=True)[source]

This function adds a job to the queue to convert a dataset to another type. Returns a message about success/failure.

copy_safe_peek = True
data_sources = {}
dataprovider(dataset, data_format, **settings)[source]

Base dataprovider factory for all datatypes that returns the proper provider for the given data_format or raises a NoProviderAvailable.

dataproviders = {'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>}
dataset_content_needs_grooming(file_name)[source]

This function is called on an output dataset file after the content is initially generated.

display_data(trans, data, preview=False, filename=None, to_ext=None, size=None, offset=None, **kwd)[source]

Old display method, for transition - though still used by API and test framework. Datatypes should be very careful if overridding this method and this interface between datatypes and Galaxy will likely change.

TOOD: Document alternatives to overridding this method (data providers?).

display_info(dataset)[source]

Returns formatted html of dataset info

display_name(dataset)[source]

Returns formatted html of dataset name

display_peek(dataset)[source]

Create HTML table, used for displaying peek

find_conversion_destination(dataset, accepted_formats, datatypes_registry, **kwd)[source]

Returns ( target_ext, existing converted dataset )

generate_auto_primary_file(dataset=None)[source]
get_composite_files(dataset=None)[source]
get_converter_types(original_dataset, datatypes_registry)[source]

Returns available converters by type for this dataset

get_display_application(key, default=None)[source]
get_display_applications_by_dataset(dataset, trans)[source]
get_display_label(type)[source]

Returns primary label for display app

Returns a list of tuples of (name, link) for a particular display type. No check on ‘access’ permissions is done here - if you can view the dataset, you can also save it or send it to a destination outside of Galaxy, so Galaxy security restrictions do not apply anyway.

get_display_types()[source]

Returns display types available

get_max_optional_metadata_filesize()[source]
get_mime()[source]

Returns the mime type of the datatype

get_raw_data(dataset)[source]

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

get_visualizations(dataset)[source]

Returns a list of visualizations for datatype.

groom_dataset_content(file_name)[source]

This function is called on an output dataset file if dataset_content_needs_grooming returns True.

has_dataprovider(data_format)[source]

Returns True if data_format is available in dataproviders.

has_resolution
init_meta(dataset, copy_from=None)[source]
is_binary = True
matches_any(target_datatypes)[source]

Check if this datatype is of any of the target_datatypes or is a subtype thereof.

max_optional_metadata_filesize
static merge(split_files, output_file)[source]

Merge files with copy.copyfileobj() will not hit the max argument limitation of cat. gz and bz2 files are also working.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'

dictionary of metadata fields for this datatype:

missing_meta(dataset, check=[], skip=[])[source]

Checks for empty metadata values, Returns True if non-optional metadata is missing Specifying a list of ‘check’ values will only check those names provided; when used, optionality is ignored Specifying a list of ‘skip’ items will return True even when a named metadata value is missing

primary_file_name = 'index'
remove_display_app(app_id)[source]

Removes a display app from the datatype

repair_methods(dataset)[source]

Unimplemented method, returns dict with method/option for repairing errors

set_max_optional_metadata_filesize(max_value)[source]
set_meta(dataset, overwrite=True, **kwd)[source]

Unimplemented method, allows guessing of metadata from contents of file

set_peek(dataset, is_multi_byte=False)[source]

Set the peek and blurb text

set_raw_data(dataset, data)[source]

Saves the data on the disc

supported_display_apps = {}
track_type = None
validate(dataset)[source]

Unimplemented validate, return no exceptions

writable_files
write_from_stream(dataset, stream)[source]

Writes data from a stream

class galaxy.datatypes.data.DataMeta(name, bases, dict_)[source]

Bases: type

Metaclass for Data class. Sets up metadata spec.

class galaxy.datatypes.data.GenericAsn1(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class for generic ASN.1 text format

file_ext = 'asn1'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
class galaxy.datatypes.data.LineCount(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Dataset contains a single line with a single integer that denotes the line count for a related dataset. Used for custom builds.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
class galaxy.datatypes.data.Newick(**kwd)[source]

Bases: galaxy.datatypes.data.Text

New Hampshire/Newick Format

file_ext = 'nhx'
get_visualizations(dataset)[source]

Returns a list of visualizations for datatype.

init_meta(dataset, copy_from=None)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]

Returning false as the newick format is too general and cannot be sniffed.

class galaxy.datatypes.data.Nexus(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Nexus format as used By Paup, Mr Bayes, etc

file_ext = 'nex'
get_visualizations(dataset)[source]

Returns a list of visualizations for datatype.

init_meta(dataset, copy_from=None)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]

All Nexus Files Simply puts a ‘#NEXUS’ in its first line

class galaxy.datatypes.data.Text(**kwd)[source]

Bases: galaxy.datatypes.data.Data

count_data_lines(dataset)[source]

Count the number of lines of data in dataset, skipping all blank lines and comments.

dataproviders = {'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'line': <function line_dataprovider at 0x7f2ab067a848>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>}
estimate_file_lines(dataset)[source]

Perform a rough estimate by extrapolating number of lines from a small read.

file_ext = 'txt'
get_mime()[source]

Returns the mime type of the datatype

line_class = 'line'

Add metadata elements

line_dataprovider(*args, **kwargs)[source]

Returns an iterator over the dataset’s lines (that have been `strip`ed) optionally excluding blank lines and lines that start with a comment character.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
regex_line_dataprovider(*args, **kwargs)[source]

Returns an iterator over the dataset’s lines optionally including/excluding lines that match one or more regex filters.

set_meta(dataset, **kwd)[source]

Set the number of lines of data in dataset.

set_peek(dataset, line_count=None, is_multi_byte=False, WIDTH=256, skipchars=[])[source]

Set the peek. This method is used by various subclasses of Text.

set_raw_data(dataset, data)[source]

Saves the data on the disc

classmethod split(input_datasets, subdir_generator_function, split_params)[source]

Split the input files by line.

write_from_stream(dataset, stream)[source]

Writes data from a stream

galaxy.datatypes.data.get_file_peek(file_name, is_multi_byte=False, WIDTH=256, LINE_COUNT=5, skipchars=[])[source]

Returns the first LINE_COUNT lines wrapped to WIDTH

## >>> fname = get_test_fname(‘4.bed’) ## >>> get_file_peek(fname) ## ‘chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 +

galaxy.datatypes.data.get_test_fname(fname)[source]

Returns test data filename

genetics Module

rgenetics datatypes Use at your peril Ross Lazarus for the rgenetics and galaxy projects

genome graphs datatypes derived from Interval datatypes genome graphs datasets have a header row with appropriate columnames The first column is always the marker - eg columname = rs, first row= rs12345 if the rows are snps subsequent row values are all numeric ! Will fail if any non numeric (eg ‘+’ or ‘NA’) values ross lazarus for rgenetics august 20 2007

class galaxy.datatypes.genetics.Affybatch(**kwd)[source]

Bases: galaxy.datatypes.genetics.RexpBase

derived class for BioC data structures in Galaxy

file_ext = 'affybatch'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_names (MetadataParameter): Column names, defaults to '[]', pheCols (MetadataParameter): Select list for potentially interesting variables, defaults to '[]', base_name (MetadataParameter): base name for all transformed versions of this expression dataset, defaults to 'rexpression', pheno_path (MetadataParameter): Path to phenotype data for this experiment, defaults to 'rexpression.pheno'
class galaxy.datatypes.genetics.Eigenstratgeno(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

Eigenstrat format - may be able to get rid of this if we move to shellfish Rgenetics data collections

file_ext = 'eigenstratgeno'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.Eigenstratpca(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

Eigenstrat PCA file for case control adjustment Rgenetics data collections

file_ext = 'eigenstratpca'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.Eset(**kwd)[source]

Bases: galaxy.datatypes.genetics.RexpBase

derived class for BioC data structures in Galaxy

file_ext = 'eset'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_names (MetadataParameter): Column names, defaults to '[]', pheCols (MetadataParameter): Select list for potentially interesting variables, defaults to '[]', base_name (MetadataParameter): base name for all transformed versions of this expression dataset, defaults to 'rexpression', pheno_path (MetadataParameter): Path to phenotype data for this experiment, defaults to 'rexpression.pheno'
class galaxy.datatypes.genetics.Fped(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

FBAT pedigree format - single file, map is header row of rs numbers. Strange. Rgenetics data collections

file_ext = 'fped'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.Fphe(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

fbat pedigree file - mad format with ! as first char on header row Rgenetics data collections

file_ext = 'fphe'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.GenomeGraphs(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

Tab delimited data containing a marker id and any number of numeric values

as_ucsc_display_file(dataset, **kwd)[source]

Returns file

file_ext = 'gg'
get_mime()[source]

Returns the mime type of the datatype

make_html_table(dataset, skipchars=[])[source]

Create HTML table, used for displaying peek

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (MetadataParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', markerCol (ColumnParameter): Marker ID column, defaults to '1'
set_meta(dataset, **kwd)[source]
sniff(filename)[source]

Determines whether the file is in gg format

from the ever-helpful angie hinrichs angie@soe.ucsc.edu a genome graphs call looks like this

http://genome.ucsc.edu/cgi-bin/hgGenome?clade=mammal&org=Human&db=hg18&hgGenome_dataSetName=dname &hgGenome_dataSetDescription=test&hgGenome_formatType=best%20guess&hgGenome_markerType=best%20guess &hgGenome_columnLabels=best%20guess&hgGenome_maxVal=&hgGenome_labelVals= &hgGenome_maxGapToFill=25000000&hgGenome_uploadFile=http://galaxy.esphealth.org/datasets/333/display/index &hgGenome_doSubmitUpload=submit

Galaxy gives this for an interval file

http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg18&position=chr1:1-1000&hgt.customText= http%3A%2F%2Fgalaxy.esphealth.org%2Fdisplay_as%3Fid%3D339%26display_app%3Ducsc

validate(dataset)[source]

Validate a gg file - all numeric after header row

class galaxy.datatypes.genetics.Lped(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

linkage pedigree (ped,map) Rgenetics data collections

file_ext = 'lped'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.MAlist(**kwd)[source]

Bases: galaxy.datatypes.genetics.RexpBase

derived class for BioC data structures in Galaxy

file_ext = 'malist'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_names (MetadataParameter): Column names, defaults to '[]', pheCols (MetadataParameter): Select list for potentially interesting variables, defaults to '[]', base_name (MetadataParameter): base name for all transformed versions of this expression dataset, defaults to 'rexpression', pheno_path (MetadataParameter): Path to phenotype data for this experiment, defaults to 'rexpression.pheno'
class galaxy.datatypes.genetics.Pbed(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

Plink Binary compressed 2bit/geno Rgenetics data collections

file_ext = 'pbed'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.Phe(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

Phenotype file

file_ext = 'phe'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.Pheno(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

base class for pheno files

file_ext = 'pheno'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
class galaxy.datatypes.genetics.Pphe(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

Plink phenotype file - header must have FID IID... Rgenetics data collections

file_ext = 'pphe'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.RexpBase(**kwd)[source]

Bases: galaxy.datatypes.images.Html

base class for BioC data structures in Galaxy must be constructed with the pheno data in place since that goes into the metadata for each instance

allow_datatype_change = False
composite_type = 'auto_primary_file'
display_peek(dataset)[source]

Returns formatted html of peek

file_ext = 'rexpbase'
generate_primary_file(dataset=None)[source]

This is called only at upload to write the html file cannot rename the datasets here - they come with the default unfortunately

get_file_peek(filename)[source]

can’t really peek at a filename - need the extra_files_path and such?

get_mime()[source]

Returns the mime type of the datatype

get_peek(dataset)[source]

expects a .pheno file in the extra_files_dir - ugh

get_phecols(phenolist=[], maxConc=20)[source]

sept 2009: cannot use whitespace to split - make a more complex structure here and adjust the methods that rely on this structure return interesting phenotype column names for an rexpression eset or affybatch to use in array subsetting and so on. Returns a data structure for a dynamic Galaxy select parameter. A column with only 1 value doesn’t change, so is not interesting for analysis. A column with a different value in every row is equivalent to a unique identifier so is also not interesting for anova or limma analysis - both these are removed after the concordance (count of unique terms) is constructed for each column. Then a complication - each remaining pair of columns is tested for redundancy - if two columns are always paired, then only one is needed :)

get_pheno(dataset)[source]

expects a .pheno file in the extra_files_dir - ugh note that R is wierd and adds the row.name in the header so the columns are all wrong - unless you tell it not to. A file can be written as write.table(file=’foo.pheno’,pData(foo),sep=’ ‘,quote=F,row.names=F)

html_table = None
init_meta(dataset, copy_from=None)[source]
is_binary = True
make_html_table(pp='nothing supplied from peek\n')[source]

Create HTML table, used for displaying peek

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_names (MetadataParameter): Column names, defaults to '[]', pheCols (MetadataParameter): Select list for potentially interesting variables, defaults to '[]', base_name (MetadataParameter): base name for all transformed versions of this expression dataset, defaults to 'rexpression', pheno_path (MetadataParameter): Path to phenotype data for this experiment, defaults to 'rexpression.pheno'
regenerate_primary_file(dataset)[source]

cannot do this until we are setting metadata

set_meta(dataset, **kwd)[source]

NOTE we apply the tabular machinary to the phenodata extracted from a BioC eSet or affybatch.

set_peek(dataset, **kwd)[source]

expects a .pheno file in the extra_files_dir - ugh note that R is weird and does not include the row.name in the header. why?

class galaxy.datatypes.genetics.Rgenetics(**kwd)[source]

Bases: galaxy.datatypes.images.Html

base class to use for rgenetics datatypes derived from html - composite datatype elements stored in extra files path

allow_datatype_change = False
composite_type = 'auto_primary_file'
file_ext = 'rgenetics'
generate_primary_file(dataset=None)[source]
get_mime()[source]

Returns the mime type of the datatype

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
regenerate_primary_file(dataset)[source]

cannot do this until we are setting metadata

set_meta(dataset, **kwd)[source]

for lped/pbed eg

class galaxy.datatypes.genetics.SNPMatrix(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

BioC SNPMatrix Rgenetics data collections

file_ext = 'snpmatrix'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
set_peek(dataset, **kwd)[source]
sniff(filename)[source]

need to check the file header hex code

class galaxy.datatypes.genetics.Snptest(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

BioC snptest Rgenetics data collections

file_ext = 'snptest'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.ldIndep(**kwd)[source]

Bases: galaxy.datatypes.genetics.Rgenetics

LD (a good measure of redundancy of information) depleted Plink Binary compressed 2bit/geno This is really a plink binary, but some tools work better with less redundancy so are constrained to these files

file_ext = 'ldreduced'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for all transformed versions of this genetic dataset, defaults to 'RgeneticsData'
class galaxy.datatypes.genetics.rgFeatureList(**kwd)[source]

Bases: galaxy.datatypes.genetics.rgTabList

for featureid lists of exclusions or inclusions in the clean tool output from QC eg low maf, high missingness, bad hwe in controls, excess mendel errors,... featureid subsets on statistical criteria -> specialized display such as gg same infrastructure for expression?

file_ext = 'rgFList'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
class galaxy.datatypes.genetics.rgSampleList(**kwd)[source]

Bases: galaxy.datatypes.genetics.rgTabList

for sampleid exclusions or inclusions in the clean tool output from QC eg excess het, gender error, ibd pair member,eigen outlier,excess mendel errors,... since they can be uploaded, should be flexible but they are persistent at least same infrastructure for expression?

file_ext = 'rgSList'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
sniff(filename)[source]
class galaxy.datatypes.genetics.rgTabList(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

for sampleid and for featureid lists of exclusions or inclusions in the clean tool featureid subsets on statistical criteria -> specialized display such as gg

display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'rgTList'
get_mime()[source]

Returns the mime type of the datatype

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
images Module

Image classes

class galaxy.datatypes.images.Bmp(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'bmp'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in bmp format.

class galaxy.datatypes.images.Eps(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'eps'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in eps format.

class galaxy.datatypes.images.Gif(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'gif'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in gif format.

class galaxy.datatypes.images.Gmaj(**kwd)[source]

Bases: galaxy.datatypes.data.Data

Class describing a GMAJ Applet

copy_safe_peek = False
display_peek(dataset)[source]
file_ext = 'gmaj.zip'
get_mime()[source]

Returns the mime type of the datatype

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]

NOTE: the sniff.convert_newlines() call in the upload utility will keep Gmaj data types from being correctly sniffed, but the files can be uploaded (they’ll be sniffed as ‘txt’). This sniff function is here to provide an example of a sniffer for a zip file.

class galaxy.datatypes.images.Html(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing an html file

file_ext = 'html'
get_mime()[source]

Returns the mime type of the datatype

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]

Determines whether the file is in html format

>>> fname = get_test_fname( 'complete.bed' )
>>> Html().sniff( fname )
False
>>> fname = get_test_fname( 'file.html' )
>>> Html().sniff( fname )
True
class galaxy.datatypes.images.Im(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'im'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in im format.

class galaxy.datatypes.images.Image(**kwd)[source]

Bases: galaxy.datatypes.data.Data

Class describing an image

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
class galaxy.datatypes.images.Jpg(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'jpg'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in jpg format.

class galaxy.datatypes.images.Laj(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing a LAJ Applet

copy_safe_peek = False
display_peek(dataset)[source]
file_ext = 'laj'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]
class galaxy.datatypes.images.Pbm(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'pbm'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in PBM format

class galaxy.datatypes.images.Pcd(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'pcd'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in pcd format.

class galaxy.datatypes.images.Pcx(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'pcx'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in pcx format.

class galaxy.datatypes.images.Pdf(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'pdf'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename)[source]

Determine if the file is in pdf format.

class galaxy.datatypes.images.Pgm(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'pgm'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in PGM format

class galaxy.datatypes.images.Png(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'png'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in png format.

class galaxy.datatypes.images.Ppm(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'ppm'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in ppm format.

class galaxy.datatypes.images.Psd(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'psd'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in psd format.

class galaxy.datatypes.images.Rast(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'rast'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in rast format

class galaxy.datatypes.images.Rgb(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'rgb'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in RGB format.

class galaxy.datatypes.images.Tiff(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'tiff'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in tiff format.

class galaxy.datatypes.images.Xbm(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'xbm'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in XBM format.

class galaxy.datatypes.images.Xpm(**kwd)[source]

Bases: galaxy.datatypes.images.Image

file_ext = 'xpm'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
sniff(filename, image=None)[source]

Determine if the file is in XPM format.

galaxy.datatypes.images.create_applet_tag_peek(class_name, archive, params)[source]
interval Module

Interval datatypes

class galaxy.datatypes.interval.Bed(**kwd)[source]

Bases: galaxy.datatypes.interval.Interval

Tab delimited data in BED format

as_ucsc_display_file(dataset, **kwd)[source]

Returns file contents with only the bed data. If bed 6+, treat as interval.

data_sources = {'index': 'bigwig', 'data': 'tabix', 'feature_search': 'fli'}
file_ext = 'bed'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', startCol (ColumnParameter): Start column, defaults to '2', endCol (ColumnParameter): End column, defaults to '3', strandCol (ColumnParameter): Strand column (click box & select), defaults to 'None', nameCol (ColumnParameter): Name/Identifier column (click box & select), defaults to 'None', viz_filter_cols (ColumnParameter): Score column for visualization, defaults to '[4]'
set_meta(dataset, overwrite=True, **kwd)[source]

Sets the metadata information for datasets previously determined to be in bed format.

sniff(filename)[source]

Checks for ‘bedness’

BED lines have three required fields and nine additional optional fields. The number of fields per line must be consistent throughout any single set of data in an annotation track. The order of the optional fields is binding: lower-numbered fields must always be populated if higher-numbered fields are used. The data type of all 12 columns is: 1-str, 2-int, 3-int, 4-str, 5-int, 6-str, 7-int, 8-int, 9-int or list, 10-int, 11-list, 12-list

For complete details see http://genome.ucsc.edu/FAQ/FAQformat#format1

>>> fname = get_test_fname( 'test_tab.bed' )
>>> Bed().sniff( fname )
True
>>> fname = get_test_fname( 'interval1.bed' )
>>> Bed().sniff( fname )
True
>>> fname = get_test_fname( 'complete.bed' )
>>> Bed().sniff( fname )
True
track_type = 'FeatureTrack'

Add metadata elements

class galaxy.datatypes.interval.Bed12(**kwd)[source]

Bases: galaxy.datatypes.interval.BedStrict

Tab delimited data in strict BED format - no non-standard columns allowed; column count forced to 12

file_ext = 'bed12'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (MetadataParameter): Chrom column, defaults to '1', startCol (MetadataParameter): Start column, defaults to '2', endCol (MetadataParameter): End column, defaults to '3', strandCol (MetadataParameter): Strand column (click box & select), defaults to 'None', nameCol (MetadataParameter): Name/Identifier column (click box & select), defaults to 'None', viz_filter_cols (ColumnParameter): Score column for visualization, defaults to '[4]'
class galaxy.datatypes.interval.Bed6(**kwd)[source]

Bases: galaxy.datatypes.interval.BedStrict

Tab delimited data in strict BED format - no non-standard columns allowed; column count forced to 6

file_ext = 'bed6'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (MetadataParameter): Chrom column, defaults to '1', startCol (MetadataParameter): Start column, defaults to '2', endCol (MetadataParameter): End column, defaults to '3', strandCol (MetadataParameter): Strand column (click box & select), defaults to 'None', nameCol (MetadataParameter): Name/Identifier column (click box & select), defaults to 'None', viz_filter_cols (ColumnParameter): Score column for visualization, defaults to '[4]'
class galaxy.datatypes.interval.BedGraph(**kwd)[source]

Bases: galaxy.datatypes.interval.Interval

Tab delimited chrom/start/end/datavalue dataset

as_ucsc_display_file(dataset, **kwd)[source]

Returns file contents as is with no modifications. TODO: this is a functional stub and will need to be enhanced moving forward to provide additional support for bedgraph.

data_sources = {'index': 'bigwig', 'data': 'bigwig'}
file_ext = 'bedgraph'
get_estimated_display_viewport(dataset, chrom_col=0, start_col=1, end_col=2)[source]

Set viewport based on dataset’s first 100 lines.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', startCol (ColumnParameter): Start column, defaults to '2', endCol (ColumnParameter): End column, defaults to '3', strandCol (ColumnParameter): Strand column (click box & select), defaults to 'None', nameCol (ColumnParameter): Name/Identifier column (click box & select), defaults to 'None'
track_type = 'LineTrack'
class galaxy.datatypes.interval.BedStrict(**kwd)[source]

Bases: galaxy.datatypes.interval.Bed

Tab delimited data in strict BED format - no non-standard columns allowed

allow_datatype_change = False
file_ext = 'bedstrict'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (MetadataParameter): Chrom column, defaults to '1', startCol (MetadataParameter): Start column, defaults to '2', endCol (MetadataParameter): End column, defaults to '3', strandCol (MetadataParameter): Strand column (click box & select), defaults to 'None', nameCol (MetadataParameter): Name/Identifier column (click box & select), defaults to 'None', viz_filter_cols (ColumnParameter): Score column for visualization, defaults to '[4]'
set_meta(dataset, overwrite=True, **kwd)[source]
sniff(filename)[source]
class galaxy.datatypes.interval.ChromatinInteractions(**kwd)[source]

Bases: galaxy.datatypes.interval.Interval

Chromatin interactions obtained from 3C/5C/Hi-C experiments.

column_names = ['Chrom1', 'Start1', 'End1', 'Chrom2', 'Start2', 'End2', 'Value']

Add metadata elements

data_sources = {'index': 'bigwig', 'data': 'tabix'}
file_ext = 'chrint'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '7', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', startCol (ColumnParameter): Start column, defaults to '2', endCol (ColumnParameter): End column, defaults to '3', strandCol (ColumnParameter): Strand column (click box & select), defaults to 'None', nameCol (ColumnParameter): Name/Identifier column (click box & select), defaults to 'None', chrom1Col (ColumnParameter): Chrom1 column, defaults to '1', start1Col (ColumnParameter): Start1 column, defaults to '2', end1Col (ColumnParameter): End1 column, defaults to '3', chrom2Col (ColumnParameter): Chrom2 column, defaults to '4', start2Col (ColumnParameter): Start2 column, defaults to '5', end2Col (ColumnParameter): End2 column, defaults to '6', valueCol (ColumnParameter): Value column, defaults to '7'
sniff(filename)[source]
track_type = 'DiagonalHeatmapTrack'
class galaxy.datatypes.interval.CustomTrack(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

UCSC CustomTrack

display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'customtrack'
get_estimated_display_viewport(dataset, chrom_col=None, start_col=None, end_col=None)[source]

Return a chrom, start, stop tuple for viewing a file.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
set_meta(dataset, overwrite=True, **kwd)[source]
sniff(filename)[source]

Determines whether the file is in customtrack format.

CustomTrack files are built within Galaxy and are basically bed or interval files with the first line looking something like this.

track name=”User Track” description=”User Supplied Track (from Galaxy)” color=0,0,0 visibility=1

>>> fname = get_test_fname( 'complete.bed' )
>>> CustomTrack().sniff( fname )
False
>>> fname = get_test_fname( 'ucsc.customtrack' )
>>> CustomTrack().sniff( fname )
True
class galaxy.datatypes.interval.ENCODEPeak(**kwd)[source]

Bases: galaxy.datatypes.interval.Interval

Human ENCODE peak format. There are both broad and narrow peak formats. Formats are very similar; narrow peak has an additional column, though.

Broad peak ( http://genome.ucsc.edu/FAQ/FAQformat#format13 ): This format is used to provide called regions of signal enrichment based on pooled, normalized (interpreted) data. It is a BED 6+3 format.

Narrow peak http://genome.ucsc.edu/FAQ/FAQformat#format12 and : This format is used to provide called peaks of signal enrichment based on pooled, normalized (interpreted) data. It is a BED6+4 format.

column_names = ['Chrom', 'Start', 'End', 'Name', 'Score', 'Strand', 'SignalValue', 'pValue', 'qValue', 'Peak']
data_sources = {'index': 'bigwig', 'data': 'tabix'}

Add metadata elements

file_ext = 'encodepeak'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', startCol (ColumnParameter): Start column, defaults to '2', endCol (ColumnParameter): End column, defaults to '3', strandCol (ColumnParameter): Strand column (click box & select), defaults to 'None', nameCol (ColumnParameter): Name/Identifier column (click box & select), defaults to 'None'
sniff(filename)[source]
class galaxy.datatypes.interval.Gff(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular, galaxy.datatypes.interval._RemoteCallMixin

Tab delimited data in Gff format

column_names = ['Seqname', 'Source', 'Feature', 'Start', 'End', 'Score', 'Strand', 'Frame', 'Group']
data_sources = {'index': 'bigwig', 'data': 'interval_index', 'feature_search': 'fli'}
dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0235a28>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'genomic-region-dict': <function genomic_region_dict_dataprovider at 0x7f2ab01fc2a8>, 'column': <function column_dataprovider at 0x7f2ab02358c0>, 'interval-dict': <function interval_dict_dataprovider at 0x7f2ab01fc578>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'interval': <function interval_dataprovider at 0x7f2ab01fc410>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'genomic-region': <function genomic_region_dataprovider at 0x7f2ab01fc140>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab0235b90>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0235cf8>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'gff'
genomic_region_dataprovider(*args, **kwargs)[source]
genomic_region_dict_dataprovider(*args, **kwargs)[source]
get_estimated_display_viewport(dataset)[source]

Return a chrom, start, stop tuple for viewing a file. There are slight differences between gff 2 and gff 3 formats. This function should correctly handle both...

interval_dataprovider(*args, **kwargs)[source]
interval_dict_dataprovider(*args, **kwargs)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '9', column_types (ColumnTypesParameter): Column types, defaults to '['str', 'str', 'str', 'int', 'int', 'int', 'str', 'str', 'str']', column_names (MetadataParameter): Column names, defaults to '[]', attributes (MetadataParameter): Number of attributes, defaults to '0', attribute_types (DictParameter): Attribute types, defaults to '{}'
set_attribute_metadata(dataset)[source]

Sets metadata elements for dataset’s attributes.

set_meta(dataset, overwrite=True, **kwd)[source]
sniff(filename)[source]

Determines whether the file is in gff format

GFF lines have nine required fields that must be tab-separated.

For complete details see http://genome.ucsc.edu/FAQ/FAQformat#format3

>>> fname = get_test_fname( 'gff_version_3.gff' )
>>> Gff().sniff( fname )
False
>>> fname = get_test_fname( 'test.gff' )
>>> Gff().sniff( fname )
True
track_type = 'FeatureTrack'

Add metadata elements

class galaxy.datatypes.interval.Gff3(**kwd)[source]

Bases: galaxy.datatypes.interval.Gff

Tab delimited data in Gff3 format

column_names = ['Seqid', 'Source', 'Type', 'Start', 'End', 'Score', 'Strand', 'Phase', 'Attributes']
file_ext = 'gff3'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '9', column_types (ColumnTypesParameter): Column types, defaults to '['str', 'str', 'str', 'int', 'int', 'float', 'str', 'int', 'list']', column_names (MetadataParameter): Column names, defaults to '[]', attributes (MetadataParameter): Number of attributes, defaults to '0', attribute_types (DictParameter): Attribute types, defaults to '{}'
set_meta(dataset, overwrite=True, **kwd)[source]
sniff(filename)[source]

Determines whether the file is in gff version 3 format

GFF 3 format:

  1. adds a mechanism for representing more than one level of hierarchical grouping of features and subfeatures.
  2. separates the ideas of group membership and feature name/id
  3. constrains the feature type field to be taken from a controlled vocabulary.
  4. allows a single feature, such as an exon, to belong to more than one group at a time.
  5. provides an explicit convention for pairwise alignments
  6. provides an explicit convention for features that occupy disjunct regions

The format consists of 9 columns, separated by tabs (NOT spaces).

Undefined fields are replaced with the ”.” character, as described in the original GFF spec.

For complete details see http://song.sourceforge.net/gff3.shtml

>>> fname = get_test_fname( 'test.gff' )
>>> Gff3().sniff( fname )
False
>>> fname = get_test_fname('gff_version_3.gff')
>>> Gff3().sniff( fname )
True
track_type = 'FeatureTrack'

Add metadata elements

valid_gff3_phase = ['.', '0', '1', '2']
valid_gff3_strand = ['+', '-', '.', '?']
class galaxy.datatypes.interval.Gtf(**kwd)[source]

Bases: galaxy.datatypes.interval.Gff

Tab delimited data in Gtf format

column_names = ['Seqname', 'Source', 'Feature', 'Start', 'End', 'Score', 'Strand', 'Frame', 'Attributes']
file_ext = 'gtf'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '9', column_types (ColumnTypesParameter): Column types, defaults to '['str', 'str', 'str', 'int', 'int', 'float', 'str', 'int', 'list']', column_names (MetadataParameter): Column names, defaults to '[]', attributes (MetadataParameter): Number of attributes, defaults to '0', attribute_types (DictParameter): Attribute types, defaults to '{}'
sniff(filename)[source]

Determines whether the file is in gtf format

GTF lines have nine required fields that must be tab-separated. The first eight GTF fields are the same as GFF. The group field has been expanded into a list of attributes. Each attribute consists of a type/value pair. Attributes must end in a semi-colon, and be separated from any following attribute by exactly one space. The attribute list must begin with the two mandatory attributes:

gene_id value - A globally unique identifier for the genomic source of the sequence. transcript_id value - A globally unique identifier for the predicted transcript.

For complete details see http://genome.ucsc.edu/FAQ/FAQformat#format4

>>> fname = get_test_fname( '1.bed' )
>>> Gtf().sniff( fname )
False
>>> fname = get_test_fname( 'test.gff' )
>>> Gtf().sniff( fname )
False
>>> fname = get_test_fname( 'test.gtf' )
>>> Gtf().sniff( fname )
True
track_type = 'FeatureTrack'

Add metadata elements

class galaxy.datatypes.interval.Interval(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

Tab delimited data containing interval information

as_ucsc_display_file(dataset, **kwd)[source]

Returns file contents with only the bed data

data_sources = {'index': 'bigwig', 'data': 'tabix'}

Add metadata elements

dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0235a28>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'genomic-region-dict': <function genomic_region_dict_dataprovider at 0x7f2ab01f1410>, 'column': <function column_dataprovider at 0x7f2ab02358c0>, 'interval-dict': <function interval_dict_dataprovider at 0x7f2ab01f16e0>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'interval': <function interval_dataprovider at 0x7f2ab01f1578>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'genomic-region': <function genomic_region_dataprovider at 0x7f2ab01f12a8>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab0235b90>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0235cf8>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
display_peek(dataset)[source]

Returns formated html of peek

displayable(dataset)[source]
file_ext = 'interval'
genomic_region_dataprovider(*args, **kwargs)[source]
genomic_region_dict_dataprovider(*args, **kwargs)[source]
get_estimated_display_viewport(dataset, chrom_col=None, start_col=None, end_col=None)[source]

Return a chrom, start, stop tuple for viewing a file.

get_track_resolution(dataset, start, end)[source]
get_track_window(dataset, data, start, end)[source]

Assumes the incoming track data is sorted already.

init_meta(dataset, copy_from=None)[source]
interval_dataprovider(*args, **kwargs)[source]
interval_dict_dataprovider(*args, **kwargs)[source]
line_class = 'region'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', startCol (ColumnParameter): Start column, defaults to '2', endCol (ColumnParameter): End column, defaults to '3', strandCol (ColumnParameter): Strand column (click box & select), defaults to 'None', nameCol (ColumnParameter): Name/Identifier column (click box & select), defaults to 'None'
repair_methods(dataset)[source]

Return options for removing errors along with a description

set_meta(dataset, overwrite=True, first_line_is_header=False, **kwd)[source]

Tries to guess from the line the location number of the column for the chromosome, region start-end and strand

sniff(filename)[source]

Checks for ‘intervalness’

This format is mostly used by galaxy itself. Valid interval files should include a valid header comment, but this seems to be loosely regulated.

>>> fname = get_test_fname( 'test_space.txt' )
>>> Interval().sniff( fname )
False
>>> fname = get_test_fname( 'interval.interval' )
>>> Interval().sniff( fname )
True
track_type = 'FeatureTrack'

Generate links to UCSC genome browser sites based on the dbkey and content of dataset.

validate(dataset)[source]

Validate an interval file using the bx GenomicIntervalReader

class galaxy.datatypes.interval.Wiggle(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular, galaxy.datatypes.interval._RemoteCallMixin

Tab delimited data in wiggle format

data_sources = {'index': 'bigwig', 'data': 'bigwig'}
dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0235a28>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'wiggle-dict': <function wiggle_dict_dataprovider at 0x7f2ab01fce60>, 'column': <function column_dataprovider at 0x7f2ab02358c0>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'wiggle': <function wiggle_dataprovider at 0x7f2ab01fccf8>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab0235b90>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0235cf8>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'wig'
get_estimated_display_viewport(dataset)[source]

Return a chrom, start, stop tuple for viewing a file.

get_track_resolution(dataset, start, end)[source]
get_track_window(dataset, data, start, end)[source]

Assumes we have a numpy file.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '3', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
set_meta(dataset, overwrite=True, **kwd)[source]
sniff(filename)[source]

Determines wether the file is in wiggle format

The .wig format is line-oriented. Wiggle data is preceeded by a track definition line, which adds a number of options for controlling the default display of this track. Following the track definition line is the track data, which can be entered in several different formats.

The track definition line begins with the word ‘track’ followed by the track type. The track type with version is REQUIRED, and it currently must be wiggle_0. For example, track type=wiggle_0...

For complete details see http://genome.ucsc.edu/goldenPath/help/wiggle.html

>>> fname = get_test_fname( 'interval1.bed' )
>>> Wiggle().sniff( fname )
False
>>> fname = get_test_fname( 'wiggle.wig' )
>>> Wiggle().sniff( fname )
True
track_type = 'LineTrack'
wiggle_dataprovider(*args, **kwargs)[source]
wiggle_dict_dataprovider(*args, **kwargs)[source]
metadata Module

Galaxy Metadata

class galaxy.datatypes.metadata.ColumnParameter(spec)[source]

Bases: galaxy.datatypes.metadata.RangeParameter

get_html(value, context=None, other_values=None, values=None, **kwd)[source]
get_html_field(value=None, context=None, other_values=None, values=None, **kwd)[source]
class galaxy.datatypes.metadata.ColumnTypesParameter(spec)[source]

Bases: galaxy.datatypes.metadata.MetadataParameter

to_string(value)[source]
class galaxy.datatypes.metadata.DBKeyParameter(spec)[source]

Bases: galaxy.datatypes.metadata.SelectParameter

get_html(value=None, context=None, other_values=None, values=None, **kwd)[source]
get_html_field(value=None, context=None, other_values=None, values=None, **kwd)[source]
class galaxy.datatypes.metadata.DictParameter(spec)[source]

Bases: galaxy.datatypes.metadata.MetadataParameter

to_safe_string(value)[source]
to_string(value)[source]
class galaxy.datatypes.metadata.FileParameter(spec)[source]

Bases: galaxy.datatypes.metadata.MetadataParameter

from_external_value(value, parent, path_rewriter=None)[source]

Turns a value read from a external dict into its value to be pushed directly into the metadata dict.

get_html(value=None, context=None, other_values=None, **kwd)[source]
get_html_field(value=None, context=None, other_values=None, **kwd)[source]
make_copy(value, target_context, source_context)[source]
classmethod marshal(value)[source]
new_file(dataset=None, **kwds)[source]
to_external_value(value)[source]

Turns a value read from a metadata into its value to be pushed directly into the external dict.

to_safe_string(value)[source]
to_string(value)[source]
wrap(value, session)[source]
class galaxy.datatypes.metadata.JobExternalOutputMetadataWrapper(job)[source]

Bases: object

Class with methods allowing set_meta() to be called externally to the Galaxy head. This class allows access to external metadata filenames for all outputs associated with a job. We will use JSON as the medium of exchange of information, except for the DatasetInstance object which will use pickle (in the future this could be JSONified as well)

cleanup_external_metadata(sa_session)[source]
external_metadata_set_successfully(dataset, sa_session)[source]
get_dataset_metadata_key(dataset)[source]
get_output_filenames_by_dataset(dataset, sa_session)[source]
invalidate_external_metadata(datasets, sa_session)[source]
set_job_runner_external_pid(pid, sa_session)[source]
setup_external_metadata(datasets, sa_session, exec_dir=None, tmp_dir=None, dataset_files_path=None, output_fnames=None, config_root=None, config_file=None, datatypes_config=None, job_metadata=None, compute_tmp_dir=None, include_command=True, kwds=None)[source]
class galaxy.datatypes.metadata.ListParameter(spec)[source]

Bases: galaxy.datatypes.metadata.MetadataParameter

to_string(value)[source]
class galaxy.datatypes.metadata.MetadataCollection(parent)[source]

Bases: object

MetadataCollection is not a collection at all, but rather a proxy to the real metadata which is stored as a Dictionary. This class handles processing the metadata elements when they are set and retrieved, returning default values in cases when metadata is not set.

element_is_set(name)[source]
from_JSON_dict(filename=None, path_rewriter=None, json_dict=None)[source]
get(key, default=None)[source]
get_html_by_name(name, **kwd)[source]
get_parent()[source]
items()[source]
make_dict_copy(to_copy)[source]

Makes a deep copy of input iterable to_copy according to self.spec

parent
set_parent(parent)[source]
spec
to_JSON_dict(filename=None)[source]
galaxy.datatypes.metadata.MetadataElement = <galaxy.datatypes.metadata.Statement object>

MetadataParameter sub-classes.

class galaxy.datatypes.metadata.MetadataElementSpec(datatype, name=None, desc=None, param=<class 'galaxy.datatypes.metadata.MetadataParameter'>, default=None, no_value=None, visible=True, set_in_upload=False, **kwargs)[source]

Bases: object

Defines a metadata element and adds it to the metadata_spec (which is a MetadataSpecCollection) of datatype.

get(name, default=None)[source]
unwrap(value)[source]

Turns an incoming value into its storable form.

wrap(value, session)[source]

Turns a stored value into its usable form.

class galaxy.datatypes.metadata.MetadataParameter(spec)[source]

Bases: object

from_external_value(value, parent)[source]

Turns a value read from an external dict into its value to be pushed directly into the metadata dict.

get_html(value, context=None, other_values=None, **kwd)[source]

The “context” is simply the metadata collection/bunch holding this piece of metadata. This is passed in to allow for metadata to validate against each other (note: this could turn into a huge, recursive mess if not done with care). For example, a column assignment should validate against the number of columns in the dataset.

get_html_field(value=None, context=None, other_values=None, **kwd)[source]
make_copy(value, target_context=None, source_context=None)[source]
classmethod marshal(value)[source]

This method should/can be overridden to convert the incoming value to whatever type it is supposed to be.

to_external_value(value)[source]

Turns a value read from a metadata into its value to be pushed directly into the external dict.

to_safe_string(value)[source]
to_string(value)[source]
unwrap(form_value)[source]

Turns a value into its storable form.

validate(value)[source]

Throw an exception if the value is invalid.

wrap(value, session)[source]

Turns a value into its usable form.

class galaxy.datatypes.metadata.MetadataSpecCollection(dict=None)[source]

Bases: galaxy.util.odict.odict

A simple extension of dict which allows cleaner access to items and allows the values to be iterated over directly as if it were a list. append() is also implemented for simplicity and does not “append”.

append(item)[source]
iter()[source]
class galaxy.datatypes.metadata.MetadataTempFile(**kwds)[source]

Bases: object

classmethod cleanup_from_JSON_dict_filename(filename)[source]
file_name
classmethod from_JSON(json_dict)[source]
classmethod is_JSONified_value(value)[source]
tmp_dir = 'database/tmp'
to_JSON()[source]
class galaxy.datatypes.metadata.PythonObjectParameter(spec)[source]

Bases: galaxy.datatypes.metadata.MetadataParameter

get_html(value=None, context=None, other_values=None, **kwd)[source]
get_html_field(value=None, context=None, other_values=None, **kwd)[source]
classmethod marshal(value)[source]
to_string(value)[source]
class galaxy.datatypes.metadata.RangeParameter(spec)[source]

Bases: galaxy.datatypes.metadata.SelectParameter

get_html(value, context=None, other_values=None, values=None, **kwd)[source]
get_html_field(value=None, context=None, other_values=None, values=None, **kwd)[source]
classmethod marshal(value)[source]
class galaxy.datatypes.metadata.SelectParameter(spec)[source]

Bases: galaxy.datatypes.metadata.MetadataParameter

get_html(value, context=None, other_values=None, values=None, **kwd)[source]
get_html_field(value=None, context=None, other_values=None, values=None, **kwd)[source]
classmethod marshal(value)[source]
to_string(value)[source]
wrap(value, session)[source]
class galaxy.datatypes.metadata.Statement(target)[source]

Bases: object

This class inserts its target into a list in the surrounding class. the data.Data class has a metaclass which executes these statements. This is how we shove the metadata element spec into the class.

classmethod process(element)[source]
ngsindex Module

NGS indexes

class galaxy.datatypes.ngsindex.BowtieBaseIndex(**kwd)[source]

Bases: galaxy.datatypes.ngsindex.BowtieIndex

Bowtie base space index

file_ext = 'bowtie_base_index'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for this index set, defaults to 'galaxy_generated_bowtie_index', sequence_space (MetadataParameter): sequence_space for this index set, defaults to 'base'
class galaxy.datatypes.ngsindex.BowtieColorIndex(**kwd)[source]

Bases: galaxy.datatypes.ngsindex.BowtieIndex

Bowtie color space index

file_ext = 'bowtie_color_index'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for this index set, defaults to 'galaxy_generated_bowtie_index', sequence_space (MetadataParameter): sequence_space for this index set, defaults to 'color'
class galaxy.datatypes.ngsindex.BowtieIndex(**kwd)[source]

Bases: galaxy.datatypes.images.Html

base class for BowtieIndex is subclassed by BowtieColorIndex and BowtieBaseIndex

allow_datatype_change = False
composite_type = 'auto_primary_file'
display_peek(dataset)[source]
file_ext = 'bowtie_index'
generate_primary_file(dataset=None)[source]

This is called only at upload to write the html file cannot rename the datasets here - they come with the default unfortunately

is_binary = True
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', base_name (MetadataParameter): base name for this index set, defaults to 'galaxy_generated_bowtie_index', sequence_space (MetadataParameter): sequence_space for this index set, defaults to 'unknown'
regenerate_primary_file(dataset)[source]

cannot do this until we are setting metadata

set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
qualityscore Module

Qualityscore class

class galaxy.datatypes.qualityscore.QualityScore(**kwd)[source]

Bases: galaxy.datatypes.data.Text

until we know more about quality score formats

file_ext = 'qual'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
class galaxy.datatypes.qualityscore.QualityScore454(**kwd)[source]

Bases: galaxy.datatypes.qualityscore.QualityScore

until we know more about quality score formats

file_ext = 'qual454'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]
>>> fname = get_test_fname( 'sequence.fasta' )
>>> QualityScore454().sniff( fname )
False
>>> fname = get_test_fname( 'sequence.qual454' )
>>> QualityScore454().sniff( fname )
True
class galaxy.datatypes.qualityscore.QualityScoreIllumina(**kwd)[source]

Bases: galaxy.datatypes.qualityscore.QualityScore

until we know more about quality score formats

file_ext = 'qualillumina'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
class galaxy.datatypes.qualityscore.QualityScoreSOLiD(**kwd)[source]

Bases: galaxy.datatypes.qualityscore.QualityScore

until we know more about quality score formats

file_ext = 'qualsolid'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_meta(dataset, **kwd)[source]
sniff(filename)[source]
>>> fname = get_test_fname( 'sequence.fasta' )
>>> QualityScoreSOLiD().sniff( fname )
False
>>> fname = get_test_fname( 'sequence.qualsolid' )
>>> QualityScoreSOLiD().sniff( fname )
True
class galaxy.datatypes.qualityscore.QualityScoreSolexa(**kwd)[source]

Bases: galaxy.datatypes.qualityscore.QualityScore

until we know more about quality score formats

file_ext = 'qualsolexa'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
registry Module

Provides mapping between extensions and datatypes, mime-types, etc.

exception galaxy.datatypes.registry.ConfigurationError[source]

Bases: exceptions.Exception

class galaxy.datatypes.registry.Registry[source]

Bases: object

change_datatype(data, ext)[source]
find_conversion_destination_for_dataset_by_extensions(dataset, accepted_formats, converter_safe=True)[source]

Returns ( target_ext, existing converted dataset )

get_available_tracks()[source]
get_composite_extensions()[source]
get_converter_by_target_type(source_ext, target_ext)[source]

Returns a converter based on source and target datatypes

get_converters_by_datatype(ext)[source]

Returns available converters by source type

get_datatype_by_extension(ext)[source]

Returns a datatype based on an extension

get_datatype_class_by_name(name)[source]

Return the datatype class where the datatype’s type attribute (as defined in the datatype_conf.xml file) contains name.

get_display_sites(site_type)[source]
get_legacy_sites_by_build(site_type, build)[source]
get_mimetype_by_extension(ext, default='application/octet-stream')[source]

Returns a mimetype based on an extension

get_upload_metadata_params(context, group, tool)[source]

Returns dict of case value:inputs for metadata conditional for upload tool

integrated_datatypes_configs
load_build_sites(root)[source]
load_datatype_converters(toolbox, installed_repository_dict=None, deactivate=False)[source]

If deactivate is False, add datatype converters from self.converters or self.proprietary_converters to the calling app’s toolbox. If deactivate is True, eliminates relevant converters from the calling app’s toolbox.

load_datatype_sniffers(root, deactivate=False, handling_proprietary_datatypes=False, override=False)[source]

Process the sniffers element from a parsed a datatypes XML file located at root_dir/config (if processing the Galaxy distributed config) or contained within an installed Tool Shed repository. If deactivate is True, an installed Tool Shed repository that includes custom sniffers is being deactivated or uninstalled, so appropriate loaded sniffers will be removed from the registry. The value of override will be False when a Tool Shed repository is being installed. Since installation is occurring after the datatypes registry has been initialized at server startup, its contents cannot be overridden by newly introduced conflicting sniffers.

load_datatypes(root_dir=None, config=None, deactivate=False, override=True)[source]

Parse a datatypes XML file located at root_dir/config (if processing the Galaxy distributed config) or contained within an installed Tool Shed repository. If deactivate is True, an installed Tool Shed repository that includes custom datatypes is being deactivated or uninstalled, so appropriate loaded datatypes will be removed from the registry. The value of override will be False when a Tool Shed repository is being installed. Since installation is occurring after the datatypes registry has been initialized at server startup, its contents cannot be overridden by newly introduced conflicting data types.

load_display_applications(app, installed_repository_dict=None, deactivate=False)[source]

If deactivate is False, add display applications from self.display_app_containers or self.proprietary_display_app_containers to appropriate datatypes. If deactivate is True, eliminates relevant display applications from appropriate datatypes.

load_external_metadata_tool(toolbox)[source]

Adds a tool which is used to set external metadata

reload_display_applications(display_application_ids=None)[source]

Reloads display applications: by id, or all if no ids provided Returns tuple( [reloaded_ids], [failed_ids] )

set_default_values()[source]
to_xml_file()[source]
sequence Module

Sequence classes

class galaxy.datatypes.sequence.Alignment(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing an alignment

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', species (SelectParameter): Species, defaults to '[]'
split(input_datasets, subdir_generator_function, split_params)[source]

Split a generic alignment file (not sensible or possible, see subclasses).

class galaxy.datatypes.sequence.Axt(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing an axt alignment

file_ext = 'axt'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]

Determines whether the file is in axt format

axt alignment files are produced from Blastz, an alignment tool available from Webb Miller’s lab at Penn State University.

Each alignment block in an axt file contains three lines: a summary line and 2 sequence lines. Blocks are separated from one another by blank lines.

The summary line contains chromosomal position and size information about the alignment. It consists of 9 required fields.

The sequence lines contain the sequence of the primary assembly (line 2) and aligning assembly (line 3) with inserts. Repeats are indicated by lower-case letters.

For complete details see http://genome.ucsc.edu/goldenPath/help/axt.html

>>> fname = get_test_fname( 'alignment.axt' )
>>> Axt().sniff( fname )
True
>>> fname = get_test_fname( 'alignment.lav' )
>>> Axt().sniff( fname )
False
class galaxy.datatypes.sequence.Fasta(**kwd)[source]

Bases: galaxy.datatypes.sequence.Sequence

Class representing a FASTA sequence

file_ext = 'fasta'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
sniff(filename)[source]

Determines whether the file is in fasta format

A sequence in FASTA format consists of a single-line description, followed by lines of sequence data. The first character of the description line is a greater-than (“>”) symbol in the first column. All lines should be shorter than 80 characters

For complete details see http://www.ncbi.nlm.nih.gov/blast/fasta.shtml

Rules for sniffing as True:

We don’t care about line length (other than empty lines).

The first non-empty line must start with ‘>’ and the Very Next line.strip() must have sequence data and not be a header.

‘sequence data’ here is loosely defined as non-empty lines which do not start with ‘>’

This will cause Color Space FASTA (csfasta) to be detected as True (they are, after all, still FASTA files - they have a header line followed by sequence data)

Previously this method did some checking to determine if the sequence data had integers (presumably to differentiate between fasta and csfasta)

This should be done through sniff order, where csfasta (currently has a null sniff function) is detected for first (stricter definition) followed sometime after by fasta

We will only check that the first purported sequence is correctly formatted.

>>> fname = get_test_fname( 'sequence.maf' )
>>> Fasta().sniff( fname )
False
>>> fname = get_test_fname( 'sequence.fasta' )
>>> Fasta().sniff( fname )
True
classmethod split(input_datasets, subdir_generator_function, split_params)[source]

Split a FASTA file sequence by sequence.

Note that even if split_mode=”number_of_parts”, the actual number of sub-files produced may not match that requested by split_size.

If split_mode=”to_size” then split_size is treated as the number of FASTA records to put in each sub-file (not size in bytes).

class galaxy.datatypes.sequence.Fastq(**kwd)[source]

Bases: galaxy.datatypes.sequence.Sequence

Class representing a generic FASTQ sequence

file_ext = 'fastq'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
static process_split_file(data)[source]

This is called in the context of an external process launched by a Task (possibly not on the Galaxy machine) to create the input files for the Task. The parameters: data - a dict containing the contents of the split file

set_meta(dataset, **kwd)[source]

Set the number of sequences and the number of data lines in dataset. FIXME: This does not properly handle line wrapping

sniff(filename)[source]

Determines whether the file is in generic fastq format For details, see http://maq.sourceforge.net/fastq.shtml

Note: There are three kinds of FASTQ files, known as “Sanger” (sometimes called “Standard”), Solexa, and Illumina
These differ in the representation of the quality scores
>>> fname = get_test_fname( '1.fastqsanger' )
>>> Fastq().sniff( fname )
True
>>> fname = get_test_fname( '2.fastqsanger' )
>>> Fastq().sniff( fname )
True
classmethod split(input_datasets, subdir_generator_function, split_params)[source]

FASTQ files are split on cluster boundaries, in increments of 4 lines

class galaxy.datatypes.sequence.FastqCSSanger(**kwd)[source]

Bases: galaxy.datatypes.sequence.Fastq

Class representing a Color Space FASTQ sequence ( e.g a SOLiD variant )

file_ext = 'fastqcssanger'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
class galaxy.datatypes.sequence.FastqIllumina(**kwd)[source]

Bases: galaxy.datatypes.sequence.Fastq

Class representing a FASTQ sequence ( the Illumina 1.3+ variant )

file_ext = 'fastqillumina'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
class galaxy.datatypes.sequence.FastqSanger(**kwd)[source]

Bases: galaxy.datatypes.sequence.Fastq

Class representing a FASTQ sequence ( the Sanger variant )

file_ext = 'fastqsanger'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
class galaxy.datatypes.sequence.FastqSolexa(**kwd)[source]

Bases: galaxy.datatypes.sequence.Fastq

Class representing a FASTQ sequence ( the Solexa variant )

file_ext = 'fastqsolexa'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
class galaxy.datatypes.sequence.Lav(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing a LAV alignment

file_ext = 'lav'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
sniff(filename)[source]

Determines whether the file is in lav format

LAV is an alignment format developed by Webb Miller’s group. It is the primary output format for BLASTZ. The first line of a .lav file begins with #:lav.

For complete details see http://www.bioperl.org/wiki/LAV_alignment_format

>>> fname = get_test_fname( 'alignment.lav' )
>>> Lav().sniff( fname )
True
>>> fname = get_test_fname( 'alignment.axt' )
>>> Lav().sniff( fname )
False
class galaxy.datatypes.sequence.Maf(**kwd)[source]

Bases: galaxy.datatypes.sequence.Alignment

Class describing a Maf alignment

display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'maf'
init_meta(dataset, copy_from=None)[source]
make_html_table(dataset, skipchars=[])[source]

Create HTML table, used for displaying peek

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', species (SelectParameter): Species, defaults to '[]', blocks (MetadataParameter): Number of blocks, defaults to '0', species_chromosomes (FileParameter): Species Chromosomes, defaults to 'None', maf_index (FileParameter): MAF Index File, defaults to 'None'
set_meta(dataset, overwrite=True, **kwd)[source]

Parses and sets species, chromosomes, index from MAF file.

set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]

Determines wether the file is in maf format

The .maf format is line-oriented. Each multiple alignment ends with a blank line. Each sequence in an alignment is on a single line, which can get quite long, but there is no length limit. Words in a line are delimited by any white space. Lines starting with # are considered to be comments. Lines starting with ## can be ignored by most programs, but contain meta-data of one form or another.

The first line of a .maf file begins with ##maf. This word is followed by white-space-separated variable=value pairs. There should be no white space surrounding the “=”.

For complete details see http://genome.ucsc.edu/FAQ/FAQformat#format5

>>> fname = get_test_fname( 'sequence.maf' )
>>> Maf().sniff( fname )
True
>>> fname = get_test_fname( 'sequence.fasta' )
>>> Maf().sniff( fname )
False
class galaxy.datatypes.sequence.MafCustomTrack(**kwd)[source]

Bases: galaxy.datatypes.data.Text

file_ext = 'mafcustomtrack'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', vp_chromosome (MetadataParameter): Viewport Chromosome, defaults to 'chr1', vp_start (MetadataParameter): Viewport Start, defaults to '1', vp_end (MetadataParameter): Viewport End, defaults to '100'
set_meta(dataset, overwrite=True, **kwd)[source]

Parses and sets viewport metadata from MAF file.

class galaxy.datatypes.sequence.RNADotPlotMatrix(**kwd)[source]

Bases: galaxy.datatypes.data.Data

file_ext = 'rna_eps'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]

Determine if the file is in RNA dot plot format.

class galaxy.datatypes.sequence.Sequence(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class describing a sequence

classmethod do_fast_split(input_datasets, toc_file_datasets, subdir_generator_function, split_params)[source]
classmethod do_slow_split(input_datasets, subdir_generator_function, split_params)[source]
static get_sequences_per_file(total_sequences, split_params)[source]
static get_split_commands_sequential(is_compressed, input_name, output_name, start_sequence, sequence_count)[source]

Does a brain-dead sequential scan & extract of certain sequences >>> Sequence.get_split_commands_sequential(True, ‘./input.gz’, ‘./output.gz’, start_sequence=0, sequence_count=10) [‘zcat ”./input.gz” | ( tail -n +1 2> /dev/null) | head -40 | gzip -c > ”./output.gz”’] >>> Sequence.get_split_commands_sequential(False, ‘./input.fastq’, ‘./output.fastq’, start_sequence=10, sequence_count=10) [‘tail -n +41 ”./input.fastq” 2> /dev/null | head -40 > ”./output.fastq”’]

static get_split_commands_with_toc(input_name, output_name, toc_file, start_sequence, sequence_count)[source]

Uses a Table of Contents dict, parsed from an FQTOC file, to come up with a set of shell commands that will extract the parts necessary >>> three_sections=[dict(start=0, end=74, sequences=10), dict(start=74, end=148, sequences=10), dict(start=148, end=148+76, sequences=10)] >>> Sequence.get_split_commands_with_toc(‘./input.gz’, ‘./output.gz’, dict(sections=three_sections), start_sequence=0, sequence_count=10) [‘dd bs=1 skip=0 count=74 if=./input.gz 2> /dev/null >> ./output.gz’] >>> Sequence.get_split_commands_with_toc(‘./input.gz’, ‘./output.gz’, dict(sections=three_sections), start_sequence=1, sequence_count=5) [‘(dd bs=1 skip=0 count=74 if=./input.gz 2> /dev/null )| zcat | ( tail -n +5 2> /dev/null) | head -20 | gzip -c >> ./output.gz’] >>> Sequence.get_split_commands_with_toc(‘./input.gz’, ‘./output.gz’, dict(sections=three_sections), start_sequence=0, sequence_count=20) [‘dd bs=1 skip=0 count=148 if=./input.gz 2> /dev/null >> ./output.gz’] >>> Sequence.get_split_commands_with_toc(‘./input.gz’, ‘./output.gz’, dict(sections=three_sections), start_sequence=5, sequence_count=10) [‘(dd bs=1 skip=0 count=74 if=./input.gz 2> /dev/null )| zcat | ( tail -n +21 2> /dev/null) | head -20 | gzip -c >> ./output.gz’, ‘(dd bs=1 skip=74 count=74 if=./input.gz 2> /dev/null )| zcat | ( tail -n +1 2> /dev/null) | head -20 | gzip -c >> ./output.gz’] >>> Sequence.get_split_commands_with_toc(‘./input.gz’, ‘./output.gz’, dict(sections=three_sections), start_sequence=10, sequence_count=10) [‘dd bs=1 skip=74 count=74 if=./input.gz 2> /dev/null >> ./output.gz’] >>> Sequence.get_split_commands_with_toc(‘./input.gz’, ‘./output.gz’, dict(sections=three_sections), start_sequence=5, sequence_count=20) [‘(dd bs=1 skip=0 count=74 if=./input.gz 2> /dev/null )| zcat | ( tail -n +21 2> /dev/null) | head -20 | gzip -c >> ./output.gz’, ‘dd bs=1 skip=74 count=74 if=./input.gz 2> /dev/null >> ./output.gz’, ‘(dd bs=1 skip=148 count=76 if=./input.gz 2> /dev/null )| zcat | ( tail -n +1 2> /dev/null) | head -20 | gzip -c >> ./output.gz’]

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
set_meta(dataset, **kwd)[source]

Set the number of sequences and the number of data lines in dataset.

set_peek(dataset, is_multi_byte=False)[source]
split(input_datasets, subdir_generator_function, split_params)[source]

Split a generic sequence file (not sensible or possible, see subclasses).

classmethod write_split_files(input_datasets, toc_file_datasets, subdir_generator_function, sequences_per_file)[source]
class galaxy.datatypes.sequence.SequenceSplitLocations(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Class storing information about a sequence file composed of multiple gzip files concatenated as one OR an uncompressed file. In the GZIP case, each sub-file’s location is stored in start and end.

The format of the file is JSON:

{ "sections" : [
        { "start" : "x", "end" : "y", "sequences" : "z" },
        ...
]}
file_ext = 'fqtoc'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]
class galaxy.datatypes.sequence.csFasta(**kwd)[source]

Bases: galaxy.datatypes.sequence.Sequence

Class representing the SOLID Color-Space sequence ( csfasta )

file_ext = 'csfasta'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', sequences (MetadataParameter): Number of sequences, defaults to '0'
set_meta(dataset, **kwd)[source]
sniff(filename)[source]
Color-space sequence:
>2_15_85_F3 T213021013012303002332212012112221222112212222
>>> fname = get_test_fname( 'sequence.fasta' )
>>> csFasta().sniff( fname )
False
>>> fname = get_test_fname( 'sequence.csfasta' )
>>> csFasta().sniff( fname )
True
sniff Module

File format detector

exception galaxy.datatypes.sniff.InappropriateDatasetContentError[source]

Bases: exceptions.Exception

galaxy.datatypes.sniff.check_newlines(fname, bytes_to_read=52428800)[source]

Determines if there are any non-POSIX newlines in the first number_of_bytes (by default, 50MB) of the file.

galaxy.datatypes.sniff.convert_newlines(fname, in_place=True, tmp_dir=None, tmp_prefix=None)[source]

Converts in place a file from universal line endings to Posix line endings.

>>> fname = get_test_fname('temp.txt')
>>> file(fname, 'wt').write("1 2\r3 4")
>>> convert_newlines(fname, tmp_prefix="gxtest", tmp_dir=tempfile.gettempdir())
(2, None)
>>> file(fname).read()
'1 2\n3 4\n'
galaxy.datatypes.sniff.convert_newlines_sep2tabs(fname, in_place=True, patt='\\s+', tmp_dir=None, tmp_prefix=None)[source]

Combines above methods: convert_newlines() and sep2tabs() so that files do not need to be read twice

>>> fname = get_test_fname('temp.txt')
>>> file(fname, 'wt').write("1 2\r3 4")
>>> convert_newlines_sep2tabs(fname, tmp_prefix="gxtest", tmp_dir=tempfile.gettempdir())
(2, None)
>>> file(fname).read()
'1\t2\n3\t4\n'
galaxy.datatypes.sniff.get_headers(fname, sep, count=60, is_multi_byte=False)[source]

Returns a list with the first ‘count’ lines split by ‘sep’

>>> fname = get_test_fname('complete.bed')
>>> get_headers(fname,'\t')
[['chr7', '127475281', '127491632', 'NM_000230', '0', '+', '127486022', '127488767', '0', '3', '29,172,3225,', '0,10713,13126,'], ['chr7', '127486011', '127488900', 'D49487', '0', '+', '127486022', '127488767', '0', '2', '155,490,', '0,2399']]
galaxy.datatypes.sniff.get_test_fname(fname)[source]

Returns test data filename

galaxy.datatypes.sniff.guess_ext(fname, sniff_order=None, is_multi_byte=False)[source]

Returns an extension that can be used in the datatype factory to generate a data for the ‘fname’ file

>>> fname = get_test_fname('megablast_xml_parser_test1.blastxml')
>>> guess_ext(fname)
'xml'
>>> fname = get_test_fname('interval.interval')
>>> guess_ext(fname)
'interval'
>>> fname = get_test_fname('interval1.bed')
>>> guess_ext(fname)
'bed'
>>> fname = get_test_fname('test_tab.bed')
>>> guess_ext(fname)
'bed'
>>> fname = get_test_fname('sequence.maf')
>>> guess_ext(fname)
'maf'
>>> fname = get_test_fname('sequence.fasta')
>>> guess_ext(fname)
'fasta'
>>> fname = get_test_fname('file.html')
>>> guess_ext(fname)
'html'
>>> fname = get_test_fname('test.gtf')
>>> guess_ext(fname)
'gtf'
>>> fname = get_test_fname('test.gff')
>>> guess_ext(fname)
'gff'
>>> fname = get_test_fname('gff_version_3.gff')
>>> guess_ext(fname)
'gff3'
>>> fname = get_test_fname('temp.txt')
>>> file(fname, 'wt').write("a\t2\nc\t1\nd\t0")
>>> guess_ext(fname)
'tabular'
>>> fname = get_test_fname('temp.txt')
>>> file(fname, 'wt').write("a 1 2 x\nb 3 4 y\nc 5 6 z")
>>> guess_ext(fname)
'txt'
>>> fname = get_test_fname('test_tab1.tabular')
>>> guess_ext(fname)
'tabular'
>>> fname = get_test_fname('alignment.lav')
>>> guess_ext(fname)
'lav'
>>> fname = get_test_fname('1.sff')
>>> guess_ext(fname)
'sff'
>>> fname = get_test_fname('1.bam')
>>> guess_ext(fname)
'bam'
>>> fname = get_test_fname('3unsorted.bam')
>>> guess_ext(fname)
'bam'
galaxy.datatypes.sniff.handle_compressed_file(filename, datatypes_registry, ext='auto')[source]
galaxy.datatypes.sniff.handle_uploaded_dataset_file(filename, datatypes_registry, ext='auto', is_multi_byte=False)[source]
galaxy.datatypes.sniff.is_column_based(fname, sep='\t', skip=0, is_multi_byte=False)[source]

Checks whether the file is column based with respect to a separator (defaults to tab separator).

>>> fname = get_test_fname('test.gff')
>>> is_column_based(fname)
True
>>> fname = get_test_fname('test_tab.bed')
>>> is_column_based(fname)
True
>>> is_column_based(fname, sep=' ')
False
>>> fname = get_test_fname('test_space.txt')
>>> is_column_based(fname)
False
>>> is_column_based(fname, sep=' ')
True
>>> fname = get_test_fname('test_ensembl.tab')
>>> is_column_based(fname)
True
>>> fname = get_test_fname('test_tab1.tabular')
>>> is_column_based(fname, sep=' ', skip=0)
False
>>> fname = get_test_fname('test_tab1.tabular')
>>> is_column_based(fname)
True
galaxy.datatypes.sniff.sep2tabs(fname, in_place=True, patt='\\s+')[source]

Transforms in place a ‘sep’ separated file to a tab separated one

>>> fname = get_test_fname('temp.txt')
>>> file(fname, 'wt').write("1 2\n3 4\n")
>>> sep2tabs(fname)
(2, None)
>>> file(fname).read()
'1\t2\n3\t4\n'
galaxy.datatypes.sniff.stream_to_file(stream, suffix='', prefix='', dir=None, text=False, **kwd)[source]

Writes a stream to a temporary file, returns the temporary file’s name

galaxy.datatypes.sniff.stream_to_open_named_file(stream, fd, filename, source_encoding=None, source_error='strict', target_encoding=None, target_error='strict')[source]

Writes a stream to the provided file descriptor, returns the file’s name and bool( is_multi_byte ). Closes file descriptor

tabular Module

Tabular datatype

class galaxy.datatypes.tabular.Eland(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

Support for the export.txt.gz file used by Illumina’s ELANDv2e aligner

file_ext = '_export.txt.gz'
make_html_table(dataset, skipchars=None)[source]

Create HTML table, used for displaying peek

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comments, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', tiles (ListParameter): Set of tiles, defaults to '[]', reads (ListParameter): Set of reads, defaults to '[]', lanes (ListParameter): Set of lanes, defaults to '[]', barcodes (ListParameter): Set of barcodes, defaults to '[]'
set_meta(dataset, overwrite=True, skip=None, max_data_lines=5, **kwd)[source]
sniff(filename)[source]

Determines whether the file is in ELAND export format

A file in ELAND export format consists of lines of tab-separated data. There is no header.

Rules for sniffing as True:

- There must be 22 columns on each line
- LANE, TILEm X, Y, INDEX, READ_NO, SEQ, QUAL, POSITION, *STRAND, FILT must be correct
- We will only check that up to the first 5 alignments are correctly formatted.
class galaxy.datatypes.tabular.ElandMulti(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

file_ext = 'elandmulti'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
sniff(filename)[source]
class galaxy.datatypes.tabular.FeatureLocationIndex(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

An index that stores feature locations in tabular format.

file_ext = 'fli'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '2', column_types (ColumnTypesParameter): Column types, defaults to '['str', 'str']', column_names (MetadataParameter): Column names, defaults to '[]'
class galaxy.datatypes.tabular.Pileup(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

Tab delimited data in pileup (6- or 10-column) format

data_sources = {'data': 'tabix'}

Add metadata elements

dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0235a28>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'genomic-region-dict': <function genomic_region_dict_dataprovider at 0x7f2ab0257410>, 'column': <function column_dataprovider at 0x7f2ab02358c0>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'genomic-region': <function genomic_region_dataprovider at 0x7f2ab02572a8>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab0235b90>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0235cf8>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'pileup'
genomic_region_dataprovider(*args, **kwargs)[source]
genomic_region_dict_dataprovider(*args, **kwargs)[source]
init_meta(dataset, copy_from=None)[source]
line_class = 'genomic coordinate'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]', chromCol (ColumnParameter): Chrom column, defaults to '1', startCol (ColumnParameter): Start column, defaults to '2', endCol (ColumnParameter): End column, defaults to '2', baseCol (ColumnParameter): Reference base column, defaults to '3'
repair_methods(dataset)[source]

Return options for removing errors along with a description

sniff(filename)[source]

Checks for ‘pileup-ness’

There are two main types of pileup: 6-column and 10-column. For both, the first three and last two columns are the same. We only check the first three to allow for some personalization of the format.

>>> fname = get_test_fname( 'interval.interval' )
>>> Pileup().sniff( fname )
False
>>> fname = get_test_fname( '6col.pileup' )
>>> Pileup().sniff( fname )
True
>>> fname = get_test_fname( '10col.pileup' )
>>> Pileup().sniff( fname )
True
class galaxy.datatypes.tabular.Sam(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

column_dataprovider(*args, **kwargs)[source]
data_sources = {'index': 'bigwig', 'data': 'bam'}
dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0252668>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'id-seq-qual': <function id_seq_qual_dataprovider at 0x7f2ab0252c08>, 'header': <function header_dataprovider at 0x7f2ab0252aa0>, 'column': <function column_dataprovider at 0x7f2ab0252500>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab0252398>, 'genomic-region': <function genomic_region_dataprovider at 0x7f2ab0252d70>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab02527d0>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0252938>, 'line': <function line_dataprovider at 0x7f2ab0252230>, 'genomic-region-dict': <function genomic_region_dict_dataprovider at 0x7f2ab0252ed8>}
dataset_column_dataprovider(*args, **kwargs)[source]
dataset_dict_dataprovider(*args, **kwargs)[source]
dict_dataprovider(*args, **kwargs)[source]
display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'sam'
genomic_region_dataprovider(*args, **kwargs)[source]
genomic_region_dict_dataprovider(*args, **kwargs)[source]
header_dataprovider(*args, **kwargs)[source]
id_seq_qual_dataprovider(*args, **kwargs)[source]
line_dataprovider(*args, **kwargs)[source]
static merge(split_files, output_file)[source]

Multiple SAM files may each have headers. Since the headers should all be the same, remove the headers from files 1-n, keeping them in the first file only

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
regex_line_dataprovider(*args, **kwargs)[source]
set_meta(dataset, overwrite=True, skip=None, max_data_lines=5, **kwd)[source]
sniff(filename)[source]

Determines whether the file is in SAM format

A file in SAM format consists of lines of tab-separated data. The following header line may be the first line:

@QNAME  FLAG    RNAME   POS     MAPQ    CIGAR   MRNM    MPOS    ISIZE   SEQ     QUAL
or
@QNAME  FLAG    RNAME   POS     MAPQ    CIGAR   MRNM    MPOS    ISIZE   SEQ     QUAL    OPT

Data in the OPT column is optional and can consist of tab-separated data

For complete details see http://samtools.sourceforge.net/SAM1.pdf

Rules for sniffing as True:

There must be 11 or more columns of data on each line
Columns 2 (FLAG), 4(POS), 5 (MAPQ), 8 (MPOS), and 9 (ISIZE) must be numbers (9 can be negative)
We will only check that up to the first 5 alignments are correctly formatted.
>>> fname = get_test_fname( 'sequence.maf' )
>>> Sam().sniff( fname )
False
>>> fname = get_test_fname( '1.sam' )
>>> Sam().sniff( fname )
True
track_type = 'ReadTrack'
class galaxy.datatypes.tabular.Tabular(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Tab delimited data

CHUNKABLE = True

Add metadata elements

as_gbrowse_display_file(dataset, **kwd)[source]
as_ucsc_display_file(dataset, **kwd)[source]
column_dataprovider(*args, **kwargs)[source]

Uses column settings that are passed in

dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0235a28>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'column': <function column_dataprovider at 0x7f2ab02358c0>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab0235b90>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0235cf8>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
dataset_column_dataprovider(*args, **kwargs)[source]

Attempts to get column settings from dataset.metadata

dataset_dict_dataprovider(*args, **kwargs)[source]

Attempts to get column settings from dataset.metadata

dict_dataprovider(*args, **kwargs)[source]

Uses column settings that are passed in

display_data(trans, dataset, preview=False, filename=None, to_ext=None, chunk=None, **kwd)[source]
display_peek(dataset)[source]

Returns formatted html of peek

displayable(dataset)[source]
get_chunk(trans, dataset, chunk)[source]
make_html_peek_header(dataset, skipchars=None, column_names=None, column_number_format='%s', column_parameter_alias=None, **kwargs)[source]
make_html_peek_rows(dataset, skipchars=None, **kwargs)[source]
make_html_table(dataset, **kwargs)[source]

Create HTML table, used for displaying peek

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
set_meta(dataset, overwrite=True, skip=None, max_data_lines=100000, max_guess_type_data_lines=None, **kwd)[source]

Tries to determine the number of columns as well as those columns that contain numerical values in the dataset. A skip parameter is used because various tabular data types reuse this function, and their data type classes are responsible to determine how many invalid comment lines should be skipped. Using None for skip will cause skip to be zero, but the first line will be processed as a header. A max_data_lines parameter is used because various tabular data types reuse this function, and their data type classes are responsible to determine how many data lines should be processed to ensure that the non-optional metadata parameters are properly set; if used, optional metadata parameters will be set to None, unless the entire file has already been read. Using None for max_data_lines will process all data lines.

Items of interest:

  1. We treat ‘overwrite’ as always True (we always want to set tabular metadata when called).
  2. If a tabular file has no data, it will have one column of type ‘str’.
  3. We used to check only the first 100 lines when setting metadata and this class’s set_peek() method read the entire file to determine the number of lines in the file. Since metadata can now be processed on cluster nodes, we’ve merged the line count portion of the set_peek() processing here, and we now check the entire contents of the file.
set_peek(dataset, line_count=None, is_multi_byte=False)[source]
class galaxy.datatypes.tabular.Taxonomy(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

display_peek(dataset)[source]

Returns formated html of peek

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '0', column_types (ColumnTypesParameter): Column types, defaults to '[]', column_names (MetadataParameter): Column names, defaults to '[]'
class galaxy.datatypes.tabular.Vcf(**kwd)[source]

Bases: galaxy.datatypes.tabular.Tabular

Variant Call Format for describing SNPs and other simple genome variations.

column_names = ['Chrom', 'Pos', 'ID', 'Ref', 'Alt', 'Qual', 'Filter', 'Info', 'Format', 'data']
data_sources = {'index': 'bigwig', 'data': 'tabix'}
dataproviders = {'dataset-column': <function dataset_column_dataprovider at 0x7f2ab0235a28>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'genomic-region-dict': <function genomic_region_dict_dataprovider at 0x7f2ab0257848>, 'column': <function column_dataprovider at 0x7f2ab02358c0>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'genomic-region': <function genomic_region_dataprovider at 0x7f2ab02576e0>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'dict': <function dict_dataprovider at 0x7f2ab0235b90>, 'dataset-dict': <function dataset_dict_dataprovider at 0x7f2ab0235cf8>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
display_peek(dataset)[source]

Returns formated html of peek

file_ext = 'vcf'
genomic_region_dataprovider(*args, **kwargs)[source]
genomic_region_dict_dataprovider(*args, **kwargs)[source]
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0', comment_lines (MetadataParameter): Number of comment lines, defaults to '0', columns (MetadataParameter): Number of columns, defaults to '10', column_types (ColumnTypesParameter): Column types, defaults to '['str', 'int', 'str', 'str', 'str', 'int', 'str', 'list', 'str', 'str']', column_names (MetadataParameter): Column names, defaults to '[]', viz_filter_cols (ColumnParameter): Score column for visualization, defaults to '[5]', sample_names (MetadataParameter): Sample names, defaults to '[]'
set_meta(dataset, **kwd)[source]
sniff(filename)[source]
track_type = 'VariantTrack'
tracks Module

Datatype classes for tracks/track views within galaxy.

class galaxy.datatypes.tracks.GeneTrack(**kwargs)[source]

Bases: galaxy.datatypes.binary.Binary

file_ext = 'genetrack'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?'
xml Module

XML format classes

class galaxy.datatypes.xml.CisML(**kwd)[source]

Bases: galaxy.datatypes.xml.GenericXml

CisML XML data

file_ext = 'cisml'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]

Set the peek and blurb text

sniff(filename)[source]
class galaxy.datatypes.xml.GenericXml(**kwd)[source]

Bases: galaxy.datatypes.data.Text

Base format class for any XML file.

dataproviders = {'xml': <function xml_dataprovider at 0x7f2ab06f4c80>, 'chunk64': <function chunk64_dataprovider at 0x7f2ab067a2a8>, 'chunk': <function chunk_dataprovider at 0x7f2ab067a140>, 'regex-line': <function regex_line_dataprovider at 0x7f2ab067a9b0>, 'base': <function base_dataprovider at 0x7f2ab0677f50>, 'line': <function line_dataprovider at 0x7f2ab067a848>}
file_ext = 'xml'
static merge(split_files, output_file)[source]

Merging multiple XML files is non-trivial and must be done in subclasses.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]

Set the peek and blurb text

sniff(filename)[source]

Determines whether the file is XML or not

>>> fname = get_test_fname( 'megablast_xml_parser_test1.blastxml' )
>>> GenericXml().sniff( fname )
True
>>> fname = get_test_fname( 'interval.interval' )
>>> GenericXml().sniff( fname )
False
xml_dataprovider(*args, **kwargs)[source]
class galaxy.datatypes.xml.MEMEXml(**kwd)[source]

Bases: galaxy.datatypes.xml.GenericXml

MEME XML Output data

file_ext = 'memexml'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]

Set the peek and blurb text

sniff(filename)[source]
class galaxy.datatypes.xml.Owl(**kwd)[source]

Bases: galaxy.datatypes.xml.GenericXml

Web Ontology Language OWL format description http://www.w3.org/TR/owl-ref/

file_ext = 'owl'
metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]
sniff(filename)[source]

Checking for keyword - ‘<owl’ in the first 200 lines.

class galaxy.datatypes.xml.Phyloxml(**kwd)[source]

Bases: galaxy.datatypes.xml.GenericXml

Format for defining phyloxml data http://www.phyloxml.org/

file_ext = 'phyloxml'
get_visualizations(dataset)[source]

Returns a list of visualizations for datatype.

metadata_spec = dbkey (DBKeyParameter): Database/Build, defaults to '?', data_lines (MetadataParameter): Number of data lines, defaults to '0'
set_peek(dataset, is_multi_byte=False)[source]

Set the peek and blurb text

sniff(filename)[source]

“Checking for keyword - ‘phyloxml’ always in lowercase in the first few lines

Subpackages
converters Package
bed_to_genetrack_converter Module
bed_to_gff_converter Module
bedgraph_to_array_tree_converter Module
bgzip Module

Uses pysam to bgzip a file

usage: %prog in_file out_file

galaxy.datatypes.converters.bgzip.main()[source]
fasta_to_len Module

Input: fasta, int Output: tabular Return titles with lengths of corresponding seq

galaxy.datatypes.converters.fasta_to_len.compute_fasta_length(fasta_file, out_file, keep_first_char, keep_first_word=False)[source]
fasta_to_tabular_converter Module

Input: fasta Output: tabular

fastq_to_fqtoc Module
galaxy.datatypes.converters.fastq_to_fqtoc.main()[source]

The format of the file is JSON:

{ "sections" : [
        { "start" : "x", "end" : "y", "sequences" : "z" },
        ...
]}

This works only for UNCOMPRESSED fastq files. The Python GzipFile does not provide seekable offsets via tell(), so clients just have to split the slow way

fastqsolexa_to_fasta_converter Module

convert fastqsolexa file to separated sequence and quality files.

assume each sequence and quality score are contained in one line the order should be: 1st line: @title_of_seq 2nd line: nucleotides 3rd line: +title_of_qualityscore (might be skipped) 4th line: quality scores (in three forms: a. digits, b. ASCII codes, the first char as the coding base, c. ASCII codes without the first char.)

Usage: %python fastqsolexa_to_fasta_converter.py <your_fastqsolexa_filename> <output_seq_filename> <output_score_filename>

galaxy.datatypes.converters.fastqsolexa_to_fasta_converter.stop_err(msg)[source]
fastqsolexa_to_qual_converter Module

convert fastqsolexa file to separated sequence and quality files.

assume each sequence and quality score are contained in one line the order should be: 1st line: @title_of_seq 2nd line: nucleotides 3rd line: +title_of_qualityscore (might be skipped) 4th line: quality scores (in three forms: a. digits, b. ASCII codes, the first char as the coding base, c. ASCII codes without the first char.)

Usage: %python fastqsolexa_to_qual_converter.py <your_fastqsolexa_filename> <output_seq_filename> <output_score_filename>

galaxy.datatypes.converters.fastqsolexa_to_qual_converter.stop_err(msg)[source]
gff_to_bed_converter Module
gff_to_interval_index_converter Module

Convert from GFF file to interval index file.

usage:
python gff_to_interval_index_converter.py [input] [output]
galaxy.datatypes.converters.gff_to_interval_index_converter.main()[source]
interval_to_bed_converter Module
galaxy.datatypes.converters.interval_to_bed_converter.stop_err(msg)[source]
interval_to_bedstrict_converter Module
galaxy.datatypes.converters.interval_to_bedstrict_converter.force_bed_field_count(fields, region_count, force_num_columns)[source]
galaxy.datatypes.converters.interval_to_bedstrict_converter.stop_err(msg)[source]
interval_to_coverage Module

Converter to generate 3 (or 4) column base-pair coverage from an interval file.

usage: %prog bed_file out_file
-1, –cols1=N,N,N,N: Columns for chrom, start, end, strand in interval file -2, –cols2=N,N,N,N: Columns for chrom, start, end, strand in coverage file
class galaxy.datatypes.converters.interval_to_coverage.CoverageWriter(out_stream=None, chromCol=0, positionCol=1, forwardCol=2, reverseCol=3)[source]

Bases: object

close()[source]
write(**kwargs)[source]
galaxy.datatypes.converters.interval_to_coverage.main(interval, coverage)[source]

Uses a sliding window of partitions to count coverages. Every interval record adds its start and end to the partitions. The result is a list of partitions, or every position that has a (maybe) different number of basepairs covered. We don’t worry about merging because we pop as the sorted intervals are read in. As the input start positions exceed the partition positions in partitions, coverages are kicked out in bulk.

interval_to_fli Module

Creates a feature location index (FLI) for a given BED/GFF file. FLI index has the form:

[line_length]
<symbol1_in_lowercase><tab><symbol1><tab><location>
<symbol2_in_lowercase><tab><symbol2><tab><location>
...

where location is formatted as:

contig:start-end

and symbols are sorted in lexigraphical order.

galaxy.datatypes.converters.interval_to_fli.main()[source]
interval_to_interval_index_converter Module

Convert from interval file to interval index file.

usage: %prog <options> in_file out_file
-c, –chr-col: chromosome column, default=1 -s, –start-col: start column, default=2 -e, –end-col: end column, default=3
galaxy.datatypes.converters.interval_to_interval_index_converter.main()[source]
interval_to_summary_tree_converter Module
interval_to_tabix_converter Module

Uses pysam to index a bgzipped interval file with tabix Supported presets: bed, gff, vcf

usage: %prog in_file out_file

galaxy.datatypes.converters.interval_to_tabix_converter.main()[source]
lped_to_fped_converter Module
galaxy.datatypes.converters.lped_to_fped_converter.main()[source]

call fbater need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path <command interpreter=”python”>rg_convert_lped_fped.py ‘$input1/$input1.metadata.base_name’ ‘$output1’ ‘$output1.extra_files_path’ </command>

galaxy.datatypes.converters.lped_to_fped_converter.rgConv(inpedfilepath, outhtmlname, outfilepath)[source]

convert linkage ped/map to fbat

galaxy.datatypes.converters.lped_to_fped_converter.timenow()[source]

return current time as a string

lped_to_pbed_converter Module
galaxy.datatypes.converters.lped_to_pbed_converter.getMissval(inped='')[source]

read some lines...ugly hack - try to guess missing value should be N or 0 but might be . or -

galaxy.datatypes.converters.lped_to_pbed_converter.main()[source]

need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path <command interpreter=”python”>lped_to_pbed_converter.py ‘$input1/$input1.metadata.base_name’ ‘$output1’ ‘$output1.extra_files_path’ ‘${GALAXY_DATA_INDEX_DIR}/rg/bin/plink’ </command>

galaxy.datatypes.converters.lped_to_pbed_converter.rgConv(inpedfilepath, outhtmlname, outfilepath, plink)[source]
galaxy.datatypes.converters.lped_to_pbed_converter.timenow()[source]

return current time as a string

maf_to_fasta_converter Module
maf_to_interval_converter Module
pbed_ldreduced_converter Module
galaxy.datatypes.converters.pbed_ldreduced_converter.main()[source]

need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path

galaxy.datatypes.converters.pbed_ldreduced_converter.makeLDreduced(basename, infpath=None, outfpath=None, plinke='plink', forcerebuild=False, returnFname=False, winsize='60', winmove='40', r2thresh='0.1')[source]

not there so make and leave in output dir for post job hook to copy back into input extra files path for next time

galaxy.datatypes.converters.pbed_ldreduced_converter.pruneLD(plinktasks=[], cd='./', vclbase=[])[source]
galaxy.datatypes.converters.pbed_ldreduced_converter.timenow()[source]

return current time as a string

pbed_to_lped_converter Module
galaxy.datatypes.converters.pbed_to_lped_converter.main()[source]

need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path <command interpreter=”python”>pbed_to_lped_converter.py ‘$input1/$input1.metadata.base_name’ ‘$output1’ ‘$output1.extra_files_path’ ‘${GALAXY_DATA_INDEX_DIR}/rg/bin/plink’ </command>

galaxy.datatypes.converters.pbed_to_lped_converter.rgConv(inpedfilepath, outhtmlname, outfilepath, plink)[source]
galaxy.datatypes.converters.pbed_to_lped_converter.timenow()[source]

return current time as a string

picard_interval_list_to_bed6_converter Module
sam_or_bam_to_summary_tree_converter Module
sam_to_bam Module

A wrapper script for converting SAM to BAM, with sorting. %prog input_filename.sam output_filename.bam

galaxy.datatypes.converters.sam_to_bam.cleanup_before_exit(tmp_dir)[source]
vcf_to_interval_index_converter Module

Convert from VCF file to interval index file.

galaxy.datatypes.converters.vcf_to_interval_index_converter.main()[source]
vcf_to_summary_tree_converter Module
vcf_to_vcf_bgzip Module

Uses pysam to bgzip a vcf file as-is. Headers, which are important, are kept. Original ordering, which may be specifically needed by tools or external display applications, is also maintained.

usage: %prog in_file out_file

galaxy.datatypes.converters.vcf_to_vcf_bgzip.main()[source]
wiggle_to_array_tree_converter Module
galaxy.datatypes.converters.wiggle_to_array_tree_converter.main()[source]
wiggle_to_simple_converter Module

Read a wiggle track and print out a series of lines containing “chrom position score”. Ignores track lines, handles bed, variableStep and fixedStep wiggle lines.

galaxy.datatypes.converters.wiggle_to_simple_converter.main()[source]
galaxy.datatypes.converters.wiggle_to_simple_converter.stop_err(msg)[source]
display_applications Package
application Module
class galaxy.datatypes.display_applications.application.DisplayApplication(display_id, name, app, version=None, filename=None, elem=None)[source]

Bases: object

add_data_table_watch(table_name, version=None)[source]
filter_by_dataset(data, trans)[source]
classmethod from_elem(elem, app, filename=None)[source]
classmethod from_file(filename, app)[source]
reload()[source]

Bases: object

build_parameter_dict(data, dataset_hash, user_hash, trans, app_kwds)[source]
filter_by_dataset(data, trans)[source]
classmethod from_elem(elem, display_application, other_values=None)[source]
get_display_url(data, trans)[source]
get_inital_values(data, trans)[source]
class galaxy.datatypes.display_applications.application.DynamicDisplayApplicationBuilder(elem, display_application, build_sites)[source]

Bases: object

Bases: object

display_ready()[source]
display_url()[source]
get_param_name_by_url(url)[source]
get_param_value(name)[source]
get_prepare_steps(datasets_only=True)[source]
prepare_display()[source]
preparing_display()[source]
parameters Module
class galaxy.datatypes.display_applications.parameters.DisplayApplicationDataParameter(elem, link)[source]

Bases: galaxy.datatypes.display_applications.parameters.DisplayApplicationParameter

Parameter that returns a file_name containing the requested content

formats
get_value(other_values, dataset_hash, user_hash, trans)[source]
is_preparing(other_values)[source]
prepare(other_values, dataset_hash, user_hash, trans)[source]
ready(other_values)[source]
type = 'data'
class galaxy.datatypes.display_applications.parameters.DisplayApplicationParameter(elem, link)[source]

Bases: object

Abstract Class for Display Application Parameters

build_url(other_values)[source]
classmethod from_elem(elem, link)[source]
get_value(other_values, dataset_hash, user_hash, trans)[source]
is_preparing(other_values)[source]
prepare(other_values, dataset_hash, user_hash, trans)[source]
ready(other_values)[source]
type = None
class galaxy.datatypes.display_applications.parameters.DisplayApplicationTemplateParameter(elem, link)[source]

Bases: galaxy.datatypes.display_applications.parameters.DisplayApplicationParameter

Parameter that returns a string containing the requested content

get_value(other_values, dataset_hash, user_hash, trans)[source]
type = 'template'
class galaxy.datatypes.display_applications.parameters.DisplayDataValueWrapper(value, parameter, other_values, dataset_hash, user_hash, trans)[source]

Bases: galaxy.datatypes.display_applications.parameters.DisplayParameterValueWrapper

ACTION_NAME = 'data'
action_name
mime_type()[source]
qp
class galaxy.datatypes.display_applications.parameters.DisplayParameterValueWrapper(value, parameter, other_values, dataset_hash, user_hash, trans)[source]

Bases: object

ACTION_NAME = 'param'
action_name
mime_type()[source]
qp
url
util Module
galaxy.datatypes.display_applications.util.decode_dataset_user(trans, dataset_hash, user_hash)[source]
galaxy.datatypes.display_applications.util.encode_dataset_user(trans, dataset, user)[source]
util Package
util Package

Utilities for Galaxy datatypes.

gff_util Module

Provides utilities for working with GFF files.

class galaxy.datatypes.util.gff_util.GFFFeature(reader, chrom_col=0, feature_col=2, start_col=3, end_col=4, strand_col=6, score_col=5, default_strand='.', fix_strand=False, intervals=[], raw_size=0)[source]

Bases: galaxy.datatypes.util.gff_util.GFFInterval

A GFF feature, which can include multiple intervals.

copy()[source]
lines()[source]
name()[source]

Returns feature’s name.

class galaxy.datatypes.util.gff_util.GFFInterval(reader, fields, chrom_col=0, feature_col=2, start_col=3, end_col=4, strand_col=6, score_col=5, default_strand='.', fix_strand=False)[source]

Bases: bx.intervals.io.GenomicInterval

A GFF interval, including attributes. If file is strictly a GFF file, only attribute is ‘group.’

copy()[source]
class galaxy.datatypes.util.gff_util.GFFIntervalToBEDReaderWrapper(reader, **kwargs)[source]

Bases: bx.intervals.io.NiceReaderWrapper

Reader wrapper that reads GFF intervals/lines and automatically converts them to BED format.

parse_row(line)[source]
class galaxy.datatypes.util.gff_util.GFFReaderWrapper(reader, chrom_col=0, feature_col=2, start_col=3, end_col=4, strand_col=6, score_col=5, fix_strand=False, convert_to_bed_coord=False, **kwargs)[source]

Bases: bx.intervals.io.NiceReaderWrapper

Reader wrapper for GFF files.

Wrapper has two major functions:

  1. group entries for GFF file (via group column), GFF3 (via id attribute), or GTF (via gene_id/transcript id);
  2. convert coordinates from GFF format–starting and ending coordinates are 1-based, closed–to the ‘traditional’/BED interval format–0 based, half-open. This is useful when using GFF files as inputs to tools that expect traditional interval format.
next()[source]

Returns next GFFFeature.

parse_row(line)[source]
galaxy.datatypes.util.gff_util.convert_bed_coords_to_gff(interval)[source]

Converts an interval object’s coordinates from BED format to GFF format. Accepted object types include GenomicInterval and list (where the first element in the list is the interval’s start, and the second element is the interval’s end).

galaxy.datatypes.util.gff_util.convert_gff_coords_to_bed(interval)[source]

Converts an interval object’s coordinates from GFF format to BED format. Accepted object types include GFFFeature, GenomicInterval, and list (where the first element in the list is the interval’s start, and the second element is the interval’s end).

galaxy.datatypes.util.gff_util.gff_attributes_to_str(attrs, gff_format)[source]

Convert GFF attributes to string. Supported formats are GFF3, GTF.

galaxy.datatypes.util.gff_util.parse_gff_attributes(attr_str)[source]

Parses a GFF/GTF attribute string and returns a dictionary of name-value pairs. The general format for a GFF3 attributes string is

name1=value1;name2=value2

The general format for a GTF attribute string is

name1 “value1” ; name2 “value2”

The general format for a GFF attribute string is a single string that denotes the interval’s group; in this case, method returns a dictionary with a single key-value pair, and key name is ‘group’

galaxy.datatypes.util.gff_util.read_unordered_gtf(iterator, strict=False)[source]

Returns GTF features found in an iterator. GTF lines need not be ordered or clustered for reader to work. Reader returns GFFFeature objects sorted by transcript_id, chrom, and start position.

image_util Module

Provides utilities for working with image files.

galaxy.datatypes.util.image_util.check_image_type(filename, types, image=None)[source]
galaxy.datatypes.util.image_util.get_image_ext(file_path, image)[source]
galaxy.datatypes.util.image_util.image_type(filename, image=None)[source]
eggs Package
eggs Package

Manage Galaxy eggs

class galaxy.eggs.CaseSensitiveConfigParser(defaults=None, dict_type=<class 'collections.OrderedDict'>, allow_no_value=False)[source]

Bases: ConfigParser.SafeConfigParser

optionxform(optionstr)[source]
class galaxy.eggs.Crate(galaxy_config_file=None, platform=None)[source]

Bases: object

Reads the eggs.ini file for use with checking and fetching.

all_eggs

Return a list of all eggs in the crate.

all_missing

Return true if any eggs in the eggs config file are missing.

all_names

Return a list of names of all eggs in the crate.

config_eggs

Return a list of all eggs in the crate that are needed based on the options set in the Galaxy config file.

config_file = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/eggs.ini'
config_missing

Return true if any eggs are missing, conditional on options set in the Galaxy config file.

config_names

Return a list of names of all eggs in the crate that are needed based on the options set in the Galaxy config file.

parse()[source]
parse_egg_section(eggs, tags, full_platform=False, egg_class=<class 'galaxy.eggs.Egg'>)[source]
resolve(all=False)[source]

Try to resolve (e.g. fetch) all eggs in the crate.

class galaxy.eggs.Egg(name=None, version=None, tag=None, url=None, platform=None, crate=None)[source]

Bases: object

Contains information about locating and downloading eggs.

fetch() serves as the install method to pkg_resources.working_set.resolve()[source]
path

Return the path of the egg, if it exists, or None

remove_doppelgangers()[source]
require()[source]
resolve()[source]
set_dir()[source]
set_distribution()[source]

Stores a pkg_resources Distribution object for reference later

unpack_if_needed()[source]
version_conflict(conflict_dist, conflict_req)[source]
exception galaxy.eggs.EggNotFetchable(eggs)[source]

Bases: exceptions.Exception

class galaxy.eggs.GalaxyConfig(config_file)[source]

Bases: object

always_conditional = ('pysam', 'ctypes', 'python_daemon')
check_conditional(egg_name)[source]
class galaxy.eggs.URLRetriever(*args, **kwargs)[source]

Bases: urllib.FancyURLopener

http_error_default(*args)[source]
galaxy.eggs.get_env()[source]
galaxy.eggs.remove_file_or_path(f)[source]
galaxy.eggs.require(req_str)[source]
galaxy.eggs.string_as_bool(string)[source]
galaxy.eggs.unpack_zipfile(filename, extract_dir, ignores=[])[source]
dist Module

Manage Galaxy eggs

class galaxy.eggs.dist.DistScrambleCrate(galaxy_config_file, build_on='all')[source]

Bases: galaxy.eggs.scramble.ScrambleCrate

Holds eggs with info on how to build them for distribution.

dist_config_file = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/dist-eggs.ini'
get_platforms(wanted)[source]
parse()[source]
parse_egg_section(eggs, tags, full_platform=False)[source]
class galaxy.eggs.dist.DistScrambleEgg(*args, **kwargs)[source]

Bases: galaxy.eggs.scramble.ScrambleEgg

path
run_scramble_script()[source]
set_dir()[source]
unpack_if_needed()[source]
scramble Module

Manage Galaxy eggs

class galaxy.eggs.scramble.ScrambleCrate(galaxy_config_file=None, platform=None)[source]

Bases: galaxy.eggs.__init__.Crate

Reads the eggs.ini file for use with scrambling eggs.

parse()[source]
parse_egg_section(*args, **kwargs)[source]
scramble(all=False)[source]
class galaxy.eggs.scramble.ScrambleEgg(*args, **kwargs)[source]

Bases: galaxy.eggs.__init__.Egg

Contains information about scrambling eggs.

archive_dir = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/scripts/scramble/archives'
build_dir = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/scripts/scramble/build'
copy_build_script()[source]
ez_setup = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/scripts/scramble/lib/ez_setup.py'
ez_setup_url = 'http://peak.telecommunity.com/dist/ez_setup.py'
fetch_one(urls)[source]

Fetches the first available archive out of a list.

fetch_source()[source]

Get egg (and dependent) source

get_tld(names)[source]
run_scramble_script()[source]
scramble()[source]
scramble_dir = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/scripts/scramble'
script_dir = '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/scripts/scramble/scripts'
unpack_source()[source]
unpack_tar()[source]
unpack_zip()[source]
exception galaxy.eggs.scramble.ScrambleFailure(eggs, msg=None)[source]

Bases: exceptions.Exception

exceptions Package
exceptions Package

Custom exceptions for Galaxy

exception galaxy.exceptions.ActionInputError(err_msg, type='error')[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.AdminRequiredException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 403
exception galaxy.exceptions.AuthenticationFailed(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 401
exception galaxy.exceptions.AuthenticationRequired(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 403
exception galaxy.exceptions.ConfigDoesNotAllowException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 403
exception galaxy.exceptions.ConfigurationError[source]

Bases: exceptions.Exception

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 500
exception galaxy.exceptions.Conflict(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 409
exception galaxy.exceptions.DeprecatedMethod(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

Method (or a particular form/arg signature) has been removed and won’t be available later

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 404
exception galaxy.exceptions.DuplicatedIdentifierException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.DuplicatedSlugException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.InconsistentDatabase(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 500
exception galaxy.exceptions.InsufficientPermissionsException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 403
exception galaxy.exceptions.InternalServerError(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 500
exception galaxy.exceptions.ItemAccessibilityException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 403
exception galaxy.exceptions.ItemDeletionException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

exception galaxy.exceptions.ItemOwnershipException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 403
exception galaxy.exceptions.MalformedId(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.MessageException(err_msg=None, type='info', **extra_error_info)[source]

Bases: exceptions.Exception

Exception to make throwing errors from deep in controllers easier.

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.NotImplemented(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 501
exception galaxy.exceptions.ObjectAttributeInvalidException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.ObjectAttributeMissingException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.ObjectInvalid[source]

Bases: exceptions.Exception

Accessed object store ID is invalid

exception galaxy.exceptions.ObjectNotFound(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

Accessed object was not found

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 404
exception galaxy.exceptions.RequestParameterInvalidException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.RequestParameterMissingException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.ToolMetaParameterException(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
exception galaxy.exceptions.UnknownContentsType(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.MessageException

err_code = <galaxy.exceptions.error_codes.ErrorCode object>
status_code = 400
external_services Package
actions Module
class galaxy.external_services.actions.ExternalServiceAction(elem, parent)[source]

Bases: object

Abstract Class for External Service Actions

classmethod from_elem(elem, parent)[source]
handle_action(completed_action, param_dict, trans)[source]
perform_action(param_dict)[source]
populate_action(param_dict)[source]
type = None
class galaxy.external_services.actions.ExternalServiceResult(name, param_dict)[source]

Bases: object

content
class galaxy.external_services.actions.ExternalServiceTemplateAction(elem, parent)[source]

Bases: galaxy.external_services.actions.ExternalServiceAction

Action that redirects to an external URL

perform_action(param_dict)[source]
type = 'template'
class galaxy.external_services.actions.ExternalServiceValueResult(name, param_dict, value)[source]

Bases: galaxy.external_services.actions.ExternalServiceResult

content
class galaxy.external_services.actions.ExternalServiceWebAPIAction(elem, parent)[source]

Bases: galaxy.external_services.actions.ExternalServiceAction

Action that accesses an external Web API and provides handlers for the requested content

class ExternalServiceWebAPIActionRequest(elem, parent)[source]

Bases: object

get_web_api_action(param_dict)[source]
ExternalServiceWebAPIAction.perform_action(param_dict)[source]
ExternalServiceWebAPIAction.type = 'web_api'
class galaxy.external_services.actions.ExternalServiceWebAPIActionResult(name, param_dict, url, method, target)[source]

Bases: galaxy.external_services.actions.ExternalServiceResult

content
class galaxy.external_services.actions.ExternalServiceWebAction(elem, parent)[source]

Bases: galaxy.external_services.actions.ExternalServiceAction

Action that accesses an external web application

type = 'web'
class galaxy.external_services.actions.PopulatedExternalServiceAction(action, param_dict)[source]

Bases: object

handle_results(trans)[source]
perform_action()[source]
class galaxy.external_services.actions.Template(elem, parent)[source]

Bases: object

build_template(param_dict)[source]
parameters Module
class galaxy.external_services.parameters.ExternalServiceParameter(elem, parent)[source]

Bases: object

Abstract Class for External Service Parameters

classmethod from_elem(elem, parent)[source]
get_value(param_dict)[source]
requires_user_input = False
type = None
class galaxy.external_services.parameters.ExternalServiceTemplateParameter(elem, parent)[source]

Bases: galaxy.external_services.parameters.ExternalServiceParameter

Parameter that returns a string containing the requested content

get_value(param_dict)[source]
type = 'template'
service Module
class galaxy.external_services.service.ActionSection(name, label)[source]

Bases: list

has_action()[source]
class galaxy.external_services.service.BooleanExternalServiceActionsGroupWhen(parent, name, value, label=None)[source]

Bases: galaxy.external_services.service.ExternalServiceActionsGroupWhen

classmethod from_elem(parent, elem)[source]

Returns an instance of this when

is_case(param_dict)[source]
type = 'boolean'
class galaxy.external_services.service.ExternalServiceActionsConditional(elem, parent)[source]

Bases: object

get_current_cases(param_dict)[source]
type = 'conditional'
class galaxy.external_services.service.ExternalServiceActionsGroup(parent, name, label=None)[source]

Bases: object

add_item(item)[source]
classmethod from_elem(elem, parent=None)[source]

Return ExternalServiceActionsGroup created from an xml element.

load_sub_elems(elem)[source]
populate(service_instance, item=None, param_dict=None)[source]
prepare_actions(param_dict, parent_dict, parent_section)[source]
class galaxy.external_services.service.ExternalServiceActionsGroupWhen(parent, name, label=None)[source]

Bases: galaxy.external_services.service.ExternalServiceActionsGroup

classmethod from_elem(parent, elem)[source]

Loads the proper when by attributes of elem

get_ref(param_dict)[source]
is_case(param_dict)[source]
type = 'when'
class galaxy.external_services.service.ItemIsInstanceExternalServiceActionsGroupWhen(parent, name, value, label=None)[source]

Bases: galaxy.external_services.service.ExternalServiceActionsGroupWhen

classmethod from_elem(parent, elem)[source]

Returns an instance of this when

is_case(param_dict)[source]
type = 'item_type'
class galaxy.external_services.service.PopulatedExternalService(service_group, service_instance, item, param_dict=None)[source]

Bases: object

get_action_by_name(actions_list)[source]
perform_action_by_name(actions_list)[source]
populate()[source]
class galaxy.external_services.service.ValueExternalServiceActionsGroupWhen(parent, name, value, label=None)[source]

Bases: galaxy.external_services.service.ExternalServiceActionsGroupWhen

classmethod from_elem(parent, elem)[source]

Returns an instance of this when

is_case(param_dict)[source]
type = 'value'
galaxy.external_services.service.class_type

alias of ItemIsInstanceExternalServiceActionsGroupWhen

Subpackages
result_handlers Package
basic Module
class galaxy.external_services.result_handlers.basic.ExternalServiceActionJQueryGridResultHandler(elem, parent)[source]

Bases: galaxy.external_services.result_handlers.basic.ExternalServiceActionResultHandler

Class for External Service Actions JQuery Result Handler

handle_result(result, param_dict, trans)[source]
type = 'jquery_grid'
class galaxy.external_services.result_handlers.basic.ExternalServiceActionJSONResultHandler(elem, parent)[source]

Bases: galaxy.external_services.result_handlers.basic.ExternalServiceActionResultHandler

Class for External Service Actions JQuery Result Handler

handle_result(result, param_dict, trans)[source]
type = 'json_display'
class galaxy.external_services.result_handlers.basic.ExternalServiceActionResultHandler(elem, parent)[source]

Bases: object

Basic Class for External Service Actions Result Handlers

classmethod from_elem(elem, parent)[source]
handle_result(result, param_dict, trans)[source]
type = 'display'
class galaxy.external_services.result_handlers.basic.ExternalServiceActionURLRedirectResultHandler(elem, parent)[source]

Bases: galaxy.external_services.result_handlers.basic.ExternalServiceActionResultHandler

Basic Class for External Service Actions Result Handlers

classmethod from_elem(elem, parent)[source]
handle_result(result, param_dict, trans)[source]
type = 'web_redirect'
galaxy.external_services.result_handlers.basic.handler_class

alias of ExternalServiceActionJSONResultHandler

forms Package
forms Module

FormDefinition and field factories

class galaxy.forms.forms.FormDefinitionAddressFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None)[source]

Return new FormDefinition field.

type = 'address'
class galaxy.forms.forms.FormDefinitionFactory(form_types, field_type_factories)[source]

Bases: object

from_elem(elem, form_definition_current=None)[source]

Return FormDefinition created from an xml element.

new(form_type, name, description=None, fields=None, layout=None, form_definition_current=None)[source]

Return new FormDefinition.

class galaxy.forms.forms.FormDefinitionFieldFactory[source]

Bases: object

from_elem(elem, layout=None)[source]

Return FormDefinition created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None)[source]

Return new FormDefinition field.

type = None
class galaxy.forms.forms.FormDefinitionHistoryFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None)[source]

Return new FormDefinition field.

type = 'history'
class galaxy.forms.forms.FormDefinitionPasswordFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None, area=False)[source]

Return new FormDefinition field.

type = 'password'
class galaxy.forms.forms.FormDefinitionSelectFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None, options=[], checkboxes=False)[source]

Return new FormDefinition field.

type = 'select'
class galaxy.forms.forms.FormDefinitionTextFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None, area=False)[source]

Return new FormDefinition field.

type = 'text'
class galaxy.forms.forms.FormDefinitionWorkflowFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None)[source]

Return new FormDefinition field.

type = 'workflow'
class galaxy.forms.forms.FormDefinitionWorkflowMappingFieldFactory[source]

Bases: galaxy.forms.forms.FormDefinitionFieldFactory

from_elem(elem, layout=None)[source]

Return FormDefinition field created from an xml element.

new(name=None, label=None, required=False, helptext=None, default=None, visible=True, layout=None)[source]

Return new FormDefinition field.

type = 'workflowmapping'
galaxy.forms.forms.field

alias of FormDefinitionHistoryFieldFactory

jobs Package
jobs Package

Support for running a tool in Galaxy via an internal job management system

class galaxy.jobs.ComputeEnvironment[source]

Bases: object

Definition of the job as it will be run on the (potentially) remote compute server.

config_directory()[source]

Directory containing config files (potentially remote)

input_paths()[source]

Input DatasetPaths defined by job.

new_file_path()[source]

Absolute path to dump new files for this job on compute server.

output_paths()[source]

Output DatasetPaths defined by job.

sep()[source]

os.path.sep for the platform this job will execute in.

tool_directory()[source]

Absolute path to tool files for this job on compute server.

unstructured_path_rewriter()[source]

Return a function that takes in a value, determines if it is path to be rewritten (will be passed non-path values as well - onus is on this function to determine both if its input is a path and if it should be rewritten.)

version_path()[source]

Location of the version file for the underlying tool.

working_directory()[source]

Job working directory (potentially remote)

class galaxy.jobs.JobConfiguration(app)[source]

Bases: object

A parser and interface to advanced job management features.

These features are configured in the job configuration, by default, job_conf.xml

DEFAULT_NWORKERS = 4
convert_legacy_destinations(job_runners)[source]

Converts legacy (from a URL) destinations to contain the appropriate runner params defined in the URL.

Parameters:job_runners (list of job runner plugins) – All loaded job runner plugins.
default_job_tool_configuration

The default JobToolConfiguration, used if a tool does not have an explicit defintion in the configuration. It consists of a reference to the default handler and default destination.

Returns:JobToolConfiguration – a representation of a <tool> element that uses the default handler and destination
get_destination(id_or_tag)[source]

Given a destination ID or tag, return the JobDestination matching the provided ID or tag

Parameters:id_or_tag (str) – A destination ID or tag.
Returns:JobDestination – A valid destination

Destinations are deepcopied as they are expected to be passed in to job runners, which will modify them for persisting params set at runtime.

get_destinations(id_or_tag)[source]

Given a destination ID or tag, return all JobDestinations matching the provided ID or tag

Parameters:id_or_tag (str) – A destination ID or tag.
Returns:list or tuple of JobDestinations

Destinations are not deepcopied, so they should not be passed to anything which might modify them.

get_handler(id_or_tag)[source]

Given a handler ID or tag, return the provided ID or an ID matching the provided tag

Parameters:id_or_tag (str) – A handler ID or tag.
Returns:str – A valid job handler ID.
get_job_runner_plugins(handler_id)[source]

Load all configured job runner plugins

Returns:list of job runner plugins
get_job_tool_configurations(ids)[source]

Get all configured JobToolConfigurations for a tool ID, or, if given a list of IDs, the JobToolConfigurations for the first id in ids matching a tool definition.

Note

You should not mix tool shed tool IDs, versionless tool shed IDs, and tool config tool IDs that refer to the same tool.

Parameters:ids (list or str.) – Tool ID or IDs to fetch the JobToolConfiguration of.
Returns:list – JobToolConfiguration Bunches representing <tool> elements matching the specified ID(s).

Example tool ID strings include:

  • Full tool shed id: toolshed.example.org/repos/nate/filter_tool_repo/filter_tool/1.0.0
  • Tool shed id less version: toolshed.example.org/repos/nate/filter_tool_repo/filter_tool
  • Tool config tool id: filter_tool
get_tool_resource_parameters(tool_id)[source]

Given a tool id, return XML elements describing parameters to insert into job resources.

Tool id:A tool ID (a string)
Returns:List of parameter elements.
is_handler(server_name)[source]

Given a server name, indicate whether the server is a job handler

Parameters:server_name (str) – The name to check
Returns:bool
is_id(collection)[source]

Given a collection of handlers or destinations, indicate whether the collection represents a tag or a real ID

Parameters:collection (tuple or list) – A representation of a destination or handler
Returns:bool
is_tag(collection)[source]

Given a collection of handlers or destinations, indicate whether the collection represents a tag or a real ID

Parameters:collection (tuple or list) – A representation of a destination or handler
Returns:bool
class galaxy.jobs.JobDestination(**kwds)[source]

Bases: galaxy.util.bunch.Bunch

Provides details about where a job runs

class galaxy.jobs.JobToolConfiguration(**kwds)[source]

Bases: galaxy.util.bunch.Bunch

Provides details on what handler and destination a tool should use

A JobToolConfiguration will have the required attribute ‘id’ and optional attributes ‘handler’, ‘destination’, and ‘params’

get_resource_group()[source]
class galaxy.jobs.JobWrapper(job, queue, use_persisted_destination=False)[source]

Bases: object

Wraps a ‘model.Job’ with convenience methods for running processes and state management.

can_split()[source]
change_ownership_for_run()[source]
change_state(state, info=False)[source]
check_limits(runtime=None)[source]
check_tool_output(stdout, stderr, tool_exit_code, job)[source]
cleanup(delete_files=True)[source]
clear_working_directory()[source]
commands_in_new_shell
compute_outputs()[source]
create_working_directory()[source]
default_compute_environment(job=None)[source]
fail(message, exception=False, stdout='', stderr='', exit_code=None)[source]

Indicate job failure by setting state and message on all output datasets.

finish(stdout, stderr, tool_exit_code=None, remote_working_directory=None)[source]

Called to indicate that the associated command has been run. Updates the output datasets based on stderr and stdout from the command, and the contents of the output files.

galaxy_lib_dir
galaxy_system_pwent
get_command_line()[source]
get_dataset_finish_context(job_context, dataset)[source]
get_env_setup_clause()[source]
get_id_tag()[source]
get_input_dataset_fnames(ds)[source]
get_input_fnames()[source]
get_input_paths(job=None)[source]
get_job()[source]
get_job_runner()
get_job_runner_url()[source]
get_mutable_output_fnames()[source]
get_output_destination(output_path)[source]

Destination for outputs marked as from_work_dir. This is the normal case, just copy these files directly to the ulimate destination.

get_output_file_id(file)[source]
get_output_fnames()[source]
get_output_hdas_and_fnames()[source]
get_output_sizes()[source]
get_parallelism()[source]
get_param_dict()[source]

Restore the dictionary of parameters from the database.

get_session_id()[source]
get_state()[source]
get_tool_provided_job_metadata()[source]
get_version_string_path()[source]
has_limits()[source]
invalidate_external_metadata()[source]
job_destination

Return the JobDestination that this job will use to run. This will either be a configured destination, a randomly selected destination if the configured destination was a tag, or a dynamically generated destination from the dynamic runner.

Calling this method for the first time causes the dynamic runner to do its calculation, if any.

Returns:JobDestination
mark_as_resubmitted(info=None)[source]
pause(job=None, message=None)[source]
prepare(compute_environment=None)[source]

Prepare the job to run by creating the working directory and the config files.

reclaim_ownership()[source]
requires_setting_metadata
set_job_destination(job_destination, external_id=None)[source]

Persist job destination params in the database for recovery.

self.job_destination is not used because a runner may choose to rewrite parts of the destination (e.g. the params).

set_runner(runner_url, external_id)[source]
setup_external_metadata(exec_dir=None, tmp_dir=None, dataset_files_path=None, config_root=None, config_file=None, datatypes_config=None, set_extension=True, **kwds)[source]
user
user_system_pwent
class galaxy.jobs.NoopQueue[source]

Bases: object

Implements the JobQueue / JobStopQueue interface but does nothing

put(*args, **kwargs)[source]
put_stop(*args)[source]
shutdown()[source]
class galaxy.jobs.ParallelismInfo(tag)[source]

Bases: object

Stores the information (if any) for running multiple instances of the tool in parallel on the same set of inputs.

class galaxy.jobs.SharedComputeEnvironment(job_wrapper, job)[source]

Bases: galaxy.jobs.SimpleComputeEnvironment

Default ComputeEnviornment for job and task wrapper to pass to ToolEvaluator - valid when Galaxy and compute share all the relevant file systems.

input_paths()[source]
new_file_path()[source]
output_paths()[source]
tool_directory()[source]
version_path()[source]
working_directory()[source]
class galaxy.jobs.SimpleComputeEnvironment[source]

Bases: object

config_directory()[source]
sep()[source]
unstructured_path_rewriter()[source]
class galaxy.jobs.TaskWrapper(task, queue)[source]

Bases: galaxy.jobs.JobWrapper

Extension of JobWrapper intended for running tasks. Should be refactored into a generalized executable unit wrapper parent, then jobs and tasks.

can_split()[source]
change_state(state, info=False)[source]
cleanup(delete_files=True)[source]
fail(message, exception=False)[source]
finish(stdout, stderr, tool_exit_code=None)[source]

Called to indicate that the associated command has been run. Updates the output datasets based on stderr and stdout from the command, and the contents of the output files.

get_command_line()[source]
get_dataset_finish_context(job_context, dataset)[source]
get_exit_code()[source]
get_id_tag()[source]
get_job()[source]
get_output_destination(output_path)[source]

Destination for outputs marked as from_work_dir. These must be copied with the same basenme as the path for the ultimate output destination. This is required in the task case so they can be merged.

get_output_file_id(file)[source]
get_param_dict()[source]

Restore the dictionary of parameters from the database.

get_session_id()[source]
get_state()[source]
get_task()[source]
get_tool_provided_job_metadata()[source]
prepare(compute_environment=None)[source]

Prepare the job to run by creating the working directory and the config files.

set_runner(runner_url, external_id)[source]
setup_external_metadata(exec_dir=None, tmp_dir=None, dataset_files_path=None, config_root=None, config_file=None, datatypes_config=None, set_extension=True, **kwds)[source]
galaxy.jobs.config_exception(e, file)[source]
handler Module

Galaxy job handler, prepares, runs, tracks, and finishes Galaxy jobs

class galaxy.jobs.handler.DefaultJobDispatcher(app)[source]

Bases: object

put(job_wrapper)[source]
recover(job, job_wrapper)[source]
shutdown()[source]
stop(job)[source]

Stop the given job. The input variable job may be either a Job or a Task.

url_to_destination(url)[source]

This is used by the runner mapper (a.k.a. dynamic runner) and recovery methods to have runners convert URLs to destinations.

New-style runner plugin IDs must match the URL’s scheme for this to work.

class galaxy.jobs.handler.JobHandler(app)[source]

Bases: object

Handle the preparation, running, tracking, and finishing of jobs

shutdown()[source]
start()[source]
class galaxy.jobs.handler.JobHandlerQueue(app, dispatcher)[source]

Bases: object

Job Handler’s Internal Queue, this is what actually implements waiting for jobs to be runnable and dispatching to a JobRunner.

STOP_SIGNAL = <object object>
get_total_job_count_per_destination()[source]
get_user_job_count(user_id)[source]
get_user_job_count_per_destination(user_id)[source]
increase_running_job_count(user_id, destination_id)[source]
job_pair_for_id(id)[source]
job_wrapper(job, use_persisted_destination=False)[source]
put(job_id, tool_id)[source]

Add a job to the queue (by job identifier)

shutdown()[source]

Attempts to gracefully shut down the worker thread

start()[source]

Starts the JobHandler’s thread after checking for any unhandled jobs.

class galaxy.jobs.handler.JobHandlerStopQueue(app, dispatcher)[source]

Bases: object

A queue for jobs which need to be terminated prematurely.

STOP_SIGNAL = <object object>
monitor()[source]

Continually iterate the waiting jobs, stop any that are found.

monitor_step()[source]

Called repeatedly by monitor to stop jobs.

put(job_id, error_msg=None)[source]
shutdown()[source]

Attempts to gracefully shut down the worker thread

manager Module

Top-level Galaxy job manager, moves jobs to handler(s)

class galaxy.jobs.manager.JobManager(app)[source]

Bases: object

Highest level interface to job management.

TODO: Currently the app accesses “job_queue” and “job_stop_queue” directly.
This should be decoupled.
shutdown()[source]
start()[source]
class galaxy.jobs.manager.NoopHandler(*args, **kwargs)[source]

Bases: object

shutdown(*args)[source]
start()[source]
mapper Module
exception galaxy.jobs.mapper.JobMappingException(failure_message)[source]

Bases: exceptions.Exception

exception galaxy.jobs.mapper.JobNotReadyException(job_state=None, message=None)[source]

Bases: exceptions.Exception

class galaxy.jobs.mapper.JobRunnerMapper(job_wrapper, url_to_destination, job_config)[source]

Bases: object

This class is responsible to managing the mapping of jobs (in the form of job_wrappers) to job runner url strings.

cache_job_destination(raw_job_destination)[source]
get_job_destination(params)[source]

Cache the job_destination to avoid recalculation.

transfer_manager Module

Manage transfers from arbitrary URLs to temporary files. Socket interface for IPC with multiple process configurations.

class galaxy.jobs.transfer_manager.Sleeper[source]

Bases: object

Provides a ‘sleep’ method that sleeps for a number of seconds unless the notify method is called (from a different thread).

sleep(seconds)[source]
wake()[source]
class galaxy.jobs.transfer_manager.TransferManager(app)[source]

Bases: object

Manage simple data transfers from URLs to temporary locations.

get_state(transfer_jobs, via_socket=False)[source]
new(path=None, **kwd)[source]
run(transfer_jobs)[source]

This method blocks, so if invoking the transfer manager ever starts taking too long, we should move it to a thread. However, the transfer_manager will either daemonize or return after submitting to a running daemon, so it should be fairly quick to return.

shutdown()[source]
Subpackages
actions Package
actions Package

This package contains job action classes.

post Module

Actions to be run at job completion (or output hda creation, as in the case of immediate_actions listed below. Currently only used in workflows.

class galaxy.jobs.actions.post.ActionBox[source]

Bases: object

actions = {'ChangeDatatypeAction': <class 'galaxy.jobs.actions.post.ChangeDatatypeAction'>, 'RenameDatasetAction': <class 'galaxy.jobs.actions.post.RenameDatasetAction'>, 'ColumnSetAction': <class 'galaxy.jobs.actions.post.ColumnSetAction'>, 'HideDatasetAction': <class 'galaxy.jobs.actions.post.HideDatasetAction'>, 'DeleteIntermediatesAction': <class 'galaxy.jobs.actions.post.DeleteIntermediatesAction'>, 'EmailAction': <class 'galaxy.jobs.actions.post.EmailAction'>, 'TagDatasetAction': <class 'galaxy.jobs.actions.post.TagDatasetAction'>}
classmethod execute(app, sa_session, pja, job, replacement_dict=None)[source]
classmethod get_add_list()[source]
classmethod get_forms(trans)[source]
classmethod get_short_str(action)[source]
classmethod handle_incoming(incoming)[source]
immediate_actions = ['ChangeDatatypeAction', 'RenameDatasetAction', 'TagDatasetAction']
public_actions = ['RenameDatasetAction', 'ChangeDatatypeAction', 'ColumnSetAction', 'EmailAction', 'DeleteIntermediatesAction', 'TagDatasetAction']
class galaxy.jobs.actions.post.ChangeDatatypeAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'ChangeDatatypeAction'
verbose_name = 'Change Datatype'
class galaxy.jobs.actions.post.ColumnSetAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'ColumnSetAction'
verbose_name = 'Assign Columns'
class galaxy.jobs.actions.post.DefaultJobAction[source]

Bases: object

Base job action.

classmethod execute(app, sa_session, action, job, replacement_dict=None)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'DefaultJobAction'
verbose_name = 'Default Job'
class galaxy.jobs.actions.post.DeleteDatasetAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'DeleteDatasetAction'
verbose_name = 'Delete Dataset'
class galaxy.jobs.actions.post.DeleteIntermediatesAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'DeleteIntermediatesAction'
verbose_name = 'Delete Non-Output Completed Intermediate Steps'
class galaxy.jobs.actions.post.EmailAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

This action sends an email to the galaxy user responsible for a job.

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'EmailAction'
verbose_name = 'Email Notification'
class galaxy.jobs.actions.post.HideDatasetAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'HideDatasetAction'
verbose_name = 'Hide Dataset'
class galaxy.jobs.actions.post.RenameDatasetAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'RenameDatasetAction'
verbose_name = 'Rename Dataset'
class galaxy.jobs.actions.post.SetMetadataAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
name = 'SetMetadataAction'
class galaxy.jobs.actions.post.TagDatasetAction[source]

Bases: galaxy.jobs.actions.post.DefaultJobAction

classmethod execute(app, sa_session, action, job, replacement_dict)[source]
classmethod get_config_form(trans)[source]
classmethod get_short_str(pja)[source]
name = 'TagDatasetAction'
verbose_name = 'Add tag to dataset'
galaxy.jobs.actions.post.get_form_template(action_type, title, content, help, on_output=True)[source]
deferred Package
deferred Package

Queue for running deferred code via plugins.

class galaxy.jobs.deferred.DeferredJobQueue(app)[source]

Bases: object

job_states = <galaxy.util.bunch.Bunch object>
shutdown()[source]
class galaxy.jobs.deferred.FakeTrans(app, history=None, user=None)[source]

Bases: object

A fake trans for calling the external set metadata tool

db_dataset_for(dbkey)[source]
get_current_user_roles()[source]
get_galaxy_session()[source]
log_event(message, tool_id=None)[source]
class galaxy.jobs.deferred.Sleeper[source]

Bases: object

Provides a ‘sleep’ method that sleeps for a number of seconds unless the notify method is called (from a different thread).

sleep(seconds)[source]
wake()[source]
data_transfer Module

Module for managing data transfer jobs.

class galaxy.jobs.deferred.data_transfer.DataTransfer(app)[source]

Bases: object

check_interval = 15
check_job(job)[source]
create_job(trans, **kwd)[source]
dataset_datatype_re = <_sre.SRE_Pattern object>
dataset_name_re = <_sre.SRE_Pattern object>
run_job(job)[source]
genome_index Module
genome_transfer Module
liftover_transfer Module
manual_data_transfer Module

Generic module for managing manual data transfer jobs using Galaxy’s built-in file browser. This module can be used by various external services that are configured to transfer data manually.

class galaxy.jobs.deferred.manual_data_transfer.ManualDataTransferPlugin(app)[source]

Bases: galaxy.jobs.deferred.data_transfer.DataTransfer

check_job(job)[source]
create_job(trans, **kwd)[source]
pacific_biosciences_smrt_portal Module

Module for managing jobs in Pacific Bioscience’s SMRT Portal and automatically transferring files produced by SMRT Portal.

class galaxy.jobs.deferred.pacific_biosciences_smrt_portal.SMRTPortalPlugin(app)[source]

Bases: galaxy.jobs.deferred.data_transfer.DataTransfer

api_path = '/smrtportal/api'
check_job(job)[source]
create_job(trans, **kwd)[source]
runners Package
runners Package

Base classes for job runner plugins.

class galaxy.jobs.runners.AsynchronousJobRunner(app, nworkers, **kwargs)[source]

Bases: galaxy.jobs.runners.BaseJobRunner

Parent class for any job runner that runs jobs asynchronously (e.g. via a distributed resource manager). Provides general methods for having a thread to monitor the state of asynchronous jobs and submitting those jobs to the correct methods (queue, finish, cleanup) at appropriate times..

check_watched_item(job_state)[source]
check_watched_items()[source]

This method is responsible for iterating over self.watched and handling state changes and updating self.watched with a new list of watched job states. Subclasses can opt to override this directly (as older job runners will initially) or just override check_watched_item and allow the list processing to reuse the logic here.

fail_job(job_state)[source]
finish_job(job_state)[source]

Get the output/error for a finished job, pass to job_wrapper.finish and cleanup all the job’s temporary files.

handle_stop()[source]
mark_as_failed(job_state)[source]
mark_as_finished(job_state)[source]
monitor()[source]

Watches jobs currently in the monitor queue and deals with state changes (queued to running) and job completion.

monitor_job(job_state)[source]
shutdown()[source]

Attempts to gracefully shut down the monitor thread

class galaxy.jobs.runners.AsynchronousJobState(files_dir=None, job_wrapper=None, job_id=None, job_file=None, output_file=None, error_file=None, exit_code_file=None, job_name=None, job_destination=None)[source]

Bases: galaxy.jobs.runners.JobState

Encapsulate the state of an asynchronous job, this should be subclassed as needed for various job runners to capture additional information needed to communicate with distributed resource manager.

check_limits(runtime=None)[source]
cleanup()[source]
register_cleanup_file_attribute(attribute)[source]
running
class galaxy.jobs.runners.BaseJobRunner(app, nworkers, **kwargs)[source]

Bases: object

DEFAULT_SPECS = {'recheck_missing_job_retries': {'default': 0, 'map': <type 'int'>, 'valid': <function <lambda> at 0x7f2aaea0cde8>}}
build_command_line(job_wrapper, include_metadata=False, include_work_dir_outputs=True)[source]
get_job_file(job_wrapper, **kwds)[source]
get_work_dir_outputs(job_wrapper, job_working_directory=None)[source]

Returns list of pairs (source_file, destination) describing path to work_dir output file and ultimate destination.

mark_as_queued(job_wrapper)[source]
mark_as_resubmitted(job_state, info=None)[source]
parse_destination_params(params)[source]

Parse the JobDestination params dict and return the runner’s native representation of those params.

prepare_job(job_wrapper, include_metadata=False, include_work_dir_outputs=True)[source]

Some sanity checks that all runners’ queue_job() methods are likely to want to do

put(job_wrapper)[source]

Add a job to the queue (by job identifier), indicate that the job is ready to run.

queue_job(job_wrapper)[source]
recover(job, job_wrapper)[source]
run_next()[source]

Run the next item in the work queue (a job waiting to run)

shutdown()[source]

Attempts to gracefully shut down the worker threads

stop_job(job)[source]
url_to_destination(url)[source]

Convert a legacy URL to a JobDestination.

Job runner URLs are deprecated, JobDestinations should be used instead. This base class method converts from a URL to a very basic JobDestination without destination params.

class galaxy.jobs.runners.JobState[source]

Bases: object

Encapsulate state of jobs.

static default_exit_code_file(files_dir, id_tag)[source]
static default_job_file(files_dir, id_tag)[source]
runner_states = <galaxy.util.bunch.Bunch object>
set_defaults(files_dir)[source]
class galaxy.jobs.runners.RunnerParams(specs=None, params=None)[source]

Bases: galaxy.util.ParamsWithSpecs

cli Module

Job control via a command line interface (e.g. qsub/qstat), possibly over a remote connection (e.g. ssh).

class galaxy.jobs.runners.cli.ShellJobRunner(app, nworkers)[source]

Bases: galaxy.jobs.runners.AsynchronousJobRunner

Job runner backed by a finite pool of worker threads. FIFO scheduling

check_watched_items()[source]

Called by the monitor thread to look at each watched job and deal with state changes.

finish_job(job_state)[source]

For recovery of jobs started prior to standardizing the naming of files in the AsychronousJobState object

get_cli_plugins(shell_params, job_params)[source]
parse_destination_params(params)[source]
queue_job(job_wrapper)[source]

Create job script and submit it to the DRM

recover(job, job_wrapper)[source]

Recovers jobs stuck in the queued/running state when Galaxy started

runner_name = 'ShellRunner'
stop_job(job)[source]

Attempts to delete a dispatched job

url_to_destination(url)[source]
condor Module

Job control via the Condor DRM.

class galaxy.jobs.runners.condor.CondorJobRunner(app, nworkers)[source]

Bases: galaxy.jobs.runners.AsynchronousJobRunner

Job runner backed by a finite pool of worker threads. FIFO scheduling

check_watched_items()[source]

Called by the monitor thread to look at each watched job and deal with state changes.

queue_job(job_wrapper)[source]

Create job script and submit it to the DRM

recover(job, job_wrapper)[source]

Recovers jobs stuck in the queued/running state when Galaxy started

runner_name = 'CondorRunner'
stop_job(job)[source]

Attempts to delete a job from the DRM queue

drmaa Module

Job control via the DRMAA API.

class galaxy.jobs.runners.drmaa.DRMAAJobRunner(app, nworkers, **kwargs)[source]

Bases: galaxy.jobs.runners.AsynchronousJobRunner

Job runner backed by a finite pool of worker threads. FIFO scheduling

check_watched_items()[source]

Called by the monitor thread to look at each watched job and deal with state changes.

external_runjob(jobtemplate_filename, username)[source]

runs an external script the will QSUB a new job. The external script will be run with sudo, and will setuid() to the specified user. Effectively, will QSUB as a different user (then the one used by Galaxy).

get_native_spec(url)[source]

Get any native DRM arguments specified by the site configuration

queue_job(job_wrapper)[source]

Create job script and submit it to the DRM

recover(job, job_wrapper)[source]

Recovers jobs stuck in the queued/running state when Galaxy started

runner_name = 'DRMAARunner'
stop_job(job)[source]

Attempts to delete a job from the DRM queue

store_jobtemplate(job_wrapper, jt)[source]

Stores the content of a DRMAA JobTemplate object in a file as a JSON string. Path is hard-coded, but it’s no worse than other path in this module. Uses Galaxy’s JobID, so file is expected to be unique.

url_to_destination(url)[source]

Convert a legacy URL to a job destination

local Module

Job runner plugin for executing jobs on the local system via the command line.

class galaxy.jobs.runners.local.LocalJobRunner(app, nworkers)[source]

Bases: galaxy.jobs.runners.BaseJobRunner

Job runner backed by a finite pool of worker threads. FIFO scheduling

queue_job(job_wrapper)[source]
recover(job, job_wrapper)[source]
runner_name = 'LocalRunner'
stop_job(job)[source]
lwr Module
class galaxy.jobs.runners.lwr.LwrJobRunner(app, nworkers, **kwds)[source]

Bases: galaxy.jobs.runners.AsynchronousJobRunner

LWR Job Runner

check_pid(pid)[source]
check_watched_item(job_state)[source]
fail_job(job_state)[source]

Seperated out so we can use the worker threads for it.

finish_job(job_state)[source]
get_client(job_destination_params, job_id, env=[])[source]
get_client_from_state(job_state)[source]
get_client_from_wrapper(job_wrapper)[source]
get_input_files(job_wrapper)[source]
get_output_files(job_wrapper)[source]
queue_job(job_wrapper)[source]
recover(job, job_wrapper)[source]

Recovers jobs stuck in the queued/running state when Galaxy started

runner_name = 'LWRRunner'
shutdown()[source]
stop_job(job)[source]
url_to_destination(url)[source]

Convert a legacy URL to a job destination

pbs Module
tasks Module
class galaxy.jobs.runners.tasks.TaskedJobRunner(app, nworkers)[source]

Bases: galaxy.jobs.runners.BaseJobRunner

Job runner backed by a finite pool of worker threads. FIFO scheduling

queue_job(job_wrapper)[source]
recover(job, job_wrapper)[source]
runner_name = 'TaskRunner'
stop_job(job)[source]
Subpackages
cli_job Package
cli_job Package
torque Module
cli_shell Package
cli_shell Package
rsh Module
splitters Package
basic Module
galaxy.jobs.splitters.basic.do_merge(job_wrapper, task_wrappers)[source]
galaxy.jobs.splitters.basic.do_split(job_wrapper)[source]
galaxy.jobs.splitters.basic.set_basic_defaults(job_wrapper)[source]
multi Module
galaxy.jobs.splitters.multi.do_merge(job_wrapper, task_wrappers)[source]
galaxy.jobs.splitters.multi.do_split(job_wrapper)[source]
model Package
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

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

Bases: object

exception galaxy.model.ConverterDependencyException(value)[source]

Bases: exceptions.Exception

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

Bases: object

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

Bases: object

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

Bases: object

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 = ('upload', 'queued', 'running', 'setting_metadata')
object_store = None
permitted_actions = <galaxy.util.bunch.Bunch object>
ready_states = ('discarded', 'ok', 'failed_metadata', 'paused', 'error', 'new', '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>
user_can_purge
class galaxy.model.DatasetCollection(id=None, collection_type=None, populated=True)[source]

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

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]
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.model.item_attrs.Dictifiable

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

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

display_name()[source]
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)[source]

Bases: object

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

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.

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)[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_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>
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)[source]

Bases: object

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

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

Bases: object

class galaxy.model.DefaultQuotaAssociation(type, quota)[source]

Bases: galaxy.model.Quota, galaxy.model.item_attrs.Dictifiable

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

Bases: object

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

Bases: object

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

class galaxy.model.ExtendedMetadata(data)[source]

Bases: object

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

Bases: object

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

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.model.item_attrs.Dictifiable

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'>]
types = <galaxy.util.bunch.Bunch object>
class galaxy.model.FormDefinitionCurrent(form_definition=None)[source]

Bases: object

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

Bases: object

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

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

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

class galaxy.model.Group(name=None)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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

Bases: object, galaxy.model.item_attrs.Dictifiable

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

Bases: object

class galaxy.model.HasJobMetrics[source]
add_metric(plugin, metric_name, metric_value)[source]
metrics
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.model.item_attrs.Dictifiable, galaxy.model.item_attrs.UsesAnnotations, galaxy.model.HasName

activatable_datasets
active_contents

Return all active contents ordered by hid.

active_datasets_children_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_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')
empty
get_disk_size(nice_size=False)[source]
get_disk_size_bytes
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.model.item_attrs.Dictifiable, galaxy.model.item_attrs.UsesAnnotations, galaxy.model.HasName

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

clear_associated_files(metadata_safe=False, purge=False)[source]
copy(copy_children=False, parent_id=None)[source]

Create a copy of this HDA.

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.

class galaxy.model.HistoryDatasetAssociationAnnotationAssociation[source]

Bases: object

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

Bases: object

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

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.Dictifiable

Associates a DatasetCollection with a History.

add_implicit_input_collection(name, history_dataset_collection)[source]
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]
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

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

Bases: object

clear(purge=False, delete_dataset=True)[source]
class galaxy.model.ImplicitlyCreatedDatasetCollectionInput(name, input_dataset_collection)[source]

Bases: object

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

Bases: object

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.model.item_attrs.Dictifiable

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.HasJobMetrics, galaxy.model.item_attrs.Dictifiable

add_implicit_output_dataset_collection(name, dataset_collection)[source]
add_input_dataset(name, dataset)[source]
add_input_dataset_collection(name, dataset)[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_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.

raw_param_dict()[source]
set_command_line(command_line)[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>
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

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

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

Bases: object

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

class galaxy.model.JobStateHistory(job)[source]

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object, galaxy.model.item_attrs.Dictifiable, galaxy.model.HasName

dict_collection_visible_keys = ('id', 'name')
dict_element_visible_keys = ('id', 'deleted', 'name', 'description', 'synopsis', 'root_folder_id')
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

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.model.item_attrs.Dictifiable

Associates a DatasetCollection with a library folder.

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

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

class galaxy.model.LibraryDatasetDatasetInfoAssociation(library_dataset_dataset_association, form_definition, info)[source]

Bases: object

inheritable
class galaxy.model.LibraryDatasetPermissions(action, library_item, role)[source]

Bases: object

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

Bases: object, galaxy.model.item_attrs.Dictifiable, galaxy.model.HasName

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

class galaxy.model.LibraryFolderPermissions(action, library_item, role)[source]

Bases: object

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

Bases: object

class galaxy.model.LibraryPermissions(action, library_item, role)[source]

Bases: object

class galaxy.model.MetadataFile(dataset=None, name=None)[source]

Bases: object

file_name
exception galaxy.model.NoConverterException(value)[source]

Bases: exceptions.Exception

class galaxy.model.Page[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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.model.item_attrs.Dictifiable

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

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

Bases: object

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

Bases: object

class galaxy.model.PostJobActionAssociation(pja, job)[source]

Bases: object

class galaxy.model.Quota(name='', description='', amount=0, operation='=')[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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.model.item_attrs.Dictifiable

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

class galaxy.model.RequestType(name=None, desc=None, request_form=None, sample_form=None)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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

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

Bases: object

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

Bases: object

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

Bases: object, galaxy.model.item_attrs.Dictifiable

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

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.model.item_attrs.Dictifiable

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]
get_untransferred_dataset_size(filepath, scp_configs)[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

transfer_status = <galaxy.util.bunch.Bunch object>
class galaxy.model.SampleEvent(sample=None, sample_state=None, comment='')[source]

Bases: object

class galaxy.model.SampleRunAssociation(sample, run)[source]

Bases: object

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

Bases: object

class galaxy.model.StoredWorkflow[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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

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

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

Bases: object

class galaxy.model.Task(job, working_directory, prepare_files_cmd)[source]

Bases: object, galaxy.model.HasJobMetrics

A task represents a single component of a job.

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

class galaxy.model.TransferJob(state=None, path=None, info=None, pid=None, socket=None, params=None)[source]

Bases: object

states = <galaxy.util.bunch.Bunch object>
terminal_states = ['error', 'done']
class galaxy.model.UCI[source]

Bases: object

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

Bases: object, galaxy.model.item_attrs.Dictifiable

all_roles()[source]

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

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

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

get_html()[source]
class galaxy.model.UserGroupAssociation(user, group)[source]

Bases: object

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

Bases: object

class galaxy.model.UserPreference(name=None, value=None)[source]

Bases: object

class galaxy.model.UserQuotaAssociation(user, quota)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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

Bases: object

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

Bases: object

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

Bases: object

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

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

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

class galaxy.model.Workflow(uuid=None)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

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.

to_dict(view='collection', value_mapper=None)[source]
class galaxy.model.WorkflowInvocation[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

active

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

add_input(content, step_id)[source]
cancel()[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]
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)[source]
update()[source]
class galaxy.model.WorkflowInvocationStep[source]

Bases: object, galaxy.model.item_attrs.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.WorkflowOutput(workflow_step, output_name)[source]

Bases: object

class galaxy.model.WorkflowRequest[source]

Bases: object, galaxy.model.item_attrs.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.model.item_attrs.Dictifiable

Workflow-related parameters not tied to steps or inputs.

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

Bases: object, galaxy.model.item_attrs.Dictifiable

Workflow step value parameters.

dict_collection_visible_keys = ['id', 'name', 'value', 'workflow_step_id']
class galaxy.model.WorkflowRequestToInputDatasetAssociation[source]

Bases: object, galaxy.model.item_attrs.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.model.item_attrs.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

class galaxy.model.WorkflowStepAnnotationAssociation[source]

Bases: object

class galaxy.model.WorkflowStepConnection[source]

Bases: object

NON_DATA_CONNECTION = '__NO_INPUT_OUTPUT_NAME__'
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.set_datatypes_registry(d_registry)[source]

Set up datatypes_registry

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_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]
item_attrs Module
class galaxy.model.item_attrs.Dictifiable[source]

Mixin that enables objects to be converted to dictionaries. This is useful when for sharing objects across boundaries, such as the API, tool scripts, and JavaScript code.

to_dict(view='collection', value_mapper=None)[source]

Return item dictionary.

exception galaxy.model.item_attrs.RuntimeException[source]

Bases: exceptions.Exception

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.

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)[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]
mapping_tests Module
Subpackages
migrate Package
check Module
galaxy.model.migrate.check.create_or_verify_database(url, galaxy_config_file, engine_options={}, app=None)[source]

Check that the database is use-able, possibly creating it if empty (this is the only time we automatically create tables, otherwise we force the user to do it using the management script so they can create backups).

  1. Empty database –> initialize with latest version and return
  2. Database older than migration support –> fail and require manual update
  3. Database at state where migrate support introduced –> add version control information but make no changes (might still require manual update)
  4. Database versioned but out of date –> fail with informative message, user must run “sh manage_db.sh upgrade”
galaxy.model.migrate.check.migrate_to_current_version(engine, schema)[source]
orm Package
orm Package
galaxy.model.orm.load_egg_for_url(url)[source]
logging_connection_proxy Module
class galaxy.model.orm.logging_connection_proxy.LoggingProxy[source]

Bases: sqlalchemy.interfaces.ConnectionProxy

Logs SQL statements using standard logging module

begin(conn, begin)[source]
commit(conn, commit)[source]
cursor_execute(execute, cursor, statement, parameters, context, executemany)[source]
rollback(conn, rollback)[source]
class galaxy.model.orm.logging_connection_proxy.TraceLoggerProxy(trace_logger)[source]

Bases: sqlalchemy.interfaces.ConnectionProxy

Logs SQL statements using a metlog client

cursor_execute(execute, cursor, statement, parameters, context, executemany)[source]
galaxy.model.orm.logging_connection_proxy.pretty_stack()[source]
galaxy.model.orm.logging_connection_proxy.stripwd(s)[source]
Subpackages
ext Package
ext Package
assignmapper Module
managers Package
managers Package

Classes that manage resources (models, tools, etc.) by using the current Transaction.

Encapsulates the intersection of trans (or trans.sa_session), models, and Controllers.

Responsibilities:

model operations that involve the trans/sa_session (CRUD) security:

ownership, accessibility
common aspect-oriented operations via new mixins:
sharable, annotatable, tagable, ratable
Not responsible for:
encoding/decoding ids any http gobblygook formatting of returned data (always python structures) formatting of raised errors
The goal is to have Controllers only handle:
query-string/payload parsing and encoding/decoding ids http return formatting
and:
control, improve namespacing in Controllers DRY for Controller ops (define here - use in both UI/API Controllers)

In other words, ‘Business logic’ independent of web transactions/user context (trans) should be pushed into models - but logic that requires the context trans should be placed under this module.

api_keys Module
class galaxy.managers.api_keys.ApiKeyManager(app)[source]

Bases: object

create_api_key(user)[source]
get_or_create_api_key(user)[source]
base Module

Keeps the older BaseController security and fetching methods and also defines a base ModelManager, ModelSerializer, and ModelDeserializer.

ModelManagers are used for operations on models that occur outside the scope of a single model object, such as:

  • object creation
  • object lookup
  • interactions between 2+ objects of different model classes

(Since these were to replace model Mixins from web/framework/base/controller.py the rule of thumb used there also generally has been applied here: if it uses the trans or sa_session, put it in a manager and not the model.)

ModelSerializers allow flexible conversion of model objects to dictionaries. They control what keys are sent, how values are simplified, can remap keys, and allow both predefined and user controlled key sets.

ModelDeserializers control how a model validates and process an incoming attribute change to a model object.

class galaxy.managers.base.ModelDeserializer(app)[source]

Bases: object

An object that converts an incoming serialized dict into values that can be directly assigned to an item’s attributes and assigns them.

add_deserializers()[source]

Register a map of attribute keys -> functions that will deserialize data into attributes to be assigned to the item.

default_deserializer(item, key, val, **context)[source]

If the incoming val is different than the item value change it and, in either case, return the value.

deserialize(item, data, flush=True, **context)[source]

Convert an incoming serialized dict into values that can be directly assigned to an item’s attributes and assign them

deserialize_basestring(item, key, val, convert_none_to_empty=False, **context)[source]
deserialize_bool(item, key, val, **context)[source]
deserialize_genome_build(item, key, val, **context)[source]

Make sure val is a valid dbkey and assign it.

deserialize_int(item, key, val, min=None, max=None, **context)[source]
model_manager_class = None

the class used to create this deserializer’s generically accessible model_manager

exception galaxy.managers.base.ModelDeserializingError(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.ObjectAttributeInvalidException

Thrown when an incoming value isn’t usable by the model (bad type, out of range, etc.)

class galaxy.managers.base.ModelFilterParser(app)[source]

Bases: object

Converts string tuples (partially converted query string params) of attr, op, val into either:

  • ORM based filters (filters that can be applied by the ORM at the SQL

level) or - functional filters (filters that use derived values or values not within the SQL tables)

These filters can then be applied to queries.

This abstraction allows ‘smarter’ application of limit and offset at either the SQL level or the generator/list level based on the presence of functional filters. In other words, if no functional filters are present, limit and offset may be applied at the SQL level. If functional filters are present, limit and offset need to applied at the list level.

These might be safely be replaced in the future by creating SQLAlchemy hybrid properties or more thoroughly mapping derived values.

UNDERSCORED_OPS = ('lt', 'le', 'eq', 'ne', 'ge', 'gt')

these are the easier/shorter string equivalents to the python operator fn names that need ‘__’ around them

fn_filter_parsers = None

dictionary containing parsing data for functional filters - applied after a query is made

model_class = None

model class

orm_filter_parsers = None
dictionary containing parsing data for ORM/SQLAlchemy-based filters
over potentially expensive queries
parse_bool(bool_string)[source]

Parse a boolean from a string.

parse_filter(attr, op, val)[source]

Attempt to parse filter as a custom/fn filter, then an orm filter, and if neither work - raise an error.

Raises exceptions.RequestParameterInvalidException:
 if no functional or orm filter can be parsed.
parse_filters(filter_tuple_list)[source]

Parse string 3-tuples (attr, op, val) into orm or functional filters.

parse_id_list(id_list_string, sep=', ')[source]

Split id_list_string at sep.

string_standard_ops(key)[source]
class galaxy.managers.base.ModelManager(app)[source]

Bases: object

Base class for all model/resource managers.

Provides common queries and CRUD operations as a (hopefully) light layer over the ORM.

associate(associate_with, item, foreign_key_name=None)[source]

Generically associate item with associate_with based on foreign_key_name.

by_id(id, **kwargs)[source]

Gets a model by primary id.

by_ids(ids, filters=None, **kwargs)[source]

Returns an in-order list of models with the matching ids in ids.

copy(item, **kwargs)[source]

Clone or copy an item.

create(flush=True, *args, **kwargs)[source]

Generically create a new model.

foreign_key_name = None
list(filters=None, order_by=None, limit=None, offset=None, **kwargs)[source]

Returns all objects matching the given filters

model_class

alias of object

one(**kwargs)[source]

Sends kwargs to build the query and returns one and only one model.

query(eagerloads=True, filters=None, order_by=None, limit=None, offset=None, **kwargs)[source]

Return a basic query from model_class, filters, order_by, and limit and offset.

Set eagerloads to False to disable them for this query.

query_associated(associated_model_class, item, foreign_key_name=None)[source]

Generically query other items that have been associated with this item.

session()[source]
update(item, new_values, flush=True, **kwargs)[source]

Given a dictionary of new values, update item and return it.

..note: NO validation or deserialization occurs here.

class galaxy.managers.base.ModelSerializer(app)[source]

Bases: object

Turns models into JSONable dicts.

Maintains a map of requestable keys and the Callable() serializer functions that should be called for those keys. E.g. { ‘x’ : lambda item, key: item.x, ... }

Note: if a key to serialize is not listed in the Serializer.serializable_keyset or serializers, it will not be returned.

To serialize call:
my_serializer = MySerializer( app ) ... keys_to_serialize = [ ‘id’, ‘name’, ‘attr1’, ‘attr2’, ... ] item_dict = MySerializer.serialize( my_item, keys_to_serialize )
add_serializers()[source]

Register a map of attribute keys -> serializing functions that will serialize the attribute.

add_view(view_name, key_list, include_keys_from=None)[source]

Add the list of serializable attributes key_list to the serializer’s view dictionary under the key view_name.

If include_keys_from is a proper view name, extend key_list by the list in that view.

default_serializer(item, key, **context)[source]

Serialize the item‘s attribute named key.

serialize(item, keys, **context)[source]

Serialize the model item to a dictionary.

Given model item and the list keys, create and return a dictionary built from each key in keys that also exists in serializers and values of calling the keyed/named serializers on item.

serialize_date(item, key, **context)[source]

Serialize a date attribute of item.

serialize_id(item, key, **context)[source]

Serialize an id attribute of item.

serialize_to_view(item, view=None, keys=None, default_view=None, **context)[source]

Use a predefined list of keys (the string view) and any additional keys listed in keys.

The combinations can be:
view only: return those keys listed in the named view keys only: return those keys listed no view or keys: use the default_view if any view and keys: combine both into one list of keys
skip(msg='skipped')[source]

To be called from inside a serializer to skip it.

Handy for config checks, information hiding, etc.

static url_for(*args, **kargs)

‘service’ to use for getting urls - use class var to allow overriding when testing

exception galaxy.managers.base.ModelSerializingError(err_msg=None, type='info', **extra_error_info)[source]

Bases: galaxy.exceptions.InternalServerError

Thrown when request model values can’t be serialized

class galaxy.managers.base.ModelValidator(app, *args, **kwargs)[source]

Bases: object

An object that inspects a dictionary (generally meant to be a set of new/updated values for the model) and raises an error if a value is not acceptable.

basestring(key, val)[source]
basestring_list(key, val)[source]

Must be a list of basestrings.

bool(key, val)[source]
genome_build(key, val)[source]

Must be a valid base_string.

Note: no checking against installation’s ref list is done as many data sources consider this an open field.

int(key, val)[source]
int_range(key, val, min=None, max=None)[source]

Must be a int between min and max.

nullable_basestring(key, val)[source]

Must be a basestring or None.

type(key, val, types)[source]

Check val against the type (or tuple of types) in types.

Raises exceptions.RequestParameterInvalidException:
 if not an instance.
exception galaxy.managers.base.SkipAttribute[source]

Bases: exceptions.Exception

Raise this inside a serializer to prevent the returned dictionary from having a the associated key or value for this attribute.

galaxy.managers.base.get_class(class_name)[source]

Returns the class object that a string denotes. Without this method, we’d have to do eval(<class_name>).

galaxy.managers.base.get_object(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]

Convenience method to get a model object with the specified checks. This is a generic method for dealing with objects uniformly from the older controller mixin code - however whenever possible the managers for a particular model should be used to load objects.

galaxy.managers.base.security_check(trans, item, check_ownership=False, check_accessible=False)[source]

Security checks for an item: checks if (a) user owns item or (b) item is accessible to user. This is a generic method for dealing with objects uniformly from the older controller mixin code - however whenever possible the managers for a particular model should be used to perform security checks.

citations Module
class galaxy.managers.citations.BaseCitation[source]

Bases: object

equals(other_citation)[source]
has_doi()[source]
to_dict(citation_format)[source]
class galaxy.managers.citations.BibtexCitation(elem, directory, citation_manager)[source]

Bases: galaxy.managers.citations.BaseCitation

to_bibtex()[source]
class galaxy.managers.citations.CitationCollection[source]

Bases: object

add(new_citation)[source]
class galaxy.managers.citations.CitationsManager(app)[source]

Bases: object

citations_for_tool(tool)[source]
citations_for_tool_ids(tool_ids)[source]
parse_citation(citation_elem, tool_directory)[source]
class galaxy.managers.citations.DoiCache(config)[source]

Bases: object

get_bibtex(doi)[source]
class galaxy.managers.citations.DoiCitation(elem, directory, citation_manager)[source]

Bases: galaxy.managers.citations.BaseCitation

BIBTEX_UNSET = <object object>
doi()[source]
has_doi()[source]
to_bibtex()[source]
galaxy.managers.citations.parse_citation(elem, directory, citation_manager)[source]

Parse an abstract citation entry from the specified XML element. The directory parameter should be used to find external files for this citation.

collections Module
class galaxy.managers.collections.DatasetCollectionManager(app)[source]

Bases: object

Abstraction for interfacing with dataset collections instance - ideally abstarcts out model and plugin details.

ELEMENTS_UNINITIALIZED = <object object>
copy(trans, parent, source, encoded_source_id)[source]
create(trans, parent, name, collection_type, element_identifiers=None, elements=None, implicit_collection_info=None)[source]
create_dataset_collection(trans, collection_type, elements=None)[source]
delete(trans, instance_type, id)[source]
get_dataset_collection(trans, encoded_id)[source]
get_dataset_collection_instance(trans, instance_type, id, **kwds)[source]
history_dataset_collections(history, query)[source]
match_collections(collections_to_match)[source]

May seem odd to place it here, but planning to grow sophistication and get plugin types involved so it will likely make sense in the future.

set_collection_elements(dataset_collection, dataset_instances)[source]
update(trans, instance_type, id, payload)[source]
collections_util Module
galaxy.managers.collections_util.api_payload_to_create_params(payload)[source]

Cleanup API payload to pass into dataset_collections.

galaxy.managers.collections_util.dictify_dataset_collection_instance(dataset_collection_instance, parent, security, view='element')[source]
galaxy.managers.collections_util.dictify_element(element)[source]
galaxy.managers.collections_util.validate_input_element_identifiers(element_identifiers)[source]

Scan through the list of element identifiers supplied by the API consumer and verify the structure is valid.

context Module

Mixins for transaction-like objects.

class galaxy.managers.context.ProvidesAppContext[source]

Bases: object

For transaction-like objects to provide Galaxy convience layer for database and event handling.

Mixed in class must provide app property.

expunge_all()[source]
get_toolbox()[source]

Returns the application toolbox

install_model
log_action(user=None, action=None, context=None, params=None)[source]

Application-level logging of user actions.

log_event(message, tool_id=None, **kwargs)[source]

Application level logging. Still needs fleshing out (log levels and such) Logging events is a config setting - if False, do not log.

model
request_types()[source]
sa_session

Returns a SQLAlchemy session – currently just gets the current session from the threadlocal session context, but this is provided to allow migration toward a more SQLAlchemy 0.4 style of use.

class galaxy.managers.context.ProvidesHistoryContext[source]

Bases: object

For transaction-like objects to provide Galaxy convience layer for reasoning about histories.

Mixed in class must provide user, history, and app properties.

db_builds

Returns the builds defined by galaxy and the builds defined by the user (chromInfo in history).

db_dataset_for(dbkey)[source]

Returns the db_file dataset associated/needed by dataset, or None.

class galaxy.managers.context.ProvidesUserContext[source]

Bases: object

For transaction-like objects to provide Galaxy convience layer for reasoning about users.

Mixed in class must provide user, api_inherit_admin, and app properties.

anonymous
get_current_user_roles()[source]
user_can_do_run_as()[source]
user_ftp_dir
user_is_admin()[source]
folders Module

Manager and Serializer for Library Folders.

class galaxy.managers.folders.FolderManager[source]

Bases: object

Interface/service object for interacting with folders.

can_add_item(trans, folder)[source]

Return true if the user has permissions to add item to the given folder.

check_accessible(trans, folder)[source]

Check whether the folder is accessible to current user. By default every folder is accessible (contents have their own permissions).

check_manageable(trans, folder)[source]

Check whether the user can manage the folder.

Returns:the original folder
Return type:LibraryFolder
Raises:AuthenticationRequired, InsufficientPermissionsException
create(trans, parent_folder_id, new_folder_name, new_folder_description='')[source]

Create a new folder under the given folder.

Parameters:
  • parent_folder_id (int) – decoded id
  • new_folder_name (str) – name of the new folder
  • new_folder_description (str) – description of the folder (optional, defaults to empty string)
Returns:

the new folder

Return type:

LibraryFolder

Raises:

InsufficientPermissionsException

cut_and_decode(trans, encoded_folder_id)[source]

Cuts the folder prefix (the prepended ‘F’) and returns the decoded id.

Parameters:encoded_folder_id (string) – encoded id of the Folder object
Returns:decoded Folder id
Return type:int
cut_the_prefix(encoded_folder_id)[source]

Remove the prefix from the encoded folder id.

Parameters:encoded_folder_id (string) – encoded id of the Folder object with ‘F’ prepended
Returns:encoded Folder id without the ‘F’ prefix
Return type:string
Raises:MalformedId
decode_folder_id(trans, encoded_folder_id)[source]

Decode the folder id given that it has already lost the prefixed ‘F’.

Parameters:encoded_folder_id (string) – encoded id of the Folder object
Returns:decoded Folder id
Return type:int
Raises:MalformedId
delete(trans, folder, undelete=False)[source]

Mark given folder deleted/undeleted based on the flag.

Parameters:
  • folder (LibraryFolder) – the model object
  • undelete (Bool) – flag whether to delete (when False) or undelete
Returns:

the folder

Return type:

LibraryFolder

Raises:

ItemAccessibilityException

get(trans, decoded_folder_id, check_manageable=False, check_accessible=True)[source]

Get the folder from the DB.

Parameters:
  • decoded_folder_id (int) – decoded folder id
  • check_manageable (bool) – flag whether the check that user can manage item
  • check_accessible (bool) – flag whether to check that user can access item
Returns:

the requested folder

Return type:

LibraryFolder

Raises:

InconsistentDatabase, RequestParameterInvalidException, InternalServerError

get_current_roles(trans, folder)[source]

Find all roles currently connected to relevant permissions on the folder.

Parameters:folder (LibraryFolder) – the model object
Returns:dict of current roles for all available permission types
Return type:dictionary
get_folder_dict(trans, folder)[source]

Return folder data in the form of a dictionary.

Parameters:folder (LibraryFolder) – folder item
Returns:dict with data about the folder
Return type:dictionary
secure(trans, folder, check_manageable=True, check_accessible=True)[source]

Check if (a) user can manage folder or (b) folder is accessible to user.

Parameters:
  • folder (LibraryFolder) – folder item
  • check_manageable (bool) – flag whether to check that user can manage item
  • check_accessible (bool) – flag whether to check that user can access item
Returns:

the original folder

Return type:

LibraryFolder

hdas Module

Manager and Serializer for HDAs.

HistoryDatasetAssociations (HDAs) are datasets contained or created in a history.

class galaxy.managers.hdas.HDADeserializer(app)[source]

Bases: galaxy.managers.datasets.DatasetAssociationDeserializer, galaxy.managers.taggable.TaggableDeserializerMixin, galaxy.managers.annotatable.AnnotatableDeserializerMixin

Interface/service object for validating and deserializing dictionaries into histories.

add_deserializers()[source]
model_manager_class

alias of HDAManager

class galaxy.managers.hdas.HDAFilterParser(app)[source]

Bases: galaxy.managers.datasets.DatasetAssociationFilterParser, galaxy.managers.taggable.TaggableFilterMixin, galaxy.managers.annotatable.AnnotatableFilterMixin

model_class

alias of HistoryDatasetAssociation

class galaxy.managers.hdas.HDAManager(app)[source]

Bases: galaxy.managers.datasets.DatasetAssociationManager, galaxy.managers.secured.OwnableManagerMixin, galaxy.managers.taggable.TaggableManagerMixin, galaxy.managers.annotatable.AnnotatableManagerMixin

Interface/service object for interacting with HDAs.

annotation_assoc

alias of HistoryDatasetAssociationAnnotationAssociation

copy(hda, history=None, **kwargs)[source]

Copy and return the given HDA.

copy_ldda(history, ldda, **kwargs)[source]

Copy this HDA as a LDDA and return.

create(history=None, dataset=None, flush=True, **kwargs)[source]

Create a new hda optionally passing in it’s history and dataset.

..note: to explicitly set hid to None you must pass in hid=None, otherwise it will be automatically set.

data_conversion_status(hda)[source]

Returns a message if an hda is not ready to be used in visualization.

error_if_uploading(hda)[source]

Raise error if HDA is still uploading.

foreign_key_name = 'history_dataset_association'
has_been_resubmitted(hda)[source]

Return True if the hda’s job was resubmitted at any point.

is_accessible(hda, user, **kwargs)[source]

Override to allow owners (those that own the associated history).

is_owner(hda, user, current_history=None, **kwargs)[source]

Use history to see if current user owns HDA.

model_class

alias of HistoryDatasetAssociation

purge(hda, current_user=None, flush=True)[source]

Purge this HDA and the dataset underlying it.

tag_assoc

alias of HistoryDatasetAssociationTagAssociation

text_data(hda, preview=True)[source]

Get data from text file, truncating if necessary.

class galaxy.managers.hdas.HDASerializer(app)[source]

Bases: galaxy.managers.datasets.DatasetAssociationSerializer, galaxy.managers.taggable.TaggableSerializerMixin, galaxy.managers.annotatable.AnnotatableSerializerMixin

add_serializers()[source]
serialize_display_apps(hda, key, trans=None, **context)[source]

Return dictionary containing new-style display app urls.

serialize_old_display_applications(hda, key, trans=None, **context)[source]

Return dictionary containing old-style display app urls.

serialize_type_id(hda, key, **context)[source]
serialize_urls(hda, key, **context)[source]

Return web controller urls useful for this HDA.

Return a list of dictionaries with links to visualization pages for those visualizations that apply to this hda.

histories Module

Manager and Serializer for histories.

Histories are containers for datasets or dataset collections created (or copied) by users over the course of an analysis.

class galaxy.managers.histories.HistoryDeserializer(app)[source]

Bases: galaxy.managers.sharable.SharableModelDeserializer, galaxy.managers.deletable.PurgableDeserializerMixin

Interface/service object for validating and deserializing dictionaries into histories.

add_deserializers()[source]
model_manager_class

alias of HistoryManager

class galaxy.managers.histories.HistoryFilters(app)[source]

Bases: galaxy.managers.sharable.SharableModelFilters, galaxy.managers.deletable.PurgableFiltersMixin

model_class

alias of History

class galaxy.managers.histories.HistoryManager(app, *args, **kwargs)[source]

Bases: galaxy.managers.sharable.SharableModelManager, galaxy.managers.deletable.PurgableManagerMixin

annotation_assoc

alias of HistoryAnnotationAssociation

by_user(user, current_history=None, **kwargs)[source]

Get all the histories for a given user (allowing anon users’ theirs) ordered by update time.

copy(history, user, **kwargs)[source]

Copy and return the given history.

foreign_key_name = 'history'
get_current(trans)[source]

Return the current history.

is_owner(history, user, current_history=None, **kwargs)[source]

True if the current user is the owner of the given history.

model_class

alias of History

most_recent(user, filters=None, current_history=None, **kwargs)[source]

Return the most recently update history for the user.

If user is anonymous, return the current history. If the user is anonymous and the current history is deleted, return None.

purge(history, flush=True, **kwargs)[source]

Purge this history and all HDAs, Collections, and Datasets inside this history.

rating_assoc

alias of HistoryRatingAssociation

set_current(trans, history)[source]

Set the current history.

set_current_by_id(trans, history_id)[source]

Set the current history by an id.

tag_assoc

alias of HistoryTagAssociation

user_share_model

alias of HistoryUserShareAssociation

class galaxy.managers.histories.HistorySerializer(app)[source]

Bases: galaxy.managers.sharable.SharableModelSerializer, galaxy.managers.deletable.PurgableSerializerMixin

Interface/service object for serializing histories into dictionaries.

SINGLE_CHAR_ABBR = 'h'
add_serializers()[source]
serialize_contents(history, *args, **context)[source]
serialize_history_state(history, key, **context)[source]

Returns the history state based on the states of the HDAs it contains.

serialize_state_counts(history, key, exclude_deleted=True, exclude_hidden=False, **context)[source]

Return a dictionary keyed to possible dataset states and valued with the number of datasets in this history that have those states.

serialize_state_ids(history, key, **context)[source]

Return a dictionary keyed to possible dataset states and valued with lists containing the ids of each HDA in that state.

lddas Module
class galaxy.managers.lddas.LDDAManager(app)[source]

Bases: object

A fairly sparse manager for LDDAs.

get(trans, id, check_accessible=True)[source]
libraries Module

Manager and Serializer for libraries.

class galaxy.managers.libraries.LibraryManager(*args, **kwargs)[source]

Bases: object

Interface/service object for interacting with libraries.

check_accessible(trans, library)[source]

Check whether the library is accessible to current user.

create(trans, name, description='', synopsis='')[source]

Create a new library.

delete(trans, library, undelete=False)[source]

Mark given library deleted/undeleted based on the flag.

get(trans, decoded_library_id, check_accessible=True)[source]

Get the library from the DB.

Parameters:
  • decoded_library_id (int) – decoded library id
  • check_accessible (bool) – flag whether to check that user can access item
Returns:

the requested library

Return type:

Library

get_access_roles(trans, library)[source]

Load access roles for all library permissions

get_add_roles(trans, library)[source]

Load add roles for all library permissions

get_current_roles(trans, library)[source]

Load all permissions currently related to the given library.

Parameters:library (Library) – the model object
Return type:dictionary
Returns:dict of current roles for all available permission types
get_library_dict(trans, library)[source]

Return library data in the form of a dictionary.

Parameters:library (Library) – library
Returns:dict with data about the library
Return type:dictionary
get_manage_roles(trans, library)[source]

Load manage roles for all library permissions

get_modify_roles(trans, library)[source]

Load modify roles for all library permissions

is_public(trans, library)[source]

Return true if lib is public.

list(trans, deleted=False)[source]

Return a list of libraries from the DB.

Parameters:deleted (boolean (optional)) – if True, show only deleted libraries, if False show only non-deleted
Returns:query that will emit all accessible libraries
Return type:sqlalchemy query
make_public(trans, library)[source]

Makes the given library public (removes all access roles)

secure(trans, library, check_accessible=True)[source]

Check if library is accessible to user.

Parameters:
  • folder (Library) – library
  • check_accessible (bool) – flag whether to check that user can access library
Returns:

the original folder

Return type:

LibraryFolder

set_permission_roles(trans, library, access_roles, modify_roles, manage_roles, add_roles)[source]

Set permissions on the given library.

update(trans, library, name=None, description=None, synopsis=None)[source]

Update the given library

roles Module

Manager and Serializer for Roles.

class galaxy.managers.roles.RoleManager(app)[source]

Bases: galaxy.managers.base.ModelManager

Business logic for roles.

foreign_key_name = 'role'
get(trans, decoded_role_id)[source]

Method loads the role from the DB based on the given role id.

Parameters:decoded_role_id (int) – id of the role to load from the DB
Returns:the loaded Role object
Return type:Role
Raises:InconsistentDatabase, RequestParameterInvalidException, InternalServerError
group_assoc

alias of GroupRoleAssociation

model_class

alias of Role

user_assoc

alias of UserRoleAssociation

tags Module
class galaxy.managers.tags.CommunityTagManager(app)[source]

Bases: galaxy.managers.tags.TagManager

class galaxy.managers.tags.GalaxyTagManager(app)[source]

Bases: galaxy.managers.tags.TagManager

class galaxy.managers.tags.ItemTagAssocInfo(item_class, tag_assoc_class, item_id_col)[source]

Bases: object

class galaxy.managers.tags.TagManager(app)[source]

Bases: object

Manages CRUD operations related to tagging objects.

apply_item_tag(user, item, name, value=None)[source]
apply_item_tags(user, item, tags_str)[source]

Apply tags to an item.

delete_item_tags(user, item)[source]

Delete tags from an item.

get_community_tags(item=None, limit=None)[source]

Returns community tags for an item.

get_id_col_in_item_tag_assoc_table(item_class)[source]

Returns item id column in class’ item-tag association table.

get_tag_assoc_class(item_class)[source]

Returns tag association class for item class.

get_tag_by_id(tag_id)[source]

Get a Tag object from a tag id.

get_tag_by_name(tag_name)[source]

Get a Tag object from a tag name (string).

get_tags_str(tags)[source]

Build a string from an item’s tags.

get_tool_tags()[source]
item_has_tag(user, item, tag)[source]

Returns true if item is has a given tag.

parse_tags(tag_str)[source]

Returns a list of raw (tag-name, value) pairs derived from a string; method scrubs tag names and values as well. Return value is a dictionary where tag-names are keys.

remove_item_tag(user, item, tag_name)[source]

Remove a tag from an item.

set_tags_from_list(user, item, new_tags_list)[source]
workflows Module
class galaxy.managers.workflows.CreatedWorkflow(stored_workflow, missing_tools)

Bases: tuple

missing_tools

Alias for field number 1

stored_workflow

Alias for field number 0

class galaxy.managers.workflows.MissingToolsException(workflow, errors)[source]

Bases: object

class galaxy.managers.workflows.WorkflowContentsManager[source]

Bases: galaxy.model.item_attrs.UsesAnnotations

build_workflow_from_dict(trans, data, source=None, add_to_menu=False, publish=False)[source]
update_workflow_from_dict(trans, stored_workflow, workflow_data, from_editor=False)[source]
workflow_to_dict(trans, stored, style='export')[source]

Export the workflow contents to a dictionary ready for JSON-ification and to be sent out via API for instance. There are three styles of export allowed ‘export’, ‘instance’, and ‘editor’. The Galaxy team will do it best to preserve the backward compatibility of the ‘export’ stye - this is the export method meant to be portable across Galaxy instances and over time. The ‘editor’ style is subject to rapid and unannounced changes. The ‘instance’ export option describes the workflow in a context more tied to the current Galaxy instance and includes fields like ‘url’ and ‘url’ and actual unencoded step ids instead of ‘order_index’.

class galaxy.managers.workflows.WorkflowsManager(app)[source]

Bases: object

Handle CRUD type operaitons related to workflows. More interesting stuff regarding workflow execution, step sorting, etc... can be found in the galaxy.workflow module.

build_invocations_query(trans, decoded_stored_workflow_id)[source]
cancel_invocation(trans, decoded_invocation_id)[source]
check_security(trans, has_workflow, check_ownership=True, check_accessible=True)[source]

check accessibility or ownership of workflows, storedworkflows, and workflowinvocations. Throw an exception or returns True if user has needed level of access.

get_invocation(trans, decoded_invocation_id)[source]
get_invocation_step(trans, decoded_workflow_invocation_step_id)[source]
update_invocation_step(trans, decoded_workflow_invocation_step_id, action)[source]
objectstore Package
objectstore Package

objectstore package, abstraction for storing blobs of data for use in Galaxy, all providers ensure that data can be accessed on the filesystem for running tools

class galaxy.objectstore.CachingObjectStore(path, backend)[source]

Bases: galaxy.objectstore.ObjectStore

Object store that uses a directory for caching files, but defers and writes back to another object store.

class galaxy.objectstore.DiskObjectStore(config, config_xml=None, file_path=None, extra_dirs=None)[source]

Bases: galaxy.objectstore.ObjectStore

Standard Galaxy object store, stores objects in files under a specific directory on disk.

>>> from galaxy.util.bunch import Bunch
>>> import tempfile
>>> file_path=tempfile.mkdtemp()
>>> obj = Bunch(id=1)
>>> s = DiskObjectStore(Bunch(umask=077, job_working_directory=file_path, new_file_path=file_path, object_store_check_old_style=False), file_path=file_path)
>>> s.create(obj)
>>> s.exists(obj)
True
>>> assert s.get_filename(obj) == file_path + '/000/dataset_1.dat'
create(obj, **kwargs)[source]
delete(obj, entire_dir=False, **kwargs)[source]
empty(obj, **kwargs)[source]
exists(obj, **kwargs)[source]
get_data(obj, start=0, count=-1, **kwargs)[source]
get_filename(obj, **kwargs)[source]
get_object_url(obj, **kwargs)[source]
get_store_usage_percent()[source]
size(obj, **kwargs)[source]
update_from_file(obj, file_name=None, create=False, **kwargs)[source]

create parameter is not used in this implementation

class galaxy.objectstore.DistributedObjectStore(config, config_xml=None, fsmon=False)[source]

Bases: galaxy.objectstore.NestedObjectStore

ObjectStore that defers to a list of backends, for getting objects the first store where the object exists is used, objects are created in a store selected randomly, but with weighting.

create(obj, **kwargs)[source]

create() is the only method in which obj.object_store_id may be None

shutdown()[source]
class galaxy.objectstore.HierarchicalObjectStore(config, config_xml=None, fsmon=False)[source]

Bases: galaxy.objectstore.NestedObjectStore

ObjectStore that defers to a list of backends, for getting objects the first store where the object exists is used, objects are always created in the first store.

create(obj, **kwargs)[source]

Create will always be called by the primary object_store

exists(obj, **kwargs)[source]

Exists must check all child object stores

class galaxy.objectstore.NestedObjectStore(config, config_xml=None)[source]

Bases: galaxy.objectstore.ObjectStore

Base for ObjectStores that use other ObjectStores (DistributedObjectStore, HierarchicalObjectStore)

create(obj, **kwargs)[source]
delete(obj, **kwargs)[source]
empty(obj, **kwargs)[source]
exists(obj, **kwargs)[source]
file_ready(obj, **kwargs)[source]
get_data(obj, **kwargs)[source]
get_filename(obj, **kwargs)[source]
get_object_url(obj, **kwargs)[source]
shutdown()[source]
size(obj, **kwargs)[source]
update_from_file(obj, **kwargs)[source]
class galaxy.objectstore.ObjectStore(config, config_xml=None, **kwargs)[source]

Bases: object

ObjectStore abstract interface

create(obj, base_dir=None, dir_only=False, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

Mark the object identified by obj as existing in the store, but with no content. This method will create a proper directory structure for the file if the directory does not already exist. See exists method for the description of other fields.

delete(obj, entire_dir=False, base_dir=None, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

Deletes the object identified by obj. See exists method for the description of other fields.

Parameters:entire_dir (bool) – If True, delete the entire directory pointed to by extra_dir. For safety reasons, this option applies only for and in conjunction with the extra_dir or obj_dir options.
empty(obj, base_dir=None, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

Test if the object identified by obj has content. If the object does not exist raises ObjectNotFound. See exists method for the description of the fields.

exists(obj, base_dir=None, dir_only=False, extra_dir=None, extra_dir_at_root=False, alt_name=None)[source]

Returns True if the object identified by obj exists in this file store, False otherwise.

FIELD DESCRIPTIONS (these apply to all the methods in this class):

Parameters:
  • obj (object) – A Galaxy object with an assigned database ID accessible via the .id attribute.
  • base_dir (string) – A key in self.extra_dirs corresponding to the base directory in which this object should be created, or None to specify the default directory.
  • dir_only (bool) – If True, check only the path where the file identified by obj should be located, not the dataset itself. This option applies to extra_dir argument as well.
  • extra_dir (string) – Append extra_dir to the directory structure where the dataset identified by obj should be located. (e.g., 000/extra_dir/obj.id)
  • extra_dir_at_root (bool) – Applicable only if extra_dir is set. If True, the extra_dir argument is placed at root of the created directory structure rather than at the end (e.g., extra_dir/000/obj.id vs. 000/extra_dir/obj.id)
  • alt_name (string) – Use this name as the alternative name for the created dataset rather than the default.
  • obj_dir (bool) – Append a subdirectory named with the object’s ID (e.g. 000/obj.id)
file_ready(obj, base_dir=None, dir_only=False, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

A helper method that checks if a file corresponding to a dataset is ready and available to be used. Return True if so, False otherwise.

get_data(obj, start=0, count=-1, base_dir=None, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

Fetch count bytes of data starting at offset start from the object identified uniquely by obj. If the object does not exist raises ObjectNotFound. See exists method for the description of other fields.

Parameters:
  • start (int) – Set the position to start reading the dataset file
  • count (int) – Read at most count bytes from the dataset
get_filename(obj, base_dir=None, dir_only=False, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

Get the expected filename (including the absolute path) which can be used to access the contents of the object uniquely identified by obj. See exists method for the description of the fields.

get_object_url(obj, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

If the store supports direct URL access, return a URL. Otherwise return None. Note: need to be careful to to bypass dataset security with this. See exists method for the description of the fields.

get_store_usage_percent()[source]

Return the percentage indicating how full the store is

shutdown()[source]
size(obj, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False)[source]

Return size of the object identified by obj. If the object does not exist, return 0. See exists method for the description of the fields.

update_from_file(obj, base_dir=None, extra_dir=None, extra_dir_at_root=False, alt_name=None, obj_dir=False, file_name=None, create=False)[source]

Inform the store that the file associated with the object has been updated. If file_name is provided, update from that file instead of the default. If the object does not exist raises ObjectNotFound. See exists method for the description of other fields.

Parameters:
  • file_name (string) – Use file pointed to by file_name as the source for updating the dataset identified by obj
  • create (bool) – If True and the default dataset does not exist, create it first.
galaxy.objectstore.build_object_store_from_config(config, fsmon=False, config_xml=None)[source]

Depending on the configuration setting, invoke the appropriate object store

galaxy.objectstore.convert_bytes(bytes)[source]

A helper function used for pretty printing disk usage

galaxy.objectstore.create_object_in_session(obj)[source]
galaxy.objectstore.local_extra_dirs(func)[source]

A decorator for non-local plugins to utilize local directories for their extra_dirs (job_working_directory and temp).

s3_multipart_upload Module

Split large file into multiple pieces for upload to S3. This parallelizes the task over available cores using multiprocessing. Code mostly taken form CloudBioLinux.

galaxy.objectstore.s3_multipart_upload.map_wrap(f)[source]
galaxy.objectstore.s3_multipart_upload.mp_from_ids(s3server, mp_id, mp_keyname, mp_bucketname)[source]

Get the multipart upload from the bucket and multipart IDs.

This allows us to reconstitute a connection to the upload from within multiprocessing functions.

galaxy.objectstore.s3_multipart_upload.multimap(*args, **kwds)[source]

Provide multiprocessing imap like function.

The context manager handles setting up the pool, worked around interrupt issues and terminating the pool on completion.

galaxy.objectstore.s3_multipart_upload.multipart_upload(s3server, bucket, s3_key_name, tarball, mb_size)[source]

Upload large files using Amazon’s multipart upload functionality.

galaxy.objectstore.s3_multipart_upload.transfer_part(*args, **kwargs)[source]

Transfer a part of a multipart upload. Designed to be run in parallel.

openid Package
openid Package

OpenID functionality

providers Module

Contains OpenID provider functionality

class galaxy.openid.providers.OpenIDProvider(id, name, op_endpoint_url, sreg_required=None, sreg_optional=None, use_for=None, store_user_preference=None, never_associate_with_user=None)[source]

Bases: object

An OpenID Provider object.

classmethod from_elem(xml_root)[source]
classmethod from_file(filename)[source]
has_post_authentication_actions()[source]
post_authentication(trans, openid_manager, info)[source]
class galaxy.openid.providers.OpenIDProviders(providers=None)[source]

Bases: object

Collection of OpenID Providers

NO_PROVIDER_ID = 'None'
classmethod from_elem(xml_root)[source]
classmethod from_file(filename)[source]
get(name, default=None)[source]
new_provider_from_identifier(identifier)[source]
quota Package
quota Package

Galaxy Quotas

class galaxy.quota.NoQuotaAgent(model)[source]

Bases: object

Base quota agent, always returns no quota

default_quota
get_percent(trans=None, user=False, history=False, usage=False, quota=False)[source]
get_quota(user, nice_size=False)[source]
get_usage(trans=None, user=False, history=False)[source]
get_user_quotas(user)[source]
class galaxy.quota.QuotaAgent(model)[source]

Bases: galaxy.quota.NoQuotaAgent

Class that handles galaxy quotas

default_registered_quota
default_unregistered_quota
get_percent(trans=None, user=False, history=False, usage=False, quota=False)[source]

Return the percentage of any storage quota applicable to the user/transaction.

get_quota(user, nice_size=False)[source]

Calculated like so:

  1. Anonymous users get the default quota.
  2. Logged in users start with the highest of their associated ‘=’ quotas or the default quota, if there are no associated ‘=’ quotas. If an ‘=’ unlimited (-1 in the database) quota is found during this process, the user has no quota (aka unlimited).
  3. Quota is increased or decreased by any corresponding ‘+’ or ‘-‘ quotas.
get_user_quotas(user)[source]
set_default_quota(default_type, quota)[source]
set_entity_quota_associations(quotas=[], users=[], groups=[], delete_existing_assocs=True)[source]
sample_tracking Package
data_transfer Module
class galaxy.sample_tracking.data_transfer.DataTransferFactory[source]

Bases: object

parse()[source]
type = None
class galaxy.sample_tracking.data_transfer.FtpDataTransferFactory[source]

Bases: galaxy.sample_tracking.data_transfer.DataTransferFactory

parse(elem)[source]
type = 'ftp'
class galaxy.sample_tracking.data_transfer.HttpDataTransferFactory[source]

Bases: galaxy.sample_tracking.data_transfer.DataTransferFactory

parse(config_file, elem)[source]
type = 'http'
class galaxy.sample_tracking.data_transfer.ScpDataTransferFactory[source]

Bases: galaxy.sample_tracking.data_transfer.DataTransferFactory

parse(config_file, elem)[source]
type = 'scp'
galaxy.sample_tracking.data_transfer.data_transfer

alias of FtpDataTransferFactory

external_service_types Module
class galaxy.sample_tracking.external_service_types.ExternalServiceType(external_service_type_xml_config, root, visible=True)[source]

Bases: object

parse(root)[source]
parse_data_transfer_settings(root)[source]
parse_run_details(root)[source]
parse_run_details_results(root)[source]
exception galaxy.sample_tracking.external_service_types.ExternalServiceTypeNotFoundException[source]

Bases: exceptions.Exception

class galaxy.sample_tracking.external_service_types.ExternalServiceTypesCollection(config_filename, root_dir, app)[source]

Bases: object

load_all(config_filename)[source]
load_external_service_type(config_file, visible=True)[source]
reload(external_service_type_id)[source]

Attempt to reload the external_service_type identified by ‘external_service_type_id’, if successful replace the old external_service_type.

request_types Module

RequestType

class galaxy.sample_tracking.request_types.RequestTypeFactory(sample_state_factory, rename_dataset_options)[source]

Bases: object

from_elem(elem, request_form, sample_form, external_service)[source]

Return RequestType created from an xml string.

new(name, request_form, sample_form, external_service, description=None, sample_states=None)[source]

Return new RequestType.

sample Module

Sample

class galaxy.sample_tracking.sample.SampleStateFactory[source]

Bases: object

from_elem(request_type, elem)[source]

Return SampleState created from an xml string.

new(request_type, name, description=None)[source]

Return new SampleState.

security Package
security Package

Galaxy Security

class galaxy.security.Action(action, description, model)[source]

Bases: object

class galaxy.security.GalaxyRBACAgent(model, permitted_actions=None)[source]

Bases: galaxy.security.RBACAgent

allow_action(roles, action, item)[source]

Method for checking a permission for the current user ( based on roles ) to perform a specific action on an item, which must be one of: Dataset, Library, LibraryFolder, LibraryDataset, LibraryDatasetDatasetAssociation

allow_action_on_libitems(trans, user_roles, action, items)[source]

This should be the equivalent of allow_action defined on multiple items. It is meant to specifically replace allow_action for multiple LibraryDatasets, but it could be reproduced or modified for allow_action’s permitted classes - Dataset, Library, LibraryFolder, and LDDAs.

associate_action_dataset_role(action, dataset, role)[source]
associate_components(**kwd)[source]
associate_group_role(group, role)[source]
associate_user_group(user, group)[source]
associate_user_role(user, role)[source]
can_access_dataset(user_roles, dataset)[source]
can_access_library(roles, library)[source]
can_access_library_item(roles, item, user)[source]
can_access_request_type(roles, request_type)[source]
can_add_library_item(roles, item)[source]
can_manage_dataset(roles, dataset)[source]
can_manage_library_item(roles, item)[source]
can_modify_library_item(roles, item)[source]
check_folder_contents(user, roles, folder, hidden_folder_ids='')[source]

This method must always be sent an instance of LibraryFolder(). Recursive execution produces a comma-separated string of folder ids whose folders do NOT meet the criteria for showing. Along with the string, True is returned if the current user has permission to access folder. Otherwise, cycle through all sub-folders in folder until one is found that meets this criteria, if it exists. This method does not necessarily scan the entire library as it returns when it finds the first folder that is accessible to user.

copy_dataset_permissions(src, dst)[source]
copy_library_permissions(trans, source_library_item, target_library_item, user=None)[source]
create_private_user_role(user)[source]
dataset_access_mapping(trans, user_roles, datasets)[source]

For the given list of datasets, return a mapping of the datasets’ ids to whether they can be accessed by the user or not. The datasets input is expected to be a simple list of Dataset objects.

dataset_is_private_to_user(trans, dataset)[source]

If the LibraryDataset object has exactly one access role and that is the current user’s private role then we consider the dataset private.

dataset_is_public(dataset)[source]

A dataset is considered public if there are no “access” actions associated with it. Any other actions ( ‘manage permissions’, ‘edit metadata’ ) are irrelevant. Accessing dataset.actions will cause a query to be emitted.

dataset_is_unrestricted(trans, dataset)[source]

Different implementation of the method above with signature: def dataset_is_public( self, dataset )

dataset_permission_map_for_access(trans, user_roles, libitems)[source]

For a given list of library items (e.g., Datasets), return a map of the datasets’ ids to whether they can have permission to use that action (e.g., “access” or “modify”) on the dataset. The libitems input is expected to be a simple list of library items, such as Datasets or LibraryDatasets. NB: This is currently only usable for Datasets; it was intended to be used for any library item.

datasets_are_public(trans, datasets)[source]

Given a transaction object and a list of Datasets, return a mapping from Dataset ids to whether the Dataset is public or not. All Dataset ids should be returned in the mapping’s keys.

derive_roles_from_access(trans, item_id, cntrller, library=False, **kwd)[source]
folder_is_public(folder)[source]
folder_is_unrestricted(folder)[source]
get_accessible_libraries(trans, user)[source]

Return all data libraries that the received user can access

get_accessible_request_types(trans, user)[source]

Return all RequestTypes that the received user has permission to access.

get_actions_for_items(trans, action, permission_items)[source]
get_all_roles(trans, cntrller)[source]
get_component_associations(**kwd)[source]
get_item_actions(action, item)[source]
get_legitimate_roles(trans, item, cntrller)[source]

Return a sorted list of legitimate roles that can be associated with a permission on item where item is a Library or a Dataset. The cntrller param is the controller from which the request is sent. We cannot use trans.user_is_admin() because the controller is what is important since admin users do not necessarily have permission to do things on items outside of the admin view.

If cntrller is from the admin side ( e.g., library_admin ):

  • if item is public, all roles, including private roles, are legitimate.
  • if item is restricted, legitimate roles are derived from the users and groups associated with each role that is associated with the access permission ( i.e., DATASET_MANAGE_PERMISSIONS or LIBRARY_MANAGE ) on item. Legitimate roles will include private roles.

If cntrller is not from the admin side ( e.g., root, library ):

  • if item is public, all non-private roles, except for the current user’s private role, are legitimate.
  • if item is restricted, legitimate roles are derived from the users and groups associated with each role that is associated with the access permission on item. Private roles, except for the current user’s private role, will be excluded.
get_permissions(item)[source]

Return a dictionary containing the actions and associated roles on item where item is one of Library, LibraryFolder, LibraryDatasetDatasetAssociation, LibraryDataset, Dataset. The dictionary looks like: { Action : [ Role, Role ] }.

get_permitted_libraries(trans, user, actions)[source]

This method is historical (it is not currently used), but may be useful again at some point. It returns a dictionary whose keys are library objects and whose values are a comma-separated string of folder ids. This method works with the show_library_item() method below, and it returns libraries for which the received user has permission to perform the received actions. Here is an example call to this method to return all libraries for which the received user has LIBRARY_ADD permission:

libraries = trans.app.security_agent.get_permitted_libraries( trans, user,
    [ trans.app.security_agent.permitted_actions.LIBRARY_ADD ] )
get_private_user_role(user, auto_create=False)[source]
get_roles_for_action(item, action)[source]

Return a list containing the roles associated with given action on given item where item is one of Library, LibraryFolder, LibraryDatasetDatasetAssociation, LibraryDataset, Dataset.

get_sharing_roles(user)[source]
get_showable_folders(user, roles, library_item, actions_to_check, hidden_folder_ids=[], showable_folders=[])[source]

This method must be sent an instance of Library(), all the folders of which are scanned to determine if user is allowed to perform any action in actions_to_check. The param hidden_folder_ids, if passed, should contain a list of folder IDs which was generated when the library was previously scanned using the same actions_to_check. A list of showable folders is generated. This method scans the entire library.

get_valid_roles(trans, item, query=None, page=None, page_limit=None, is_library_access=False)[source]

This method retrieves the list of possible roles that user can select in the item permissions form. Admins can select any role so the results are paginated in order to save the bandwidth and to speed things up. Standard users can select their own private role, any of their sharing roles and any public role (not private and not sharing).

guess_derived_permissions_for_datasets(datasets=[])[source]

Returns a dict of { action : [ role, role, ... ] } for the output dataset based upon provided datasets

has_accessible_folders(trans, folder, user, roles, search_downward=True)[source]
has_accessible_library_datasets(trans, folder, user, roles, search_downward=True)[source]
history_get_default_permissions(history)[source]
history_set_default_permissions(history, permissions={}, dataset=False, bypass_manage_permission=False)[source]
item_permission_map_for_add(trans, user_roles, libitems)[source]
item_permission_map_for_manage(trans, user_roles, libitems)[source]
item_permission_map_for_modify(trans, user_roles, libitems)[source]
library_is_public(library, contents=False)[source]
library_is_unrestricted(library)[source]
make_dataset_public(dataset)[source]
make_folder_public(folder)[source]
make_library_public(library, contents=False)[source]
ok_to_display(user, role)[source]

Method for checking if: - a role is private and is the current user’s private role - a role is a sharing role and belongs to the current user

privately_share_dataset(dataset, users=[])[source]
sa_session

Returns a SQLAlchemy session

set_all_dataset_permissions(dataset, permissions={})[source]

Set new full permissions on a dataset, eliminating all current permissions. Permission looks like: { Action : [ Role, Role ] }

set_all_library_permissions(trans, library_item, permissions={})[source]
set_dataset_permission(dataset, permission={})[source]

Set a specific permission on a dataset, leaving all other current permissions on the dataset alone. Permission looks like: { Action.action : [ Role, Role ] }

set_entity_group_associations(groups=[], users=[], roles=[], delete_existing_assocs=True)[source]
set_entity_role_associations(roles=[], users=[], groups=[], delete_existing_assocs=True)[source]
set_entity_user_associations(users=[], roles=[], groups=[], delete_existing_assocs=True)[source]
set_library_item_permission(library_item, permission={})[source]

Set a specific permission on a library item, leaving all other current permissions on the item alone. Permission looks like: { Action.action : [ Role, Role ] }

set_request_type_permissions(request_type, permissions={})[source]
show_library_item(user, roles, library_item, actions_to_check, hidden_folder_ids='')[source]

This method must be sent an instance of Library() or LibraryFolder(). Recursive execution produces a comma-separated string of folder ids whose folders do NOT meet the criteria for showing. Along with the string, True is returned if the current user has permission to perform any 1 of actions_to_check on library_item. Otherwise, cycle through all sub-folders in library_item until one is found that meets this criteria, if it exists. This method does not necessarily scan the entire library as it returns when it finds the first library_item that allows user to perform any one action in actions_to_check.

sort_by_attr(seq, attr)[source]

Sort the sequence of objects by object’s attribute Arguments: seq - the list or any sequence (including immutable one) of objects to sort. attr - the name of attribute to sort by

user_get_default_permissions(user)[source]
user_set_default_permissions(user, permissions={}, history=False, dataset=False, bypass_manage_permission=False, default_access_private=False)[source]
class galaxy.security.HostAgent(model, permitted_actions=None)[source]

Bases: galaxy.security.RBACAgent

A simple security agent which allows access to datasets based on host. This exists so that externals sites such as UCSC can gain access to datasets which have permissions which would normally prevent such access.

allow_action(addr, action, **kwd)[source]
sa_session

Returns a SQLAlchemy session

set_dataset_permissions(hda, user, site)[source]
sites = <galaxy.util.bunch.Bunch object>
class galaxy.security.RBACAgent[source]

Class that handles galaxy security

associate_components(**kwd)[source]
can_access_dataset(roles, dataset)[source]
can_access_library(roles, library)[source]
can_add_library_item(roles, item)[source]
can_manage_dataset(roles, dataset)[source]
can_manage_library_item(roles, item)[source]
can_modify_library_item(roles, item)[source]
components_are_associated(**kwd)[source]
convert_permitted_action_strings(permitted_action_strings)[source]

When getting permitted actions from an untrusted source like a form, ensure that they match our actual permitted actions.

create_private_user_role(user)[source]
dataset_is_public(dataset)[source]
derive_roles_from_access(trans, item_id, cntrller, library=False, **kwd)[source]
folder_is_public(library)[source]
get_accessible_libraries(trans, user)[source]
get_accessible_request_types(trans, user)[source]
get_action(name, default=None)[source]

Get a permitted action by its dict key or action name

get_actions()[source]

Get all permitted actions as a list of Action objects

get_all_roles(trans, cntrller)[source]
get_component_associations(**kwd)[source]
get_item_actions(action, item)[source]
get_legitimate_roles(trans, item, cntrller)[source]
get_permissions(library_dataset)[source]
get_permitted_libraries(trans, user, actions)[source]
get_private_user_role(user)[source]
guess_derived_permissions_for_datasets(datasets=[])[source]
history_set_default_permissions(history, permissions=None, dataset=False, bypass_manage_permission=False)[source]
library_is_public(library)[source]
make_dataset_public(dataset)[source]
make_folder_public(folder, count=0)[source]
make_library_public(library)[source]
permitted_actions = <galaxy.util.bunch.Bunch object>
set_all_dataset_permissions(dataset, permissions)[source]
set_all_library_permissions(trans, dataset, permissions)[source]
set_dataset_permission(dataset, permission)[source]
set_library_item_permission(library_item, permission)[source]
user_set_default_permissions(user, permissions={}, history=False, dataset=False)[source]
galaxy.security.get_permitted_actions(filter=None)[source]

Utility method to return a subset of RBACAgent’s permitted actions

validate_user_input Module

Utilities for validating inputs related to user objects.

The validate_* methods in this file return simple messages that do not contain user inputs - so these methods do not need to be escaped.

galaxy.security.validate_user_input.transform_publicname(trans, publicname, user=None)[source]
galaxy.security.validate_user_input.validate_email(trans, email, user=None, check_dup=True)[source]

Validates the email format, also checks whether the domain is blacklisted in the disposable domains configuration.

galaxy.security.validate_user_input.validate_password(trans, password, confirm)[source]
galaxy.security.validate_user_input.validate_publicname(trans, publicname, user=None)[source]
tags Package
tags Package

Galaxy tagging classes and methods.

tag_handler Module
tool_shed Package
tool_shed Package
common_util Module
encoding_util Module
install_manager Module
tool_shed_registry Module
update_manager Module
Subpackages
migrate Package
check Module
common Module
tool_dependencies Package
common_util Module
fabric_util Module
install_util Module
tools Package
tools Package

Classes encapsulating galaxy tools and tool configuration.

class galaxy.tools.AsyncDataSourceTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.DataSourceTool

tool_type = 'data_source_async'
class galaxy.tools.BadValue(value)[source]

Bases: object

class galaxy.tools.DataDestinationTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.Tool

tool_type = 'data_destination'
class galaxy.tools.DataManagerTool(config_file, root, app, guid=None, data_manager_id=None, **kwds)[source]

Bases: galaxy.tools.OutputParameterJSONTool

allow_user_access(user, attempting_access=True)[source]
Parameters:
  • user (galaxy.model.User) – model object representing user.
  • attempting_access (bool) – is the user attempting to do something with the the tool (set false for incidental checks like toolbox listing)
Returns:

bool – Whether the user is allowed to access the tool.

Data Manager tools are only accessible to admins.

default_tool_action

alias of DataManagerToolAction

exec_after_process(app, inp_data, out_data, param_dict, job=None, **kwds)[source]
get_default_history_by_trans(trans, create=False)[source]
tool_type = 'manage_data'
class galaxy.tools.DataSourceTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.OutputParameterJSONTool

Alternate implementation of Tool for data_source tools – those that allow the user to query and extract data from another web site.

default_tool_action

alias of DataSourceToolAction

exec_before_job(app, inp_data, out_data, param_dict=None)[source]
parse_inputs(tool_source)[source]
tool_type = 'data_source'
class galaxy.tools.DefaultToolState[source]

Bases: object

Keeps track of the state of a users interaction with a tool between requests. The default tool state keeps track of the current page (for multipage “wizard” tools) and the values of all

copy()[source]

WARNING! Makes a shallow copy, SHOULD rework to have it make a deep copy.

decode(value, tool, app, secure=True)[source]

Restore the state from a string

encode(tool, app, secure=True)[source]

Convert the data to a string

class galaxy.tools.ExportHistoryTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.Tool

tool_type = 'export_history'
class galaxy.tools.GenomeIndexTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.Tool

tool_type = 'index_genome'
class galaxy.tools.ImportHistoryTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.Tool

tool_type = 'import_history'
exception galaxy.tools.InterruptedUpload[source]

Bases: exceptions.Exception

class galaxy.tools.OutputParameterJSONTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.Tool

Alternate implementation of Tool that provides parameters and other values JSONified within the contents of an output dataset

exec_before_job(app, inp_data, out_data, param_dict=None)[source]
tool_type = 'output_parameter_json'
class galaxy.tools.SetMetadataTool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: galaxy.tools.Tool

Tool implementation for special tool that sets metadata on an existing dataset.

exec_after_process(app, inp_data, out_data, param_dict, job=None)[source]
job_failed(job_wrapper, message, exception=False)[source]
requires_setting_metadata = False
tool_type = 'set_metadata'
class galaxy.tools.SetParamAction(name, output_name)[source]

Set parameter action.

static parse(elt)[source]

Parse action from element.

class galaxy.tools.Tool(config_file, tool_source, app, guid=None, repository_id=None, allow_code_files=True)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

Represents a computational tool that can be executed through Galaxy.

allow_user_access(user, attempting_access=True)[source]
Returns:bool – Whether the user is allowed to access the tool.
build_dependency_shell_commands()[source]

Return a list of commands to be run to populate the current environment to include this tools requirements.

build_redirect_url_params(param_dict)[source]

Substitute parameter values into self.redirect_url_params

call_hook(hook_name, *args, **kwargs)[source]

Call the custom code hook function identified by ‘hook_name’ if any, and return the results

check_and_update_param_values(values, trans, update_values=True, allow_workflow_parameters=False)[source]

Check that all parameters have values, and fill in with default values where necessary. This could be called after loading values from a database in case new parameters have been added.

check_and_update_param_values_helper(inputs, values, trans, messages, context=None, prefix='', update_values=True, allow_workflow_parameters=False)[source]

Recursive helper for check_and_update_param_values_helper

check_workflow_compatible(tool_source)[source]

Determine if a tool can be used in workflows. External tools and the upload tool are currently not supported by workflows.

collect_child_datasets(output, job_working_directory)[source]

Look for child dataset files, create HDA and attach to parent.

collect_dynamic_collections(output, **kwds)[source]

Find files corresponding to dynamically structured collections.

collect_primary_datasets(output, job_working_directory, input_ext)[source]

Find any additional datasets generated by a tool and attach (for cases where number of outputs is not known in advance).

default_template = 'tool_form.mako'
default_tool_action

alias of DefaultToolAction

dict_collection_visible_keys = ('id', 'name', 'version', 'description')
exec_after_process(app, inp_data, out_data, param_dict, job=None)[source]
exec_before_job(app, inp_data, out_data, param_dict={})[source]
execute(trans, incoming={}, set_output_hid=True, history=None, **kwargs)[source]

Execute the tool using parameter values in incoming. This just dispatches to the ToolAction instance specified by self.tool_action. In general this will create a Job that when run will build the tool’s outputs, e.g. DefaultToolAction.

fill_in_new_state(trans, inputs, state, context=None, history=None)[source]

Fill in a tool state dictionary with default values for all parameters in the dictionary inputs. Grouping elements are filled in recursively.

find_fieldstorage(x)[source]
find_output_def(name)[source]
get_default_history_by_trans(trans, create=False)[source]
classmethod get_externally_referenced_paths(path)[source]

Return relative paths to externally referenced files by the tool described by file at path. External components should not assume things about the structure of tool xml files (this is the tool’s responsibility).

get_hook(name)[source]

Returns an object from the code file referenced by code_namespace (this will normally be a callable object)

get_job_destination(job_params=None)[source]
Returns:galaxy.jobs.JobDestination – The destination definition and runner parameters.
get_job_handler(job_params=None)[source]

Get a suitable job handler for this Tool given the provided job_params. If multiple handlers are valid for combination of Tool and job_params (e.g. the defined handler is a handler tag), one will be selected at random.

Parameters:job_params (dict or None) – Any params specific to this job (e.g. the job source)
Returns:str – The id of a job handler for a job run of this Tool
get_panel_section()[source]
get_param(key)[source]

Returns the parameter named key or None if there is no such parameter.

get_param_html_map(trans, page=0, other_values={})[source]

Return a dictionary containing the HTML representation of each parameter. This is used for rendering display elements. It is currently not compatible with grouping constructs.

NOTE: This should be considered deprecated, it is only used for tools
with display elements. These should be eliminated.
get_static_param_values(trans)[source]

Returns a map of parameter names and values if the tool does not require any user input. Will raise an exception if any parameter does require input.

handle_input(trans, incoming, history=None, old_errors=None, process_state='update', source='html')[source]

Process incoming parameters for this tool from the dict incoming, update the tool state (or create if none existed), and either return to the form or execute the tool (only if ‘execute’ was clicked and there were no errors).

process_state can be either ‘update’ (to incrementally build up the state over several calls - one repeat per handle for instance) or ‘populate’ force a complete build of the state and submission all at once (like from API). May want an incremental version of the API also at some point, that is why this is not just called for_api.

handle_interrupted(trans, inputs)[source]

Upon handling inputs, if it appears that we have received an incomplete form, do some cleanup or anything else deemed necessary. Currently this is only likely during file uploads, but this method could be generalized and a method standardized for handling other tools.

handle_job_failure_exception(e)[source]

Called by job.fail when an exception is generated to allow generation of a better error message (returning None yields the default behavior)

handle_single_execution(trans, rerun_remap_job_id, params, history, mapping_over_collection)[source]

Return a pair with whether execution is successful as well as either resulting output data or an error message indicating the problem.

handle_unvalidated_param_values(input_values, app)[source]

Find any instances of UnvalidatedValue within input_values and validate them (by calling ToolParameter.from_html and ToolParameter.validate).

handle_unvalidated_param_values_helper(inputs, input_values, app, context=None, prefix='')[source]

Recursive helper for handle_unvalidated_param_values

help
help_by_page
installed_tool_dependencies
job_failed(job_wrapper, message, exception=False)[source]

Called when a job has failed

new_state(trans, all_pages=False, history=None)[source]

Create a new DefaultToolState for this tool. It will be initialized with default values for inputs.

Only inputs on the first page will be initialized unless all_pages is True, in which case all inputs regardless of page are initialized.

params_from_strings(params, app, ignore_errors=False)[source]
params_to_strings(params, app)[source]
params_with_missing_data_table_entry

Return all parameters that are dynamically generated select lists whose options require an entry not currently in the tool_data_table_conf.xml file.

params_with_missing_index_file

Return all parameters that are dynamically generated select lists whose options refer to a missing .loc file.

parse(tool_source, guid=None)[source]

Read tool configuration from the element root and fill in self.

parse_help(tool_source)[source]

Parse the help text for the tool. Formatted in reStructuredText, but stored as Mako to allow for dynamic image paths. This implementation supports multiple pages.

parse_input_elem(page_source, enctypes, context=None)[source]

Parse a parent element whose children are inputs – these could be groups (repeat, conditional) or param elements. Groups will be parsed recursively.

parse_input_page(page_source, enctypes)[source]

Parse a page of inputs. This basically just calls ‘parse_input_elem’, but it also deals with possible ‘display’ elements which are supported only at the top/page level (not in groups).

parse_inputs(tool_source)[source]

Parse the “<inputs>” element and create appropriate `ToolParameter`s. This implementation supports multiple pages and grouping constructs.

parse_outputs(tool_source)[source]

Parse <outputs> elements and fill in self.outputs (keyed by name)

parse_param_elem(input_source, enctypes, context)[source]

Parse a single “<param>” element and return a ToolParameter instance. Also, if the parameter has a ‘required_enctype’ add it to the set enctypes.

parse_redirect_url(data, param_dict)[source]

Parse the REDIRECT_URL tool param. Tools that send data to an external application via a redirect must include the following 3 tool params:

  1. REDIRECT_URL - the url to which the data is being sent
  2. DATA_URL - the url to which the receiving application will send an http post to retrieve the Galaxy data
  3. GALAXY_URL - the url to which the external application may post data as a response
parse_stdio(tool_source)[source]

Parse <stdio> element(s) and fill in self.return_codes, self.stderr_rules, and self.stdout_rules. Return codes have a range and an error type (fault or warning). Stderr and stdout rules have a regular expression and an error level (fault or warning).

populate_state(trans, inputs, state, incoming, history=None, source='html', prefix='', context=None)[source]
populate_tool_shed_info()[source]
produces_collections
requires_setting_metadata = True
sa_session

Returns a SQLAlchemy session

tests
to_dict(trans, link_details=False, io_details=False)[source]

Returns dict of tool.

to_json(trans, kwd={}, is_workflow=False)[source]

Recursively creates a tool dictionary containing repeats, dynamic options and updated states.

tool_shed_repository
tool_type = 'default'
tool_version

Return a ToolVersion if one exists for our id

tool_versions
update_state(trans, inputs, state, incoming, source='html', prefix='', context=None, update_only=False, old_errors={}, item_callback=None)[source]

Update the tool state in state using the user input in incoming. This is designed to be called recursively: inputs contains the set of inputs being processed, and prefix specifies a prefix to add to the name of each input to extract its value from incoming.

If update_only is True, values that are not in incoming will not be modified. In this case old_errors can be provided, and any errors for parameters which were not updated will be preserved.

visit_inputs(value, callback)[source]

Call the function callback on each parameter of this tool. Visits grouping parameters recursively and constructs unique prefixes for each nested set of The callback method is then called as:

callback( level_prefix, parameter, parameter_value )

class galaxy.tools.ToolBox(config_filenames, tool_root_dir, app)[source]

Bases: galaxy.tools.toolbox.base.AbstractToolBox

A derivative of AbstractToolBox with knowledge about Tool internals - how to construct them, action types, dependency management, etc....

create_tool(config_file, repository_id=None, guid=None, **kwds)[source]
handle_datatypes_changed()[source]

Refresh upload tools when new datatypes are added.

tools_by_id
exception galaxy.tools.ToolNotFoundException[source]

Bases: exceptions.Exception

class galaxy.tools.ToolOutput(name, format=None, format_source=None, metadata_source=None, parent=None, label=None, filters=None, actions=None, hidden=False, implicit=False)[source]

Bases: galaxy.tools.ToolOutputBase

Represents an output datasets produced by a tool. For backward compatibility this behaves as if it were the tuple:

(format, metadata_source, parent)
dict_collection_visible_keys = ('name', 'format', 'label', 'hidden')
class galaxy.tools.ToolOutputBase(name, label=None, filters=None, hidden=False)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

class galaxy.tools.ToolOutputCollection(name, structure, label=None, filters=None, hidden=False, default_format='data', default_format_source=None, default_metadata_source=None, inherit_format=False, inherit_metadata=False)[source]

Bases: galaxy.tools.ToolOutputBase

Represents a HistoryDatasetCollectionAssociation of output datasets produced by a tool. <outputs>

<dataset_collection type=”list” label=”${tool.name} on ${on_string} fasta”>
<discover_datasets pattern=”__name__” ext=”fasta” visible=”True” directory=”outputFiles” />

</dataset_collection> <dataset_collection type=”paired” label=”${tool.name} on ${on_string} paired reads”>

<data name=”forward” format=”fastqsanger” /> <data name=”reverse” format=”fastqsanger”/>

</dataset_collection>

<outputs>

dataset_collectors
dynamic_structure
known_outputs(inputs, type_registry)[source]
class galaxy.tools.ToolOutputCollectionPart(output_collection_def, element_identifier, output_def)[source]

Bases: object

effective_output_name
static is_named_collection_part_name(name)[source]
static split_output_name(name)[source]
class galaxy.tools.ToolOutputCollectionStructure(collection_type, structured_like, dataset_collectors)[source]

Bases: object

class galaxy.tools.TracksterConfig(actions)[source]

Trackster configuration encapsulation.

static parse(root)[source]
galaxy.tools.check_param_from_incoming(trans, state, input, incoming, key, context, source)[source]

Unlike “update” state, this preserves default if no incoming value found. This lets API user specify just a subset of params and allow defaults to be used when available.

galaxy.tools.get_incoming_value(incoming, key, default)[source]

Fetch value from incoming dict directly or check special nginx upload created variants of this key.

galaxy.tools.json_fix(val)[source]
galaxy.tools.tool_class

alias of DataDestinationTool

exception_handling Module

Exceptions and handlers for tools.

FIXME: These are used by tool scripts, not the framework, and should not live
in this package.
exception galaxy.tools.exception_handling.UCSCLimitException[source]

Bases: exceptions.Exception

class galaxy.tools.exception_handling.UCSCOutWrapper(other)[source]

Bases: object

File-like object that throws an exception if it encounters the UCSC limit error lines

next()[source]
readline()[source]
test Module
class galaxy.tools.test.ParamContext(name, index=None, parent_context=None)[source]

Bases: object

extract_value(raw_inputs)[source]
for_state()[source]
param_names()[source]
class galaxy.tools.test.RootParamContext[source]

Bases: object

for_state()[source]
get_index()[source]
param_names()[source]
class galaxy.tools.test.ToolTestBuilder(tool, test_dict, i, default_interactor)[source]

Bases: object

Encapsulates information about a tool test, and allows creation of a dynamic TestCase class (the unittest framework is very class oriented, doing dynamic tests in this way allows better integration)

test_data()[source]

Iterator over metadata representing the required files for upload.

galaxy.tools.test.nottest(x)
galaxy.tools.test.parse_tests(tool, tests_source)[source]

Build ToolTestBuilder objects for each “<test>” elements and return default interactor (if any).

galaxy.tools.test.require_file(name, value, extra, required_files)[source]
galaxy.tools.test.test_data_iter(required_files)[source]
Subpackages
actions Package
actions Package
class galaxy.tools.actions.DefaultToolAction[source]

Bases: object

Default tool action is to run an external command

collect_input_dataset_collections(tool, param_values)[source]
collect_input_datasets(tool, param_values, trans)[source]

Collect any dataset inputs from incoming. Returns a mapping from parameter name to Dataset instance for each tool parameter that is of the DataToolParameter type.

execute(tool, trans, incoming={}, return_job=False, set_output_hid=True, set_output_history=True, history=None, job_params=None, rerun_remap_job_id=None, mapping_over_collection=False)[source]

Executes a tool, creating job and tool outputs, associating them, and submitting the job to the job queue. If history is not specified, use trans.history as destination for tool’s output datasets.

get_output_name(output, dataset, tool, on_text, trans, incoming, history, params, job_params)[source]
class galaxy.tools.actions.ObjectStorePopulator(app)[source]

Bases: object

Small helper for interacting with the object store and making sure all datasets from a job end up with the same object_store_id.

set_object_store_id(data)[source]
class galaxy.tools.actions.ToolAction[source]

Bases: object

The actions to be taken when a tool is run (after parameters have been converted and validated).

execute(tool, trans, incoming={}, set_output_hid=True)[source]
galaxy.tools.actions.determine_output_format(output, parameter_context, input_datasets, random_input_ext)[source]

Determines the output format for a dataset based on an abstract description of the output (galaxy.tools.ToolOutput), the parameter wrappers, a map of the input datasets (name => HDA), and the last input extensions in the tool form.

TODO: Don’t deal with XML here - move this logic into ToolOutput. TODO: Make the input extension used deterministic instead of random.

galaxy.tools.actions.filter_output(output, incoming)[source]
galaxy.tools.actions.on_text_for_names(input_names)[source]
history_imp_exp Module
class galaxy.tools.actions.history_imp_exp.ExportHistoryToolAction[source]

Bases: galaxy.tools.actions.ToolAction

Tool action used for exporting a history to an archive.

execute(tool, trans, incoming={}, set_output_hid=False, overwrite=True, history=None, **kwargs)[source]
class galaxy.tools.actions.history_imp_exp.ImportHistoryToolAction[source]

Bases: galaxy.tools.actions.ToolAction

Tool action used for importing a history to an archive.

execute(tool, trans, incoming={}, set_output_hid=False, overwrite=True, history=None, **kwargs)[source]
index_genome Module
metadata Module
class galaxy.tools.actions.metadata.SetMetadataToolAction[source]

Bases: galaxy.tools.actions.__init__.ToolAction

Tool action used for setting external metadata on an existing dataset

execute(tool, trans, incoming={}, set_output_hid=False, overwrite=True, history=None, job_params=None, **kwargs)[source]

Execute using a web transaction.

execute_via_app(tool, app, session_id, history_id, user=None, incoming={}, set_output_hid=False, overwrite=True, history=None, job_params=None)[source]

Execute using application.

upload Module
class galaxy.tools.actions.upload.UploadToolAction[source]

Bases: galaxy.tools.actions.__init__.ToolAction

execute(tool, trans, incoming={}, set_output_hid=True, history=None, **kwargs)[source]
upload_common Module
galaxy.tools.actions.upload_common.active_folders(trans, folder)[source]
galaxy.tools.actions.upload_common.cleanup_unused_precreated_datasets(precreated_datasets)[source]
galaxy.tools.actions.upload_common.create_job(trans, params, tool, json_file_path, data_list, folder=None, history=None)[source]

Create the upload job.

galaxy.tools.actions.upload_common.create_paramfile(trans, uploaded_datasets)[source]

Create the upload tool’s JSON “param” file.

galaxy.tools.actions.upload_common.get_precreated_dataset(precreated_datasets, name)[source]

Return a dataset matching a name from the list of precreated (via async upload) datasets. If there’s more than one upload with the exact same name, we need to pop one (the first) so it isn’t chosen next time.

galaxy.tools.actions.upload_common.get_precreated_datasets(trans, params, data_obj, controller='root')[source]

Get any precreated datasets (when using asynchronous uploads).

galaxy.tools.actions.upload_common.get_uploaded_datasets(trans, cntrller, params, precreated_datasets, dataset_upload_inputs, library_bunch=None, history=None)[source]
galaxy.tools.actions.upload_common.handle_library_params(trans, params, folder_id, replace_dataset=None)[source]
galaxy.tools.actions.upload_common.new_upload(trans, cntrller, uploaded_dataset, library_bunch=None, history=None, state=None)[source]
galaxy.tools.actions.upload_common.persist_uploads(params)[source]

Turn any uploads in the submitted form to persisted files.

data Package
data Package

Manage tool data tables, which store (at the application level) data that is used by tools, for example in the generation of dynamic options. Tables are loaded and stored by names which tools use to refer to them. This allows users to configure data tables for a local Galaxy instance without needing to modify the tool configurations.

class galaxy.tools.data.TabularToolDataField(data)[source]

Bases: galaxy.model.item_attrs.Dictifiable, object

clean_base_dir(path)[source]
dict_collection_visible_keys = []
get_base_dir()[source]
get_base_path()[source]
get_files()[source]
get_filesize_map(rm_base_dir=False)[source]
get_fingerprint()[source]
to_dict()[source]
class galaxy.tools.data.TabularToolDataTable(config_element, tool_data_path, from_shed_config=False, filename=None)[source]

Bases: galaxy.tools.data.ToolDataTable, galaxy.model.item_attrs.Dictifiable

Data stored in a tabular / separated value format on disk, allows multiple files to be merged but all must have the same column definitions:

<table type="tabular" name="test">
    <column name='...' index = '...' />
    <file path="..." />
    <file path="..." />
</table>
configure_and_load(config_element, tool_data_path, from_shed_config=False, url_timeout=10)[source]

Configure and load table from an XML element.

dict_collection_visible_keys = ['name']
extend_data_with(filename, errors=None)[source]
filter_file_fields(loc_file, values)[source]

Reads separated lines from file and print back only the lines that pass a filter.

get_column_name_list()[source]
get_entries(query_attr, query_val, return_attr, default=None, limit=None)[source]

Returns table entry associated with a col/val pair.

get_entry(query_attr, query_val, return_attr, default=None)[source]

Returns table entry associated with a col/val pair.

get_field(value)[source]
get_fields()[source]
get_filename_for_source(source, default=None)[source]
get_named_fields_list()[source]
get_version_fields()[source]
handle_found_index_file(filename)[source]
merge_tool_data_table(other_table, allow_duplicates=True, persist=False, persist_on_error=False, entry_source=None, **kwd)[source]
parse_column_spec(config_element)[source]

Parse column definitions, which can either be a set of ‘column’ elements with a name and index (as in dynamic options config), or a shorthand comma separated list of names in order as the text of a ‘column_names’ element.

A column named ‘value’ is required.

parse_file_fields(reader, errors=None, here='__HERE__')[source]

Parse separated lines from file and return a list of tuples.

TODO: Allow named access to fields using the column names.

to_dict(view='collection')[source]
type_key = 'tabular'
xml_string
class galaxy.tools.data.ToolDataTable(config_element, tool_data_path, from_shed_config=False, filename=None)[source]

Bases: object

add_entries(entries, allow_duplicates=True, persist=False, persist_on_error=False, entry_source=None, **kwd)[source]
add_entry(entry, allow_duplicates=True, persist=False, persist_on_error=False, entry_source=None, **kwd)[source]
classmethod from_elem(table_elem, tool_data_path, from_shed_config, filename)[source]
get_empty_field_by_name(name)[source]
is_current_version(other_version)[source]
merge_tool_data_table(other_table, allow_duplicates=True, persist=False, persist_on_error=False, entry_source=None, **kwd)[source]
reload_from_files()[source]
remove_entry(values)[source]
class galaxy.tools.data.ToolDataTableManager(tool_data_path, config_filename=None)[source]

Bases: object

Manages a collection of tool data tables

add_new_entries_from_config_file(config_filename, tool_data_path, shed_tool_data_table_config, persist=False)[source]

This method is called when a tool shed repository that includes a tool_data_table_conf.xml.sample file is being installed into a local galaxy instance. We have 2 cases to handle, files whose root tag is <tables>, for example:

<tables>
    <!-- Location of Tmap files -->
    <table name="tmap_indexes" comment_char="#">
        <columns>value, dbkey, name, path</columns>
        <file path="tool-data/tmap_index.loc" />
    </table>
</tables>

and files whose root tag is <table>, for example:

<!-- Location of Tmap files -->
<table name="tmap_indexes" comment_char="#">
    <columns>value, dbkey, name, path</columns>
    <file path="tool-data/tmap_index.loc" />
</table>
get(name, default=None)[source]
get_tables()[source]
load_from_config_file(config_filename, tool_data_path, from_shed_config=False)[source]

This method is called under 3 conditions:

  1. When the ToolDataTableManager is initialized (see __init__ above).
  2. Just after the ToolDataTableManager is initialized and the additional entries defined by shed_tool_data_table_conf.xml are being loaded into the ToolDataTableManager.data_tables.
  3. When a tool shed repository that includes a tool_data_table_conf.xml.sample file is being installed into a local Galaxy instance. In this case, we have 2 entry types to handle, files whose root tag is <tables>, for example:
reload_tables(table_names=None)[source]
set(name, value)[source]
to_xml_file(shed_tool_data_table_config, new_elems=None, remove_elems=None)[source]

Write the current in-memory version of the shed_tool_data_table_conf.xml file to disk. remove_elems are removed before new_elems are added.

galaxy.tools.data.cls

alias of TabularToolDataTable

galaxy.tools.data.expand_here_template(content, here=None)[source]
deps Package
deps Package

Dependency management for tools.

class galaxy.tools.deps.DependencyManager(default_base_path, conf_file=None)[source]

Bases: object

A DependencyManager attempts to resolve named and versioned dependencies by searching for them under a list of directories. Directories should be of the form:

$BASE/name/version/...

and should each contain a file ‘env.sh’ which can be sourced to make the dependency available in the current shell environment.

dependency_shell_commands(requirements, **kwds)[source]
find_dep(name, version=None, type='package', **kwds)[source]
uses_tool_shed_dependencies()[source]
class galaxy.tools.deps.NullDependencyManager[source]

Bases: object

dependency_shell_commands(requirements, **kwds)[source]
find_dep(name, version=None, type='package', **kwds)[source]
uses_tool_shed_dependencies()[source]
galaxy.tools.deps.build_dependency_manager(config)[source]
tests Module
genome_index Package
genome_index Package
index_genome Module
imp_exp Package
imp_exp Package
class galaxy.tools.imp_exp.JobExportHistoryArchiveWrapper(job_id)[source]

Bases: object, galaxy.model.item_attrs.UsesAnnotations

Class provides support for performing jobs that export a history to an archive.

cleanup_after_job(db_session)[source]

Remove temporary directory and attribute files generated during setup for this job.

get_history_datasets(trans, history)[source]

Returns history’s datasets.

setup_job(trans, jeha, include_hidden=False, include_deleted=False)[source]

Perform setup for job to export a history into an archive. Method generates attribute files for export, sets the corresponding attributes in the jeha object, and returns a command line for running the job. The command line includes the command, inputs, and options; it does not include the output file because it must be set at runtime.

class galaxy.tools.imp_exp.JobImportHistoryArchiveWrapper(app, job_id)[source]

Bases: object, galaxy.model.item_attrs.UsesAnnotations

Class provides support for performing jobs that import a history from an archive.

cleanup_after_job()[source]

Set history, datasets, and jobs’ attributes and clean up archive directory.

galaxy.tools.imp_exp.load_history_imp_exp_tools(toolbox)[source]

Adds tools for importing/exporting histories to archives.

export_history Module

Export a history to an archive file using attribute files.

usage: %prog history_attrs dataset_attrs job_attrs out_file
-G, –gzip: gzip archive file
galaxy.tools.imp_exp.export_history.create_archive(history_attrs_file, datasets_attrs_file, jobs_attrs_file, out_file, gzip=False)[source]

Create archive from the given attribute/metadata files and save it to out_file.

galaxy.tools.imp_exp.export_history.get_dataset_filename(name, ext)[source]

Builds a filename for a dataset using its name an extension.

galaxy.tools.imp_exp.export_history.main()[source]
unpack_tar_gz_archive Module

Unpack a tar or tar.gz archive into a directory.

usage: %prog archive_source dest_dir
–[url|file] source type, either a URL or a file.
galaxy.tools.imp_exp.unpack_tar_gz_archive.unpack_archive(archive_file, dest_dir)[source]

Unpack a tar and/or gzipped archive into a destination directory.

galaxy.tools.imp_exp.unpack_tar_gz_archive.url_to_file(url, dest_file)[source]

Transfer a file from a remote URL to a temporary file.

parameters Package
parameters Package

Classes encapsulating Galaxy tool parameters.

galaxy.tools.parameters.check_param(trans, param, incoming_value, param_values, source='html')[source]

Check the value of a single parameter param. The value in incoming_value is converted from its HTML encoding and validated. The param_values argument contains the processed values of previous parameters (this may actually be an ExpressionContext when dealing with grouping scenarios).

galaxy.tools.parameters.params_from_strings(params, param_values, app, ignore_errors=False)[source]

Convert a dictionary of strings as produced by params_to_strings back into parameter values (decode the json representation and then allow each parameter to convert the basic types into the parameters preferred form).

galaxy.tools.parameters.params_to_incoming(incoming, inputs, input_values, app, name_prefix='', to_html=True)[source]

Given a tool’s parameter definition (inputs) and a specific set of parameter input_values objects, populate incoming with the html values.

Useful for e.g. the rerun function.

galaxy.tools.parameters.params_to_strings(params, param_values, app)[source]

Convert a dictionary of parameter values to a dictionary of strings suitable for persisting. The value_to_basic method of each parameter is called to convert its value to basic types, the result of which is then json encoded (this allowing complex nested parameters and such).

galaxy.tools.parameters.visit_input_values(inputs, input_values, callback, name_prefix='', label_prefix='')[source]

Given a tools parameter definition (inputs) and a specific set of parameter values, call callback for each non-grouping parameter, passing the parameter object, value, a constructed unique name, and a display label.

If the callback returns a value, it will be replace the old value.

FIXME: There is redundancy between this and the visit_inputs methods of
Repeat and Group. This tracks labels and those do not. It would be nice to unify all the places that recursively visit inputs.
basic Module

Basic tool parameters.

class galaxy.tools.parameters.basic.BaseDataToolParameter(tool, input_source, trans)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

class galaxy.tools.parameters.basic.BaseURLToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.HiddenToolParameter

Returns a parameter that contains its value prepended by the current server base url. Used in all redirects.

from_html(value=None, trans=None, context={})[source]
class galaxy.tools.parameters.basic.BooleanToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that takes one of two values.

>>> p = BooleanToolParameter( None, XML( '<param name="blah" type="boolean" checked="yes" truevalue="bulletproof vests" falsevalue="cellophane chests" />' ) )
>>> print p.name
blah
>>> print p.get_html()
<input type="checkbox" id="blah" name="blah" value="true" checked="checked"><input type="hidden" name="blah" value="true">
>>> print p.from_html( ["true","true"] )
True
>>> print p.to_param_dict_string( True )
bulletproof vests
>>> print p.from_html( ["true"] )
False
>>> print p.to_param_dict_string( False )
cellophane chests
from_html(value, trans=None, other_values={})[source]
from_json(value, trans=None, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
legal_values
to_dict(trans, view='collection', value_mapper=None, other_values={})[source]
to_html_value(value, app)[source]
to_param_dict_string(value, other_values={})[source]
to_python(value, app)[source]
class galaxy.tools.parameters.basic.ColorToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that stores a color.

>>> p = ColorToolParameter( None, XML( '<param name="blah" type="color" value="#ffffff"/>' ) )
>>> print p.name
blah
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
class galaxy.tools.parameters.basic.ColumnListParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.SelectToolParameter

Select list that consists of either the total number of columns or only those columns that contain numerical values in the associated DataToolParameter.

# TODO: we need better testing here, but not sure how to associate a DatatoolParameter with a ColumnListParameter # from a twill perspective...

>>> # Mock up a history (not connected to database)
>>> from galaxy.model import History, HistoryDatasetAssociation
>>> from galaxy.util.bunch import Bunch
>>> from galaxy.model.mapping import init
>>> sa_session = init( "/tmp", "sqlite:///:memory:", create_tables=True ).session
>>> hist = History()
>>> sa_session.add( hist )
>>> sa_session.flush()
>>> hda = hist.add_dataset( HistoryDatasetAssociation( id=1, extension='interval', create_dataset=True, sa_session=sa_session ) )
>>> dtp =  DataToolParameter( None, XML( '<param name="blah" type="data" format="interval"/>' ) )
>>> print dtp.name
blah
>>> clp = ColumnListParameter ( None, XML( '<param name="numerical_column" type="data_column" data_ref="blah" numerical="true"/>' ) )
>>> print clp.name
numerical_column
from_html(value, trans=None, context={})[source]

Label convention prepends column number with a ‘c’, but tool uses the integer. This removes the ‘c’ when entered into a workflow.

get_column_list(trans, other_values)[source]

Generate a select list containing the columns of the associated dataset (if found).

get_dependencies()[source]
get_initial_value(trans, context, history=None)[source]
get_options(trans, other_values)[source]

show column labels rather than c1..cn if use_header_names=True

to_dict(trans, view='collection', value_mapper=None, other_values={})[source]
galaxy.tools.parameters.basic.DEFAULT_VALUE_MAP(x)
class galaxy.tools.parameters.basic.DataCollectionToolParameter(tool, input_source, trans=None)[source]

Bases: galaxy.tools.parameters.basic.BaseDataToolParameter

collection_type
from_html(value, trans, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
match_collections(trans, history, dataset_matcher)[source]
match_multirun_collections(trans, history, dataset_matcher)[source]
to_dict(trans, view='collection', value_mapper=None, other_values=None)[source]
to_python(value, app)[source]
to_string(value, app)[source]
validate(value, history=None)[source]
value_to_display_text(value, app)[source]
class galaxy.tools.parameters.basic.DataToolParameter(tool, input_source, trans=None)[source]

Bases: galaxy.tools.parameters.basic.BaseDataToolParameter

Parameter that takes on one (or many) or a specific set of values.

TODO: There should be an alternate display that allows single selects to be
displayed as radio buttons and multiple selects as a set of checkboxes

TODO: The following must be fixed to test correctly for the new security_check tag in the DataToolParameter ( the last test below is broken ) Nate’s next pass at the dataset security stuff will dramatically alter this anyway.

converter_safe(other_values, trans)[source]
from_html(value, trans, other_values={})[source]
get_dependencies()[source]

Get the names of the other params this param depends on.

get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
get_initial_value_from_history_prevent_repeats(trans, context, already_used, history=None)[source]
NOTE: This is wasteful since dynamic options and dataset collection
happens twice (here and when generating HTML).
match_collections(history, dataset_matcher, reduction=True)[source]
match_datasets(history, dataset_matcher)[source]
to_dict(trans, view='collection', value_mapper=None, other_values=None)[source]
to_param_dict_string(value, other_values={})[source]
to_python(value, app)[source]
to_string(value, app)[source]
validate(value, history=None)[source]
value_to_display_text(value, app)[source]
class galaxy.tools.parameters.basic.DrillDownSelectToolParameter(tool, input_source, context=None)[source]

Bases: galaxy.tools.parameters.basic.SelectToolParameter

Parameter that takes on one (or many) of a specific set of values. Creating a hierarchical select menu, which allows users to ‘drill down’ a tree-like set of options.

>>> p = DrillDownSelectToolParameter( None, XML(
... '''
... <param name="some_name" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true">
...   <options>
...    <option name="Heading 1" value="heading1">
...        <option name="Option 1" value="option1"/>
...        <option name="Option 2" value="option2"/>
...        <option name="Heading 1" value="heading1">
...          <option name="Option 3" value="option3"/>
...          <option name="Option 4" value="option4"/>
...        </option>
...    </option>
...    <option name="Option 5" value="option5"/>
...   </options>
... </param>
... ''' ) )
>>> print p.get_html()
<div class="form-row drilldown-container" id="drilldown--736f6d655f6e616d65">
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--736f6d655f6e616d65-68656164696e6731-click"></span>
<input type="checkbox" name="some_name" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--736f6d655f6e616d65-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="checkbox" name="some_name" value="option1" >Option 1
</div>
<div class="form-row-input">
<input type="checkbox" name="some_name" value="option2" >Option 2
</div>
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--736f6d655f6e616d65-68656164696e6731-68656164696e6731-click"></span>
<input type="checkbox" name="some_name" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--736f6d655f6e616d65-68656164696e6731-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="checkbox" name="some_name" value="option3" >Option 3
</div>
<div class="form-row-input">
<input type="checkbox" name="some_name" value="option4" >Option 4
</div>
</div>
</div>
</div>
</div>
<div class="form-row-input">
<input type="checkbox" name="some_name" value="option5" >Option 5
</div>
</div>
>>> p = DrillDownSelectToolParameter( None, XML(
... '''
... <param name="some_name" type="drill_down" display="radio" hierarchy="recurse" multiple="false">
...   <options>
...    <option name="Heading 1" value="heading1">
...        <option name="Option 1" value="option1"/>
...        <option name="Option 2" value="option2"/>
...        <option name="Heading 1" value="heading1">
...          <option name="Option 3" value="option3"/>
...          <option name="Option 4" value="option4"/>
...        </option>
...    </option>
...    <option name="Option 5" value="option5"/>
...   </options>
... </param>
... ''' ) )
>>> print p.get_html()
<div class="form-row drilldown-container" id="drilldown--736f6d655f6e616d65">
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--736f6d655f6e616d65-68656164696e6731-click"></span>
<input type="radio" name="some_name" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--736f6d655f6e616d65-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="radio" name="some_name" value="option1" >Option 1
</div>
<div class="form-row-input">
<input type="radio" name="some_name" value="option2" >Option 2
</div>
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--736f6d655f6e616d65-68656164696e6731-68656164696e6731-click"></span>
<input type="radio" name="some_name" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--736f6d655f6e616d65-68656164696e6731-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="radio" name="some_name" value="option3" >Option 3
</div>
<div class="form-row-input">
<input type="radio" name="some_name" value="option4" >Option 4
</div>
</div>
</div>
</div>
</div>
<div class="form-row-input">
<input type="radio" name="some_name" value="option5" >Option 5
</div>
</div>
>>> print sorted(p.options[1].items())
[('name', 'Option 5'), ('options', []), ('selected', False), ('value', 'option5')]
>>> p.options[0]["name"]
'Heading 1'
>>> p.options[0]["selected"]
False
from_html(value, trans=None, other_values={})[source]
get_dependencies()[source]

Get the names of the other params this param depends on.

get_html(trans=None, value=None, other_values={})[source]

Returns the html widget corresponding to the paramter. Optionally attempt to retain the current value specific by ‘value’

get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
get_options(trans=None, value=None, other_values={})[source]
to_dict(trans, view='collection', value_mapper=None, other_values={})[source]
to_param_dict_string(value, other_values={}, value_map=<function <lambda>>)[source]
value_to_display_text(value, app)[source]
class galaxy.tools.parameters.basic.DummyDataset[source]

Bases: object

class galaxy.tools.parameters.basic.FTPFileToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that takes a file uploaded via FTP as a value.

from_html(value, trans=None, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
to_python(value, app)[source]
to_string(value, app)[source]
visible
class galaxy.tools.parameters.basic.FileToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that takes an uploaded file as a value.

>>> p = FileToolParameter( None, XML( '<param name="blah" type="file"/>' ) )
>>> print p.name
blah
>>> print p.get_html()
<input type="file" name="blah">
>>> p = FileToolParameter( None, XML( '<param name="blah" type="file" ajax-upload="true"/>' ) )
>>> print p.get_html()
<input type="file" name="blah" galaxy-ajax-upload="true">
from_html(value, trans=None, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
get_required_enctype()[source]

File upload elements require the multipart/form-data encoding

to_python(value, app)[source]
to_string(value, app)[source]
class galaxy.tools.parameters.basic.FloatToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.TextToolParameter

Parameter that takes a real number value.

>>> p = FloatToolParameter( None, XML( '<param name="blah" type="float" size="4" value="3.141592" />' ) )
>>> print p.name
blah
>>> print p.get_html()
<input type="text" name="blah" size="4" value="3.141592">
>>> type( p.from_html( "36.1" ) )
<type 'float'>
>>> type( p.from_html( "bleh" ) )
Traceback (most recent call last):
    ...
ValueError: A real number is required
dict_collection_visible_keys = ('name', 'argument', 'type', 'label', 'help', 'min', 'max')
from_html(value, trans=None, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
to_python(value, app)[source]
class galaxy.tools.parameters.basic.GenomeBuildParameter(*args, **kwds)[source]

Bases: galaxy.tools.parameters.basic.SelectToolParameter

Select list that sets the last used genome build for the current history as “selected”.

>>> # Create a mock transaction with 'hg17' as the current build
>>> from galaxy.util.bunch import Bunch
>>> trans = Bunch( history=Bunch( genome_build='hg17' ), db_builds=util.read_dbnames( None ) )
>>> p = GenomeBuildParameter( None, XML(
... '''
... <param name="blah" type="genomebuild" />
... ''' ) )
>>> print p.name
blah
>>> # hg17 should be selected by default
>>> print p.get_html( trans ) 
<select name="blah" last_selected_value="hg17">
<option value="?">unspecified (?)</option>
...
<option value="hg18">Human Mar. 2006 (NCBI36/hg18) (hg18)</option>
<option value="hg17" selected>Human May 2004 (NCBI35/hg17) (hg17)</option>
...
</select>
>>> # If the user selected something else already, that should be used
>>> # instead
>>> print p.get_html( trans, value='hg18' ) 
<select name="blah" last_selected_value="hg18">
<option value="?">unspecified (?)</option>
...
<option value="hg18" selected>Human Mar. 2006 (NCBI36/hg18) (hg18)</option>
<option value="hg17">Human May 2004 (NCBI35/hg17) (hg17)</option>
...
</select>
>>> print p.filter_value( "hg17" )
hg17
get_options(trans, other_values)[source]
to_dict(trans, view='collection', value_mapper=None, other_values={})[source]
class galaxy.tools.parameters.basic.HiddenDataToolParameter(tool, elem)[source]

Bases: galaxy.tools.parameters.basic.HiddenToolParameter, galaxy.tools.parameters.basic.DataToolParameter

Hidden parameter that behaves as a DataToolParameter. As with all hidden parameters, this is a HACK.

get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
class galaxy.tools.parameters.basic.HiddenToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that takes one of two values.

FIXME: This seems hacky, parameters should only describe things the user
might change. It is used for ‘initializing’ the UCSC proxy tool
>>> p = HiddenToolParameter( None, XML( '<param name="blah" type="hidden" value="wax so rockin"/>' ) )
>>> print p.name
blah
>>> print p.get_html()
<input type="hidden" name="blah" value="wax so rockin">
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
get_label()[source]
class galaxy.tools.parameters.basic.IntegerToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.TextToolParameter

Parameter that takes an integer value.

>>> p = IntegerToolParameter( None, XML( '<param name="blah" type="integer" size="4" value="10" />' ) )
>>> print p.name
blah
>>> print p.get_html()
<input type="text" name="blah" size="4" value="10">
>>> type( p.from_html( "10" ) )
<type 'int'>
>>> type( p.from_html( "bleh" ) )
Traceback (most recent call last):
    ...
ValueError: An integer is required
dict_collection_visible_keys = ('name', 'argument', 'type', 'label', 'help', 'min', 'max')
from_html(value, trans=None, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
to_python(value, app)[source]
class galaxy.tools.parameters.basic.LibraryDatasetToolParameter(tool, elem)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that lets users select a LDDA from a modal window, then use it within the wrapper.

from_html(value, trans, other_values={})[source]
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
to_python(value, app)[source]
to_string(value, app)[source]
class galaxy.tools.parameters.basic.RuntimeValue[source]

Bases: object

Wrapper to note a value that is not yet set, but will be required at runtime.

class galaxy.tools.parameters.basic.SelectToolParameter(tool, input_source, context=None)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that takes on one (or many) or a specific set of values.

>>> p = SelectToolParameter( None, XML(
... '''
... <param name="blah" type="select">
...     <option value="x">I am X</option>
...     <option value="y" selected="true">I am Y</option>
...     <option value="z">I am Z</option>
... </param>
... ''' ) )
>>> print p.name
blah
>>> print p.get_html()
<select name="blah" last_selected_value="y">
<option value="x">I am X</option>
<option value="y" selected>I am Y</option>
<option value="z">I am Z</option>
</select>
>>> print p.get_html( value="z" )
<select name="blah" last_selected_value="z">
<option value="x">I am X</option>
<option value="y">I am Y</option>
<option value="z" selected>I am Z</option>
</select>
>>> print p.filter_value( "y" )
y
>>> p = SelectToolParameter( None, XML(
... '''
... <param name="blah" type="select" multiple="true">
...     <option value="x">I am X</option>
...     <option value="y" selected="true">I am Y</option>
...     <option value="z" selected="true">I am Z</option>
... </param>
... ''' ) )
>>> print p.name
blah
>>> print p.get_html()
<select name="blah" multiple last_selected_value="z">
<option value="x">I am X</option>
<option value="y" selected>I am Y</option>
<option value="z" selected>I am Z</option>
</select>
>>> print p.get_html( value=["x","y"])
<select name="blah" multiple last_selected_value="y">
<option value="x" selected>I am X</option>
<option value="y" selected>I am Y</option>
<option value="z">I am Z</option>
</select>
>>> print p.to_param_dict_string( ["y", "z"] )
y,z
>>> p = SelectToolParameter( None, XML(
... '''
... <param name="blah" type="select" multiple="true" display="checkboxes">
...     <option value="x">I am X</option>
...     <option value="y" selected="true">I am Y</option>
...     <option value="z" selected="true">I am Z</option>
... </param>
... ''' ) )
>>> print p.name
blah
>>> print p.get_html()
<div class="checkUncheckAllPlaceholder" checkbox_name="blah"></div>
<div><input type="checkbox" name="blah" value="x" id="blah|x"><label class="inline" for="blah|x">I am X</label></div>
<div class="odd_row"><input type="checkbox" name="blah" value="y" id="blah|y" checked='checked'><label class="inline" for="blah|y">I am Y</label></div>
<div><input type="checkbox" name="blah" value="z" id="blah|z" checked='checked'><label class="inline" for="blah|z">I am Z</label></div>
>>> print p.get_html( value=["x","y"])
<div class="checkUncheckAllPlaceholder" checkbox_name="blah"></div>
<div><input type="checkbox" name="blah" value="x" id="blah|x" checked='checked'><label class="inline" for="blah|x">I am X</label></div>
<div class="odd_row"><input type="checkbox" name="blah" value="y" id="blah|y" checked='checked'><label class="inline" for="blah|y">I am Y</label></div>
<div><input type="checkbox" name="blah" value="z" id="blah|z"><label class="inline" for="blah|z">I am Z</label></div>
>>> print p.to_param_dict_string( ["y", "z"] )
y,z
from_html(value, trans=None, context={})[source]
get_dependencies()[source]

Get the names of the other params this param depends on.

get_html_field(trans=None, value=None, context={})[source]
get_initial_value(trans, context, history=None)[source]
get_options(trans, other_values)[source]
to_dict(trans, view='collection', value_mapper=None, other_values={})[source]
to_html_value(value, app)[source]
to_param_dict_string(value, other_values={}, value_map=<function <lambda>>)[source]
value_from_basic(value, app, ignore_errors=False)[source]
value_to_basic(value, app)[source]
value_to_display_text(value, app)[source]
class galaxy.tools.parameters.basic.TextToolParameter(tool, input_source)[source]

Bases: galaxy.tools.parameters.basic.ToolParameter

Parameter that can take on any text value.

>>> p = TextToolParameter( None, XML( '<param name="blah" type="text" size="4" value="default" />' ) )
>>> print p.name
blah
>>> print p.get_html()
<input type="text" name="blah" size="4" value="default">
>>> print p.get_html( value="meh" )
<input type="text" name="blah" size="4" value="meh">
get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]
to_dict(trans, view='collection', value_mapper=None, other_values={})[source]
to_html_value(value, app)[source]
to_string(value, app)[source]

Convert a value to a string representation suitable for persisting

class galaxy.tools.parameters.basic.ToolParameter(tool, input_source, context=None)[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

Describes a parameter accepted by a tool. This is just a simple stub at the moment but in the future should encapsulate more complex parameters (lists of valid choices, validation logic, ...)

classmethod build(tool, param)[source]

Factory method to create parameter of correct type

dict_collection_visible_keys = ('name', 'argument', 'type', 'label', 'help')
filter_value(value, trans=None, other_values={})[source]

Parse the value returned by the view into a form usable by the tool OR raise a ValueError.

from_html(value, trans=None, other_values={})[source]

Convert a value from an HTML POST into the parameters preferred value format.

from_json(value, trans=None, other_values={})[source]
get_dependencies()[source]

Return the names of any other parameters this parameter depends on

get_html(trans=None, value=None, other_values={})[source]

Returns the html widget corresponding to the parameter. Optionally attempt to retain the current value specific by ‘value’

get_html_field(trans=None, value=None, other_values={})[source]
get_initial_value(trans, context, history=None)[source]

Return the starting value of the parameter

get_initial_value_from_history_prevent_repeats(trans, context, already_used, history=None)[source]

Get the starting value for the parameter, but if fetching from the history, try to find a value that has not yet been used. already_used is a list of objects that tools must manipulate (by adding to it) to store a memento that they can use to detect if a value has already been chosen from the history. This is to support the capability to choose each dataset once

get_label()[source]

Return user friendly name for the parameter

get_required_enctype()[source]

If this parameter needs the form to have a specific encoding return it, otherwise return None (indicating compatibility with any encoding)

classmethod parse_name(input_source)[source]
to_dict(trans, view='collection', value_mapper=None, other_values={})[source]

to_dict tool parameter. This can be overridden by subclasses.

to_html_value(value, app)[source]

Convert an object value to the value expected from an html post

to_param_dict_string(value, other_values={})[source]

Called via __str__ when used in the Cheetah template

to_python(value, app)[source]

Convert a value created with to_string back to an object representation

to_string(value, app)[source]

Convert a value to a string representation suitable for persisting

validate(value, history=None)[source]
value_from_basic(value, app, ignore_errors=False)[source]
value_to_basic(value, app)[source]
value_to_display_text(value, app)[source]

Convert a value to a text representation suitable for displaying to the user

visible

Return true if the parameter should be rendered on the form

class galaxy.tools.parameters.basic.UnvalidatedValue(value)[source]

Bases: object

Wrapper to mark a value that has not been validated

dynamic_options Module

Support for generating the options for a SelectToolParameter dynamically (based on the values of other parameters or other aspects of the current state)

class galaxy.tools.parameters.dynamic_options.AdditionalValueFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Adds a single static value to an options list.

Type: add_value

Required Attributes:
value: value to appear in select list
Optional Attributes:
name: Display name to appear in select list (value) index: Index of option list to add value (APPEND)
filter_options(options, trans, other_values)[source]
class galaxy.tools.parameters.dynamic_options.AttributeValueSplitterFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Filters a list of attribute-value pairs to be unique attribute names.

Type: attribute_value_splitter

Required Attributes:
column: column in options to compare with
Optional Attributes:
pair_separator: Split column by this (,) name_val_separator: Split name-value pair by this ( whitespace )
filter_options(options, trans, other_values)[source]
class galaxy.tools.parameters.dynamic_options.DataMetaFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Filters a list of options on a column by a dataset metadata value.

Type: data_meta

When no ‘from’ source has been specified in the <options> tag, this will populate the options list with (meta_value, meta_value, False). Otherwise, options which do not match the metadata value in the column are discarded.

Required Attributes:

  • ref: Name of input dataset
  • key: Metadata key to use for comparison
  • column: column in options to compare with (not required when not associated with input options)

Optional Attributes:

  • multiple: Option values are multiple, split column by separator (True)
  • separator: When multiple split by this (,)
filter_options(options, trans, other_values)[source]
get_dependency_name()[source]
class galaxy.tools.parameters.dynamic_options.DynamicOptions(elem, tool_param)[source]

Bases: object

Handles dynamically generated SelectToolParameter options

column_spec_to_index(column_spec)[source]

Convert a column specification (as read from the config file), to an index. A column specification can just be a number, a column name, or a column alias.

get_dependency_names()[source]

Return the names of parameters these options depend on – both data and other param types.

get_field_by_name_for_value(field_name, value, trans, other_values)[source]

Get contents of field by name for specified value.

get_fields(trans, other_values)[source]
get_fields_by_value(value, trans, other_values)[source]

Return a list of fields with column ‘value’ matching provided value.

get_options(trans, other_values)[source]
parse_column_definitions(elem)[source]
parse_file_fields(reader)[source]
class galaxy.tools.parameters.dynamic_options.Filter(d_option, elem)[source]

Bases: object

A filter takes the current options list and modifies it.

filter_options(options, trans, other_values)[source]

Returns a list of options after the filter is applied

classmethod from_element(d_option, elem)[source]

Loads the proper filter by the type attribute of elem

get_dependency_name()[source]

Returns the name of any depedencies, otherwise None

class galaxy.tools.parameters.dynamic_options.MultipleSplitterFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Turns a single line of options into multiple lines, by splitting a column and creating a line for each item.

Type: multiple_splitter

Required Attributes:
column: column in options to compare with
Optional Attributes:
separator: Split column by this (,)
filter_options(options, trans, other_values)[source]
class galaxy.tools.parameters.dynamic_options.ParamValueFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Filters a list of options on a column by the value of another input.

Type: param_value

Required Attributes:

  • ref: Name of input value
  • column: column in options to compare with

Optional Attributes:

  • keep: Keep columns matching value (True)

    Discard columns matching value (False)

  • ref_attribute: Period (.) separated attribute chain of input (ref) to use as value for filter

filter_options(options, trans, other_values)[source]
get_dependency_name()[source]
class galaxy.tools.parameters.dynamic_options.RemoveValueFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Removes a value from an options list.

Type: remove_value

Required Attributes:

value: value to remove from select list
    or
ref: param to refer to
    or
meta_ref: dataset to refer to
key: metadata key to compare to
filter_options(options, trans, other_values)[source]
class galaxy.tools.parameters.dynamic_options.SortByColumnFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Sorts an options list by a column

Type: sort_by

Required Attributes:
column: column to sort by
filter_options(options, trans, other_values)[source]
class galaxy.tools.parameters.dynamic_options.StaticValueFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Filters a list of options on a column by a static value.

Type: static_value

Required Attributes:
value: static value to compare to column: column in options to compare with
Optional Attributes:
keep: Keep columns matching value (True)
Discard columns matching value (False)
filter_options(options, trans, other_values)[source]
class galaxy.tools.parameters.dynamic_options.UniqueValueFilter(d_option, elem)[source]

Bases: galaxy.tools.parameters.dynamic_options.Filter

Filters a list of options to be unique by a column value.

Type: unique_value

Required Attributes:
column: column in options to compare with
filter_options(options, trans, other_values)[source]
get_dependency_name()[source]
grouping Module

Constructs for grouping tool parameters

class galaxy.tools.parameters.grouping.Conditional[source]

Bases: galaxy.tools.parameters.grouping.Group

get_current_case(value, trans)[source]
get_initial_value(trans, context, history=None)[source]
is_job_resource_conditional
label
to_dict(trans, view='collection', value_mapper=None)[source]
type = 'conditional'
value_from_basic(value, app, ignore_errors=False)[source]
value_to_basic(value, app)[source]
visit_inputs(prefix, value, callback)[source]
class galaxy.tools.parameters.grouping.ConditionalWhen[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

dict_collection_visible_keys = ('value',)
to_dict(trans, view='collection', value_mapper=None)[source]
class galaxy.tools.parameters.grouping.Group[source]

Bases: object, galaxy.model.item_attrs.Dictifiable

dict_collection_visible_keys = ('name', 'type')
get_initial_value(trans, context, history=None)[source]

Return the initial state/value for this group

to_dict(trans, view='collection', value_mapper=None)[source]
value_from_basic(value, app, ignore_errors=False)[source]

Convert a basic representation as produced by value_to_basic back into the preferred value form.

value_to_basic(value, app)[source]

Convert value to a (possibly nested) representation using only basic types (dict, list, tuple, str, unicode, int, long, float, bool, None)

visible
class galaxy.tools.parameters.grouping.Repeat[source]

Bases: galaxy.tools.parameters.grouping.Group

dict_collection_visible_keys = ('name', 'type', 'title', 'help', 'default', 'min', 'max')
get_initial_value(trans, context, history=None)[source]
label()[source]
title_plural
to_dict(trans, view='collection', value_mapper=None)[source]
type = 'repeat'
value_from_basic(value, app, ignore_errors=False)[source]
value_to_basic(value, app)[source]
visit_inputs(prefix, value, callback)[source]
class galaxy.tools.parameters.grouping.Section[source]

Bases: galaxy.tools.parameters.grouping.Group

dict_collection_visible_keys = ('name', 'type', 'title', 'help', 'expanded')
get_initial_value(trans, context, history=None)[source]
label()[source]
title_plural
to_dict(trans, view='collection', value_mapper=None)[source]
type = 'section'
value_from_basic(value, app, ignore_errors=False)[source]
value_to_basic(value, app)[source]
visit_inputs(prefix, value, callback)[source]
class galaxy.tools.parameters.grouping.UploadDataset[source]

Bases: galaxy.tools.parameters.grouping.Group

get_composite_dataset_name(context)[source]
get_datatype(trans, context)[source]
get_datatype_ext(trans, context)[source]
get_file_base_name(context)[source]
get_file_type(context)[source]
get_initial_value(trans, context, history=None)[source]
get_uploaded_datasets(trans, context, override_name=None, override_info=None)[source]
group_title(context)[source]
title_by_index(trans, index, context)[source]
title_plural
type = 'upload_dataset'
value_from_basic(value, app, ignore_errors=False)[source]
value_to_basic(value, app)[source]
visit_inputs(prefix, value, callback)[source]
input_translation Module

Tool Input Translation.

class galaxy.tools.parameters.input_translation.ToolInputTranslator[source]

Bases: object

Handles Tool input translation. This is used for data source tools

>>> from galaxy.util import Params
>>> from xml.etree.ElementTree import XML
>>> translator = ToolInputTranslator.from_element( XML(
... '''
... <request_param_translation>
...  <request_param galaxy_name="URL_method" remote_name="URL_method" missing="post" />
...  <request_param galaxy_name="URL" remote_name="URL" missing="" >
...     <append_param separator="&amp;" first_separator="?" join="=">
...         <value name="_export" missing="1" />
...         <value name="GALAXY_URL" missing="0" />
...     </append_param>
...  </request_param>
...  <request_param galaxy_name="dbkey" remote_name="db" missing="?" />
...  <request_param galaxy_name="organism" remote_name="org" missing="unknown species" />
...  <request_param galaxy_name="table" remote_name="hgta_table" missing="unknown table" />
...  <request_param galaxy_name="description" remote_name="hgta_regionType" missing="no description" />
...  <request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="tabular" >
...   <value_translation>
...    <value galaxy_value="tabular" remote_value="primaryTable" />
...    <value galaxy_value="tabular" remote_value="selectedFields" />
...    <value galaxy_value="wig" remote_value="wigData" />
...    <value galaxy_value="interval" remote_value="tab" />
...    <value galaxy_value="html" remote_value="hyperlinks" />
...    <value galaxy_value="fasta" remote_value="sequence" />
...   </value_translation>
...  </request_param>
... </request_param_translation>
... ''' ) )
>>> params = Params( { 'db':'hg17', 'URL':'URL_value', 'org':'Human', 'hgta_outputType':'primaryTable'  } )
>>> translator.translate( params )
>>> print sorted(list(params.__dict__.keys()))
['URL', 'URL_method', 'data_type', 'db', 'dbkey', 'description', 'hgta_outputType', 'org', 'organism', 'table']
>>> params.get('URL', None) in ['URL_value?GALAXY_URL=0&_export=1', 'URL_value?_export=1&GALAXY_URL=0']
True
classmethod from_element(elem)[source]

Loads the proper filter by the type attribute of elem

translate(params)[source]

update params in-place

output Module

Support for dynamically modifying output attributes.

class galaxy.tools.parameters.output.BooleanFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'boolean'
class galaxy.tools.parameters.output.ColumnReplaceFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'column_replace'
class galaxy.tools.parameters.output.ColumnStripFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'column_strip'
class galaxy.tools.parameters.output.DatatypeIsInstanceToolOutputActionConditionalWhen(parent, config_elem, value)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionConditionalWhen

is_case(output_dataset, other_values)[source]
tag = 'when datatype_isinstance'
class galaxy.tools.parameters.output.FormatToolOutputAction(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputAction

apply_action(output_dataset, other_values)[source]
tag = 'format'
class galaxy.tools.parameters.output.FromDataTableOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOption

get_value(other_values)[source]
tag = 'from_data_table'
class galaxy.tools.parameters.output.FromFileToolOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOption

get_value(other_values)[source]
tag = 'from_file'
class galaxy.tools.parameters.output.FromParamToolOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOption

get_value(other_values)[source]
tag = 'from_param'
class galaxy.tools.parameters.output.InsertColumnToolOutputActionOptionFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'insert_column'
class galaxy.tools.parameters.output.MetadataToolOutputAction(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputAction

apply_action(output_dataset, other_values)[source]
tag = 'metadata'
class galaxy.tools.parameters.output.MetadataValueFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'metadata_value'
class galaxy.tools.parameters.output.MultipleSplitterFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'multiple_splitter'
class galaxy.tools.parameters.output.NullToolOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOption

get_value(other_values)[source]
tag = 'null_option'
class galaxy.tools.parameters.output.ParamValueToolOutputActionOptionFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'param_value'
class galaxy.tools.parameters.output.StringFunctionFilter(parent, elem)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'string_function'
class galaxy.tools.parameters.output.ToolOutputAction(parent, elem)[source]

Bases: object

apply_action(output_dataset, other_values)[source]
classmethod from_elem(parent, elem)[source]

Loads the proper action by the type attribute of elem

tag = 'action'
tool
class galaxy.tools.parameters.output.ToolOutputActionConditional(parent, config_elem)[source]

Bases: object

apply_action(output_dataset, other_values)[source]
tag = 'conditional'
tool
class galaxy.tools.parameters.output.ToolOutputActionConditionalWhen(parent, config_elem, value)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionGroup

apply_action(output_dataset, other_values)[source]
classmethod from_elem(parent, when_elem)[source]

Loads the proper when by attributes of elem

get_ref(output_dataset, other_values)[source]
is_case(output_dataset, other_values)[source]
tag = 'when'
class galaxy.tools.parameters.output.ToolOutputActionGroup(parent, config_elem)[source]

Bases: object

Manages a set of tool output dataset actions directives

apply_action(output_dataset, other_values)[source]
tag = 'group'
tool
class galaxy.tools.parameters.output.ToolOutputActionOption(parent, elem)[source]

Bases: object

classmethod from_elem(parent, elem)[source]

Loads the proper action by the type attribute of elem

get_value(other_values)[source]
tag = 'object'
tool
class galaxy.tools.parameters.output.ToolOutputActionOptionFilter(parent, elem)[source]

Bases: object

filter_options(options, other_values)[source]
classmethod from_elem(parent, elem)[source]

Loads the proper action by the type attribute of elem

tag = 'filter'
tool
class galaxy.tools.parameters.output.ValueToolOutputActionConditionalWhen(parent, config_elem, value)[source]

Bases: galaxy.tools.parameters.output.ToolOutputActionConditionalWhen

is_case(output_dataset, other_values)[source]
tag = 'when value'
galaxy.tools.parameters.output.action_type

alias of FormatToolOutputAction

galaxy.tools.parameters.output.compare_endswith(value1, value2)[source]
galaxy.tools.parameters.output.compare_eq(value1, value2)[source]
galaxy.tools.parameters.output.compare_gt(value1, value2)[source]
galaxy.tools.parameters.output.compare_gte(value1, value2)[source]
galaxy.tools.parameters.output.compare_in(value1, value2)[source]
galaxy.tools.parameters.output.compare_lt(value1, value2)[source]
galaxy.tools.parameters.output.compare_lte(value1, value2)[source]
galaxy.tools.parameters.output.compare_neq(value1, value2)[source]
galaxy.tools.parameters.output.compare_startswith(value1, value2)[source]
galaxy.tools.parameters.output.filter_type

alias of ColumnReplaceFilter

galaxy.tools.parameters.output.option_type

alias of FromDataTableOutputActionOption

galaxy.tools.parameters.output.parse_cast_attribute(cast)[source]
galaxy.tools.parameters.output.parse_compare_type(compare)[source]
sanitize Module

Tool Parameter specific sanitizing.

class galaxy.tools.parameters.sanitize.ToolParameterSanitizer[source]

Bases: object

Handles tool parameter specific sanitizing.

>>> from xml.etree.ElementTree import XML
>>> sanitizer = ToolParameterSanitizer.from_element( XML(
... '''
... <sanitizer invalid_char="">
...   <valid initial="string.letters"/>
... </sanitizer>
... ''' ) )
>>> sanitizer.sanitize_param( ''.join( sorted( [ c for c in string.printable ] ) ) ) == ''.join( sorted( [ c for c in string.letters ] ) )
True
>>> slash = chr( 92 )
>>> sanitizer = ToolParameterSanitizer.from_element( XML(
... '''
... <sanitizer>
...   <valid initial="none">
...    <add preset="string.printable"/>
...    <remove value="&quot;"/>
...    <remove value="%s"/>
...   </valid>
...   <mapping initial="none">
...     <add source="&quot;" target="%s&quot;"/>
...     <add source="%s" target="%s%s"/>
...   </mapping>
... </sanitizer>
... ''' % ( slash, slash, slash, slash, slash ) ) )
>>> text = '%s"$rm&#!' % slash
>>> [ c for c in sanitizer.sanitize_param( text ) ] == [ slash, slash, slash, '"', '$', 'r', 'm', '&', '#', '!' ]
True
DEFAULT_INVALID_CHAR = 'X'
MAPPING_PRESET = {'default': {'@': '__at__', '\t': '__tc__', '\n': '__cn__', '\r': '__cr__', '[': '__ob__', ']': '__cb__', '#': '__pd__', '"': '__dq__', "'": '__sq__', '{': '__oc__', '}': '__cc__', '<': '__lt__', '>': '__gt__'}, 'none': {}}
VALID_PRESET = {'default': 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 -=_.()/+*^,:?!', 'none': ''}
classmethod from_element(elem)[source]

Loads the proper filter by the type attribute of elem

classmethod get_mapping_by_name(name)[source]
classmethod get_valid_by_name(name)[source]
restore_param(value)[source]
restore_text(text)[source]

Restores sanitized text

sanitize_param(value)[source]

Clean incoming parameters (strings or lists)

sanitize_text(text)[source]

Restricts the characters that are allowed in a text

validation Module

Classes related to parameter validation.

class galaxy.tools.parameters.validation.DatasetOkValidator(message=None)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks if a dataset is in an ‘ok’ state

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.EmptyTextfieldValidator(message=None)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks for empty text field

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.ExpressionValidator(message, expression, substitute_value_in_message)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that evaluates a python expression using the value

>>> from galaxy.tools.parameters import ToolParameter
>>> p = ToolParameter.build( None, XML( '''
... <param name="blah" type="text" size="10" value="10">
...     <validator type="expression" message="Not gonna happen">value.lower() == "foo"</validator>
... </param>
... ''' ) )
>>> t = p.validate( "Foo" )
>>> t = p.validate( "foo" )
>>> t = p.validate( "Fop" )
Traceback (most recent call last):
    ...
ValueError: Not gonna happen
classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.InRangeValidator(message, range_min, range_max)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that ensures a number is in a specific range

>>> from galaxy.tools.parameters import ToolParameter
>>> p = ToolParameter.build( None, XML( '''
... <param name="blah" type="integer" size="10" value="10">
...     <validator type="in_range" message="Not gonna happen" min="10" max="20"/>
... </param>
... ''' ) )
>>> t = p.validate( 10 )
>>> t = p.validate( 15 )
>>> t = p.validate( 20 )
>>> t = p.validate( 21 )
Traceback (most recent call last):
    ...
ValueError: Not gonna happen
classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
exception galaxy.tools.parameters.validation.LateValidationError(message)[source]

Bases: exceptions.Exception

class galaxy.tools.parameters.validation.LengthValidator(message, length_min, length_max)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that ensures the length of the provided string (value) is in a specific range

>>> from galaxy.tools.parameters import ToolParameter
>>> p = ToolParameter.build( None, XML( '''
... <param name="blah" type="text" size="10" value="foobar">
...     <validator type="length" min="2" max="8"/>
... </param>
... ''' ) )
>>> t = p.validate( "foo" )
>>> t = p.validate( "bar" )
>>> t = p.validate( "f" )
Traceback (most recent call last):
    ...
ValueError: Must have length of at least 2
>>> t = p.validate( "foobarbaz" )
Traceback (most recent call last):
    ...
ValueError: Must have length no more than 8
classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.MetadataInDataTableColumnValidator(tool_data_table, metadata_name, metadata_column, message='Value for metadata not found.', line_startswith=None)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks if the value for a dataset’s metadata item exists in a file.

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.MetadataInFileColumnValidator(filename, metadata_name, metadata_column, message='Value for metadata not found.', line_startswith=None)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks if the value for a dataset’s metadata item exists in a file.

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.MetadataValidator(message=None, check='', skip='')[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks for missing metadata

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.NoOptionsValidator(message=None)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks for empty select list

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.RegexValidator(message, expression)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that evaluates a regular expression

>>> from galaxy.tools.parameters import ToolParameter
>>> p = ToolParameter.build( None, XML( '''
... <param name="blah" type="text" size="10" value="10">
...     <validator type="regex" message="Not gonna happen">[Ff]oo</validator>
... </param>
... ''' ) )
>>> t = p.validate( "Foo" )
>>> t = p.validate( "foo" )
>>> t = p.validate( "Fop" )
Traceback (most recent call last):
    ...
ValueError: Not gonna happen
classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.UnspecifiedBuildValidator(message=None)[source]

Bases: galaxy.tools.parameters.validation.Validator

Validator that checks for dbkey not equal to ‘?’

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
class galaxy.tools.parameters.validation.Validator[source]

Bases: object

A validator checks that a value meets some conditions OR raises ValueError

classmethod from_element(param, elem)[source]
validate(value, history=None)[source]
galaxy.tools.parameters.validation.get_suite()[source]

Get unittest suite for this module

search Package
search Package

Module for building and searching the index of tools installed within this Galaxy.

class galaxy.tools.search.ToolBoxSearch(toolbox, index_help=True)[source]

Bases: object

Support searching tools in a toolbox. This implementation uses the Whoosh search library.

build_index(index_help=True)[source]
search(q, tool_name_boost, tool_section_boost, tool_description_boost, tool_help_boost, tool_search_limit)[source]

Perform search on the in-memory index. Weight in the given boosts.

util Package
util Package

Utilities used by various Galaxy tools

FIXME: These are used by tool scripts, not the framework, and should not live
in this package.
maf_utilities Module

Provides wrappers and utilities for working with MAF files and alignments.

class galaxy.tools.util.maf_utilities.GenomicRegionAlignment(start, end, species=[], temp_file_handler=None)[source]

Bases: galaxy.tools.util.maf_utilities.RegionAlignment

class galaxy.tools.util.maf_utilities.RegionAlignment(size, species=[], temp_file_handler=None)[source]

Bases: object

DNA_COMPLEMENT = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@TBGDEFCHIJKLMNOPQRSAUVWXYZ[\\]^_`tbgdefchijklmnopqrsauvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
MAX_SEQUENCE_SIZE = 9223372036854775807
add_species(species)[source]
flush(species=None)[source]
get_sequence(species)[source]
get_sequence_reverse_complement(species)[source]
get_species_names(skip=[])[source]
set_position(index, species, base)[source]
set_range(index, species, bases)[source]
class galaxy.tools.util.maf_utilities.SplicedAlignment(exon_starts, exon_ends, species=[], temp_file_handler=None)[source]

Bases: object

DNA_COMPLEMENT = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@TBGDEFCHIJKLMNOPQRSAUVWXYZ[\\]^_`tbgdefchijklmnopqrsauvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
end
get_sequence(species)[source]
get_sequence_reverse_complement(species)[source]
get_species_names(skip=[])[source]
start
class galaxy.tools.util.maf_utilities.TempFileHandler(max_open_files=None, **kwds)[source]

Bases: object

Handles creating, opening, closing, and deleting of Temp files, with a maximum number of files open at one time.

DEFAULT_MAX_OPEN_FILES = 512
close(index, delete=False)[source]
flush(index)[source]
get_open_tempfile(index=None, **kwds)[source]
galaxy.tools.util.maf_utilities.build_maf_index(maf_file, species=None)[source]
galaxy.tools.util.maf_utilities.build_maf_index_species_chromosomes(filename, index_species=None)[source]
galaxy.tools.util.maf_utilities.chop_block_by_region(block, src, region, species=None, mincols=0)[source]
galaxy.tools.util.maf_utilities.component_overlaps_region(c, region)[source]
galaxy.tools.util.maf_utilities.fill_region_alignment(alignment, index, primary_species, chrom, start, end, strand='+', species=None, mincols=0, overwrite_with_gaps=True)[source]
galaxy.tools.util.maf_utilities.get_attributes_from_fasta_header(header)[source]
galaxy.tools.util.maf_utilities.get_chopped_blocks_for_region(index, src, region, species=None, mincols=0)[source]
galaxy.tools.util.maf_utilities.get_chopped_blocks_with_index_offset_for_region(index, src, region, species=None, mincols=0)[source]
galaxy.tools.util.maf_utilities.get_components_by_src(block, src)[source]
galaxy.tools.util.maf_utilities.get_components_by_src_start(block, src)[source]
galaxy.tools.util.maf_utilities.get_fasta_header(component, attributes={}, suffix=None)[source]
galaxy.tools.util.maf_utilities.get_oriented_chopped_blocks_for_region(index, src, region, species=None, mincols=0, force_strand=None)[source]
galaxy.tools.util.maf_utilities.get_oriented_chopped_blocks_with_index_offset_for_region(index, src, region, species=None, mincols=0, force_strand=None)[source]
galaxy.tools.util.maf_utilities.get_region_alignment(index, primary_species, chrom, start, end, strand='+', species=None, mincols=0, overwrite_with_gaps=True, temp_file_handler=None)[source]
galaxy.tools.util.maf_utilities.get_species_in_block(block)[source]
galaxy.tools.util.maf_utilities.get_species_in_maf(maf_filename)[source]
galaxy.tools.util.maf_utilities.get_spliced_region_alignment(index, primary_species, chrom, starts, ends, strand='+', species=None, mincols=0, overwrite_with_gaps=True, temp_file_handler=None)[source]
galaxy.tools.util.maf_utilities.get_starts_ends_fields_from_gene_bed(line)[source]
galaxy.tools.util.maf_utilities.iter_blocks_split_by_species(block, species=None)[source]
galaxy.tools.util.maf_utilities.iter_blocks_split_by_src(block, src)[source]
galaxy.tools.util.maf_utilities.iter_components_by_src(block, src)[source]
galaxy.tools.util.maf_utilities.iter_components_by_src_start(block, src)[source]
galaxy.tools.util.maf_utilities.iter_fasta_alignment(filename)[source]
galaxy.tools.util.maf_utilities.line_enumerator(lines, comment_start='#')[source]
galaxy.tools.util.maf_utilities.maf_index_by_uid(maf_uid, index_location_file)[source]
galaxy.tools.util.maf_utilities.open_or_build_maf_index(maf_file, index_filename, species=None)[source]
galaxy.tools.util.maf_utilities.orient_block_by_region(block, src, region, force_strand=None)[source]
galaxy.tools.util.maf_utilities.parse_species_option(species)[source]
galaxy.tools.util.maf_utilities.reduce_block_by_primary_genome(block, species, chromosome, region_start)[source]
galaxy.tools.util.maf_utilities.remove_temp_index_file(index_filename)[source]
galaxy.tools.util.maf_utilities.sort_block_components_by_block(block1, block2)[source]
galaxy.tools.util.maf_utilities.src_merge(spec, chrom, contig=None)[source]
galaxy.tools.util.maf_utilities.src_split(src)[source]
galaxy.tools.util.maf_utilities.tool_fail(msg='Unknown Error')[source]
Subpackages
galaxyops Package
galaxyops Package

Utility functions for galaxyops

galaxy.tools.util.galaxyops.default_printer(stream, exc, obj)[source]
galaxy.tools.util.galaxyops.fail(msg)[source]
galaxy.tools.util.galaxyops.parse_cols_arg(cols)[source]

Parse a columns command line argument into a four-tuple

galaxy.tools.util.galaxyops.skipped(reader, filedesc='')[source]
galaxy.tools.util.galaxyops.warn(msg)[source]
util Package
util Package

Utility functions used systemwide.

class galaxy.util.ExecutionTimer[source]

Bases: object

class galaxy.util.Params(params, sanitize=True)[source]

Bases: object

Stores and ‘sanitizes’ parameters. Alphanumeric characters and the non-alphanumeric ones that are deemed safe are let to pass through (see L{valid_chars}). Some non-safe characters are escaped to safe forms for example C{>} becomes C{__lt__} (see L{mapped_chars}). All other characters are replaced with C{X}.

Operates on string or list values only (HTTP parameters).

>>> values = { 'status':'on', 'symbols':[  'alpha', '<>', '$rm&#!' ]  }
>>> par = Params(values)
>>> par.status
'on'
>>> par.value == None      # missing attributes return None
True
>>> par.get('price', 0)
0
>>> par.symbols            # replaces unknown symbols with X
['alpha', '__lt____gt__', 'XrmX__pd__!']
>>> sorted(par.flatten())  # flattening to a list
[('status', 'on'), ('symbols', 'XrmX__pd__!'), ('symbols', '__lt____gt__'), ('symbols', 'alpha')]
NEVER_SANITIZE = ['file_data', 'url_paste', 'URL', 'filesystem_paths']
flatten()[source]

Creates a tuple list from a dict with a tuple/value pair for every value that is a list

get(key, default)[source]
update(values)[source]
class galaxy.util.ParamsWithSpecs(specs=None, params=None)[source]

Bases: collections.defaultdict

galaxy.util.asbool(obj)[source]
galaxy.util.commaify(amount)[source]
galaxy.util.compare_urls(url1, url2, compare_scheme=True, compare_hostname=True, compare_path=True)[source]
galaxy.util.docstring_trim(docstring)[source]

Trimming python doc strings. Taken from: http://www.python.org/dev/peps/pep-0257/

galaxy.util.file_iter(fname, sep=None)[source]

This generator iterates over a file and yields its lines splitted via the C{sep} parameter. Skips empty lines and lines starting with the C{#} character.

>>> lines = [ line for line in file_iter(__file__) ]
>>> len(lines) !=  0
True
galaxy.util.file_reader(fp, chunk_size=65536)[source]

This generator yields the open fileobject in chunks (default 64k). Closes the file at the end

galaxy.util.galaxy_directory()[source]
galaxy.util.get_charset_from_http_headers(headers, default=None)[source]
galaxy.util.get_file_size(value, default=None)[source]
galaxy.util.in_directory(file, directory, local_path_module=<module 'posixpath' from '/home/docs/checkouts/readthedocs.org/user_builds/jmchilton-galaxy/envs/latest/lib/python2.7/posixpath.pyc'>)[source]

Return true, if the common prefix of both is equal to directory e.g. /a/b/c/d.rst and directory is /a/b, the common prefix is /a/b

galaxy.util.is_binary(value, binary_chars=None)[source]

File is binary if it contains a null-byte by default (e.g. behavior of grep, etc.). This may fail for utf-16 files, but so would ASCII encoding. >>> is_binary( string.printable ) False >>> is_binary( ‘xcex94’ ) False >>> is_binary( ‘000’ ) True

galaxy.util.is_multi_byte(chars)[source]
galaxy.util.is_uuid(value)[source]

This method returns True if value is a UUID, otherwise False. >>> is_uuid( “123e4567-e89b-12d3-a456-426655440000” ) True >>> is_uuid( “0x3242340298902834” ) False

galaxy.util.listify(item, do_strip=False)[source]

Make a single item a single item list, or return a list if passed a list. Passing a None returns an empty list.

galaxy.util.mask_password_from_url(url)[source]

Masks out passwords from connection urls like the database connection in galaxy.ini

>>> mask_password_from_url( 'sqlite+postgresql://user:password@localhost/' )
'sqlite+postgresql://user:********@localhost/'
>>> mask_password_from_url( 'amqp://user:amqp@localhost' )
'amqp://user:********@localhost'
>>> mask_password_from_url( 'amqp://localhost')
'amqp://localhost'
galaxy.util.merge_sorted_iterables(operator, *iterables)[source]
>>> operator = lambda x: x
>>> list( merge_sorted_iterables( operator, [1,2,3], [4,5] ) )
[1, 2, 3, 4, 5]
>>> list( merge_sorted_iterables( operator, [4, 5], [1,2,3] ) )
[1, 2, 3, 4, 5]
>>> list( merge_sorted_iterables( operator, [1, 4, 5], [2], [3] ) )
[1, 2, 3, 4, 5]
galaxy.util.mkstemp_ln(src, prefix='mkstemp_ln_')[source]

From tempfile._mkstemp_inner, generate a hard link in the same dir with a random name. Created so we can persist the underlying file of a NamedTemporaryFile upon its closure.

galaxy.util.move_merge(source, target)[source]
galaxy.util.nice_size(size)[source]

Returns a readably formatted string with the size

>>> nice_size(100)
'100 bytes'
>>> nice_size(10000)
'9.8 KB'
>>> nice_size(1000000)
'976.6 KB'
>>> nice_size(100000000)
'95.4 MB'
galaxy.util.object_to_string(obj)[source]
galaxy.util.parse_xml(fname)[source]

Returns a parsed xml tree

galaxy.util.parse_xml_string(xml_string)[source]
galaxy.util.pretty_print_json(json_data, is_json_string=False)[source]
galaxy.util.pretty_print_time_interval(time=False, precise=False)[source]

Get a datetime object or a int() Epoch timestamp and return a pretty string like ‘an hour ago’, ‘Yesterday’, ‘3 months ago’, ‘just now’, etc credit: http://stackoverflow.com/questions/1551382/user-friendly-time-format-in-python

galaxy.util.pretty_print_xml(elem, level=0)[source]
galaxy.util.read_build_sites(filename, check_builds=True)[source]

read db names to ucsc mappings from file, this file should probably be merged with the one above

galaxy.util.read_dbnames(filename)[source]

Read build names from file

galaxy.util.ready_name_for_url(raw_name)[source]

General method to convert a string (i.e. object name) to a URL-ready slug.

>>> ready_name_for_url( "My Cool Object" )
'My-Cool-Object'
>>> ready_name_for_url( "!My Cool Object!" )
'My-Cool-Object'
>>> ready_name_for_url( "Hello₩◎ґʟⅾ" )
'Hello'
galaxy.util.recursively_stringify_dictionary_keys(d)[source]
galaxy.util.restore_text(text, character_map={'@': '__at__', '\t': '__tc__', '\n': '__cn__', '\r': '__cr__', '[': '__ob__', ']': '__cb__', '#': '__pd__', '"': '__dq__', "'": '__sq__', '{': '__oc__', '}': '__cc__', '<': '__lt__', '>': '__gt__'})[source]

Restores sanitized text

galaxy.util.roundify(amount, sfs=2)[source]

Take a number in string form and truncate to ‘sfs’ significant figures.

galaxy.util.rst_to_html(s)[source]

Convert a blob of reStructuredText to HTML

galaxy.util.safe_str_cmp(a, b)[source]

safely compare two strings in a timing-attack-resistant manner

galaxy.util.sanitize_for_filename(text, default=None)[source]

Restricts the characters that are allowed in a filename portion; Returns default value or a unique id string if result is not a valid name. Method is overly aggressive to minimize possible complications, but a maximum length is not considered.

galaxy.util.sanitize_lists_to_string(values, valid_characters=set(['!', ' ', ')', '(', '+', '*', '-', ', ', '/', '.', '1', '0', '3', '2', '5', '4', '7', '6', '9', '8', ':', '=', '?', 'A', 'C', 'B', 'E', 'D', 'G', 'F', 'I', 'H', 'K', 'J', 'M', 'L', 'O', 'N', 'Q', 'P', 'S', 'R', 'U', 'T', 'W', 'V', 'Y', 'X', 'Z', '_', '^', 'a', 'c', 'b', 'e', 'd', 'g', 'f', 'i', 'h', 'k', 'j', 'm', 'l', 'o', 'n', 'q', 'p', 's', 'r', 'u', 't', 'w', 'v', 'y', 'x', 'z']), character_map={'@': '__at__', '\t': '__tc__', '\n': '__cn__', '\r': '__cr__', '[': '__ob__', ']': '__cb__', '#': '__pd__', '"': '__dq__', "'": '__sq__', '{': '__oc__', '}': '__cc__', '<': '__lt__', '>': '__gt__'}, invalid_character='X')[source]
galaxy.util.sanitize_param(value, valid_characters=set(['!', ' ', ')', '(', '+', '*', '-', ', ', '/', '.', '1', '0', '3', '2', '5', '4', '7', '6', '9', '8', ':', '=', '?', 'A', 'C', 'B', 'E', 'D', 'G', 'F', 'I', 'H', 'K', 'J', 'M', 'L', 'O', 'N', 'Q', 'P', 'S', 'R', 'U', 'T', 'W', 'V', 'Y', 'X', 'Z', '_', '^', 'a', 'c', 'b', 'e', 'd', 'g', 'f', 'i', 'h', 'k', 'j', 'm', 'l', 'o', 'n', 'q', 'p', 's', 'r', 'u', 't', 'w', 'v', 'y', 'x', 'z']), character_map={'@': '__at__', '\t': '__tc__', '\n': '__cn__', '\r': '__cr__', '[': '__ob__', ']': '__cb__', '#': '__pd__', '"': '__dq__', "'": '__sq__', '{': '__oc__', '}': '__cc__', '<': '__lt__', '>': '__gt__'}, invalid_character='X')[source]

Clean incoming parameters (strings or lists)

galaxy.util.sanitize_text(text, valid_characters=set(['!', ' ', ')', '(', '+', '*', '-', ', ', '/', '.', '1', '0', '3', '2', '5', '4', '7', '6', '9', '8', ':', '=', '?', 'A', 'C', 'B', 'E', 'D', 'G', 'F', 'I', 'H', 'K', 'J', 'M', 'L', 'O', 'N', 'Q', 'P', 'S', 'R', 'U', 'T', 'W', 'V', 'Y', 'X', 'Z', '_', '^', 'a', 'c', 'b', 'e', 'd', 'g', 'f', 'i', 'h', 'k', 'j', 'm', 'l', 'o', 'n', 'q', 'p', 's', 'r', 'u', 't', 'w', 'v', 'y', 'x', 'z']), character_map={'@': '__at__', '\t': '__tc__', '\n': '__cn__', '\r': '__cr__', '[': '__ob__', ']': '__cb__', '#': '__pd__', '"': '__dq__', "'": '__sq__', '{': '__oc__', '}': '__cc__', '<': '__lt__', '>': '__gt__'}, invalid_character='X')[source]

Restricts the characters that are allowed in text; accepts both strings and lists of strings; non-string entities will be cast to strings.

galaxy.util.send_mail(frm, to, subject, body, config)[source]

Sends an email.

galaxy.util.shrink_stream_by_size(value, size, join_by='..', left_larger=True, beginning_on_size_error=False, end_on_size_error=False)[source]
galaxy.util.shrink_string_by_size(value, size, join_by='..', left_larger=True, beginning_on_size_error=False, end_on_size_error=False)[source]
galaxy.util.size_to_bytes(size)[source]

Returns a number of bytes if given a reasonably formatted string with the size

galaxy.util.smart_str(s, encoding='utf-8', strings_only=False, errors='strict')[source]

Returns a bytestring version of ‘s’, encoded as specified in ‘encoding’.

If strings_only is True, don’t convert (some) non-string-like objects.

Adapted from an older, simpler version of django.utils.encoding.smart_str.

galaxy.util.string_as_bool(string)[source]
galaxy.util.string_as_bool_or_none(string)[source]
Returns True, None or False based on the argument:
True if passed True, ‘True’, ‘Yes’, or ‘On’ None if passed None or ‘None’ False otherwise

Note: string comparison is case-insensitive so lowecase versions of those function equivalently.

galaxy.util.string_to_object(s)[source]
galaxy.util.stringify_dictionary_keys(in_dict)[source]
galaxy.util.synchronized(func)[source]

This wrapper will serialize access to ‘func’ to a single thread. Use it as a decorator.

galaxy.util.umask_fix_perms(path, umask, unmasked_perms, gid=None)[source]

umask-friendly permissions fixing

galaxy.util.unicodify(value, encoding='utf-8', error='replace', default=None)[source]

Returns a unicode string or None

galaxy.util.unique_id(KEY_SIZE=128)[source]

Generates an unique id

>>> ids = [ unique_id() for i in range(1000) ]
>>> len(set(ids))
1000
galaxy.util.xml_element_compare(elem1, elem2)[source]
galaxy.util.xml_element_list_compare(elem_list1, elem_list2)[source]
galaxy.util.xml_element_to_dict(elem)[source]
galaxy.util.xml_text(root, name=None)[source]

Returns the text inside an element

galaxy.util.xml_to_string(elem, pretty=False)[source]

Returns a string from an xml tree

aliaspickler Module
class galaxy.util.aliaspickler.AliasPickleModule(aliases)[source]

Bases: object

dump(obj, fileobj, protocol=0)[source]
dumps(obj, protocol=0)[source]
load(fileobj)[source]
loads(string)[source]
class galaxy.util.aliaspickler.AliasUnpickler(aliases, *args, **kw)[source]

Bases: pickle.Unpickler

find_class(module, name)[source]
bunch Module
class galaxy.util.bunch.Bunch(**kwds)[source]

Bases: object

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308

Often we want to just collect a bunch of stuff together, naming each item of the bunch; a dictionary’s OK for that, but a small do-nothing class is even handier, and prettier to use.

get(key, default=None)[source]
items()[source]
keys()[source]
values()[source]
debugging Module
class galaxy.util.debugging.SimpleProfiler(log=None)[source]

Bases: object

Simple profiler that captures the duration between calls to report and stores the results in a list.

REPORT_FORMAT = '%20f: %s'
get_reports()[source]
report(msg)[source]
start(msg=None)[source]
galaxy.util.debugging.stack_trace_string(max_depth=None, line_format='{index}:{file}:{function}:{line}')[source]

Returns a string representation of the current stack.

Parameters:depth – positive integer to control how many levels of the stack are

returned. max_depth=None returns the entire stack (default).

expressions Module

Expression evaluation support.

For the moment this depends on python’s eval. In the future it should be replaced with a “safe” parser.

class galaxy.util.expressions.ExpressionContext(dict, parent=None)[source]

Bases: object, UserDict.DictMixin

hash_util Module

Utility functions for bi-directional Python version compatibility. Python 2.5 introduced hashlib which replaced sha in Python 2.4 and previous versions.

galaxy.util.hash_util.hmac_new(key, value)[source]
galaxy.util.hash_util.is_hashable(value)[source]
galaxy.util.hash_util.new_secure_hash(text_type=None)[source]

Returns either a sha1 hash object (if called with no arguments), or a hexdigest of the sha1 hash of the argument text_type.

heartbeat Module
class galaxy.util.heartbeat.Heartbeat(name='Heartbeat Thread', period=20, fname='heartbeat.log')[source]

Bases: threading.Thread

Thread that periodically dumps the state of all threads to a file

get_interesting_stack_frame(stack_frames)[source]

Scans a given backtrace stack frames, returns a single quadraple of [filename, line, function-name, text] of the single, deepest, most interesting frame.

Interesting being:

inside the galaxy source code ("/lib/galaxy"),
prefreably not an egg.
print_nonsleeping(threads_object_dict)[source]
run()[source]
shutdown()[source]
thread_is_sleeping(last_stack_frame)[source]

Returns True if the given stack-frame represents a known sleeper function (at least in python 2.5)

galaxy.util.heartbeat.get_current_thread_object_dict()[source]

Get a dictionary of all ‘Thread’ objects created via the threading module keyed by thread_id. Note that not all interpreter threads have a thread objects, only the main thread and any created via the ‘threading’ module. Threads created via the low level ‘thread’ module will not be in the returned dictionary.

HACK: This mucks with the internals of the threading module since that
module does not expose any way to match ‘Thread’ objects with intepreter thread identifiers (though it should).
inflection Module
class galaxy.util.inflection.Base[source]

Locale inflectors must inherit from this base class inorder to provide the basic Inflector functionality

camelize(word)[source]

Returns given word as CamelCased Converts a word like “send_email” to “SendEmail”. It will remove non alphanumeric character from the word, so “who’s online” will be converted to “WhoSOnline”

classify(table_name)[source]

Converts a table name to its class name according to rails naming conventions. Example: Converts “people” to “Person”

cond_plural(number_of_records, word)[source]

Returns the plural form of a word if first parameter is greater than 1

demodulize(module_name)[source]
foreignKey(class_name, separate_class_name_and_id_with_underscore=1)[source]

Returns class_name in underscored form, with “_id” tacked on at the end. This is for use in dealing with the database.

humanize(word, uppercase='')[source]

Returns a human-readable string from word Returns a human-readable string from word, by replacing underscores with a space, and by upper-casing the initial character by default. If you need to uppercase all the words you just have to pass ‘all’ as a second parameter.

modulize(module_description)[source]
ordinalize(number)[source]

Converts number to its ordinal English form. This method converts 13 to 13th, 2 to 2nd ...

string_replace(word, find, replace)[source]

This function returns a copy of word, translating all occurrences of each character in find to the corresponding character in replace

tableize(class_name)[source]

Converts a class name to its table name according to rails naming conventions. Example. Converts “Person” to “people”

titleize(word, uppercase='')[source]

Converts an underscored or CamelCase word into a English sentence. The titleize function converts text like “WelcomePage”, “welcome_page” or “welcome page” to this “Welcome Page”. If second parameter is set to ‘first’ it will only capitalize the first character of the title.

unaccent(text)[source]

Transforms a string to its unaccented version. This might be useful for generating “friendly” URLs

underscore(word)[source]

Converts a word “into_it_s_underscored_version” Convert any “CamelCased” or “ordinary Word” into an “underscored_word”. This can be really useful for creating friendly URLs.

urlize(text)[source]

Transform a string its unaccented and underscored version ready to be inserted in friendly URLs

variablize(word)[source]

Same as camelize but first char is lowercased Converts a word like “send_email” to “sendEmail”. It will remove non alphanumeric character from the word, so “who’s online” will be converted to “whoSOnline”

class galaxy.util.inflection.English[source]

Bases: galaxy.util.inflection.Base

Inflector for pluralize and singularize English nouns.

This is the default Inflector for the Inflector obj

pluralize(word)[source]

Pluralizes English nouns.

singularize(word)[source]

Singularizes English nouns.

class galaxy.util.inflection.Inflector(Inflector=<class galaxy.util.inflection.English>)[source]

Inflector for pluralizing and singularizing nouns.

It provides methods for helping on creating programs based on naming conventions like on Ruby on Rails.

camelize(word)[source]

Returns given word as CamelCased Converts a word like “send_email” to “SendEmail”. It will remove non alphanumeric character from the word, so “who’s online” will be converted to “WhoSOnline”

classify(table_name)[source]

Converts a table name to its class name according to rails naming conventions. Example: Converts “people” to “Person”

cond_plural(number_of_records, word)[source]

Returns the plural form of a word if first parameter is greater than 1

demodulize(module_name)[source]
foreignKey(class_name, separate_class_name_and_id_with_underscore=1)[source]

Returns class_name in underscored form, with “_id” tacked on at the end. This is for use in dealing with the database.

humanize(word, uppercase='')[source]

Returns a human-readable string from word Returns a human-readable string from word, by replacing underscores with a space, and by upper-casing the initial character by default. If you need to uppercase all the words you just have to pass ‘all’ as a second parameter.

modulize(module_description)[source]
ordinalize(number)[source]

Converts number to its ordinal form. This method converts 13 to 13th, 2 to 2nd ...

pluralize(word)[source]

Pluralizes nouns.

singularize(word)[source]

Singularizes nouns.

tableize(class_name)[source]

Converts a class name to its table name according to rails naming conventions. Example. Converts “Person” to “people”

titleize(word, uppercase='')[source]

Converts an underscored or CamelCase word into a sentence. The titleize function converts text like “WelcomePage”, “welcome_page” or “welcome page” to this “Welcome Page”. If the “uppercase” parameter is set to ‘first’ it will only capitalize the first character of the title.

unaccent(text)[source]

Transforms a string to its unaccented version. This might be useful for generating “friendly” URLs

underscore(word)[source]

Converts a word “into_it_s_underscored_version” Convert any “CamelCased” or “ordinary Word” into an “underscored_word”. This can be really useful for creating friendly URLs.

urlize(text)[source]

Transform a string to its unaccented and underscored version ready to be inserted in friendly URLs

variablize(word)[source]

Same as camelize but first char is lowercased Converts a word like “send_email” to “sendEmail”. It will remove non alphanumeric character from the word, so “who’s online” will be converted to “whoSOnline”

json Module
galaxy.util.json.dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding='utf-8', default=None, sort_keys=False, **kw)[source]

Serialize obj to a JSON formatted str.

If skipkeys is false then dict keys that are not basic types (str, unicode, int, long, float, bool, None) will be skipped instead of raising a TypeError.

If ensure_ascii is false, all non-ASCII characters are not escaped, and the return value may be a unicode instance. See dump for details.

If check_circular is false, then the circular reference check for container types will be skipped and a circular reference will result in an OverflowError (or worse).

If allow_nan is false, then it will be a ValueError to serialize out of range float values (nan, inf, -inf) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (NaN, Infinity, -Infinity).

If indent is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation. Since the default item separator is ', ', the output might include trailing whitespace when indent is specified. You can use separators=(',', ': ') to avoid this.

If separators is an (item_separator, dict_separator) tuple then it will be used instead of the default (', ', ': ') separators. (',', ':') is the most compact JSON representation.

encoding is the character encoding for str instances, default is UTF-8.

default(obj) is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError.

If sort_keys is True (default: False), then the output of dictionaries will be sorted by key.

To use a custom JSONEncoder subclass (e.g. one that overrides the .default() method to serialize additional types), specify it with the cls kwarg; otherwise JSONEncoder is used.

galaxy.util.json.loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)[source]

Deserialize s (a str or unicode instance containing a JSON document) to a Python object.

If s is a str instance and is encoded with an ASCII based encoding other than utf-8 (e.g. latin-1) then an appropriate encoding name must be specified. Encodings that are not ASCII based (such as UCS-2) are not allowed and should be decoded to unicode first.

object_hook is an optional function that will be called with the result of any object literal decode (a dict). The return value of object_hook will be used instead of the dict. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting).

object_pairs_hook is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of object_pairs_hook will be used instead of the dict. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, collections.OrderedDict will remember the order of insertion). If object_hook is also defined, the object_pairs_hook takes priority.

parse_float, if specified, will be called with the string of every JSON float to be decoded. By default this is equivalent to float(num_str). This can be used to use another datatype or parser for JSON floats (e.g. decimal.Decimal).

parse_int, if specified, will be called with the string of every JSON int to be decoded. By default this is equivalent to int(num_str). This can be used to use another datatype or parser for JSON integers (e.g. float).

parse_constant, if specified, will be called with one of the following strings: -Infinity, Infinity, NaN, null, true, false. This can be used to raise an exception if invalid JSON numbers are encountered.

To use a custom JSONDecoder subclass, specify it with the cls kwarg; otherwise JSONDecoder is used.

galaxy.util.json.safe_dumps(*args, **kwargs)[source]

This is a wrapper around dumps that encodes Infinity and NaN values. It’s a fairly rare case (which will be low in request volume). Basically, we tell json.dumps to blow up if it encounters Infinity/NaN, and we ‘fix’ it before re-encoding.

galaxy.util.json.json_fix(val)[source]
galaxy.util.json.validate_jsonrpc_request(request, regular_methods, notification_methods)[source]
galaxy.util.json.validate_jsonrpc_response(response, id=None)[source]
galaxy.util.json.jsonrpc_request(method, params=None, id=None, jsonrpc='2.0')[source]
galaxy.util.json.jsonrpc_response(request=None, id=None, result=None, error=None, jsonrpc='2.0')[source]
lrucache Module

Kanwei Li, 03/2010

Simple LRU cache that uses a dictionary to store a specified number of objects at a time.

class galaxy.util.lrucache.LRUCache(num_elements)[source]
clear()[source]

Clears/initiates storage variables

memdump Module
none_like Module

Objects with No values

class galaxy.util.none_like.NoneDataset(datatypes_registry=None, ext='data', dbkey='?')[source]

Bases: galaxy.util.none_like.RecursiveNone

missing_meta()[source]
class galaxy.util.none_like.RecursiveNone[source]
odict Module

Ordered dictionary implementation.

class galaxy.util.odict.odict(dict=None)[source]

Bases: UserDict.UserDict

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747

This dictionary class extends UserDict to record the order in which items are added. Calling keys(), values(), items(), etc. will return results in this order.

clear()[source]
copy()[source]
insert(index, key, item)[source]
items()[source]
iteritems()[source]
iterkeys()[source]
itervalues()[source]
keys()[source]
popitem()[source]
reverse()[source]
setdefault(key, failobj=None)[source]
update(dict)[source]
values()[source]
sanitize_html Module

HTML Sanitizer (ripped from feedparser)

galaxy.util.sanitize_html.sanitize_html(htmlSource, encoding='utf-8', type='text/html')[source]
shed_util Module
shed_util_common Module
streamball Module

A simple wrapper for writing tarballs as a stream.

class galaxy.util.streamball.StreamBall(mode, members=None)[source]

Bases: object

add(file, relpath, check_file=False)[source]
stream(environ, start_response)[source]
class galaxy.util.streamball.ZipBall(tmpf, tmpd)[source]

Bases: object

stream(environ, start_response)[source]
template Module
galaxy.util.template.fill_template(template_text, context=None, **kwargs)[source]
topsort Module

Topological sort.

From Tim Peters, see:
http://mail.python.org/pipermail/python-list/1999-July/006660.html

topsort takes a list of pairs, where each pair (x, y) is taken to mean that x <= y wrt some abstract partial ordering. The return value is a list, representing a total ordering that respects all the input constraints. E.g.,

topsort( [(1,2), (3,3)] )

Valid topological sorts would be any of (but nothing other than)

[3, 1, 2] [1, 3, 2] [1, 2, 3]

... however this variant ensures that ‘key’ order (first element of tuple) is preserved so the following will be result returned:

[1, 3, 2]

because those are the permutations of the input elements that respect the “1 precedes 2” and “3 precedes 3” input constraints. Note that a constraint of the form (x, x) is really just a trick to make sure x appears somewhere in the output list.

If there’s a cycle in the constraints, say

topsort( [(1,2), (2,1)] )

then CycleError is raised, and the exception object supports many methods to help analyze and break the cycles. This requires a good deal more code than topsort itself!

exception galaxy.util.topsort.CycleError(sofar, numpreds, succs)[source]

Bases: exceptions.Exception

get_elements()[source]
get_pairlist()[source]
get_partial()[source]
get_pred_counts()[source]
get_preds()[source]
get_succs()[source]
pick_a_cycle()[source]
galaxy.util.topsort.topsort(pairlist)[source]
galaxy.util.topsort.topsort_levels(pairlist)[source]
Subpackages
backports Package
backports Package

Modules for providing backward compatibility with future versions of Python

Subpackages
importlib Package
importlib Package

Backport of importlib.import_module from 3.x.

galaxy.util.backports.importlib.import_module(name, package=None)[source]

Import a module.

The ‘package’ argument is required when performing a relative import. It specifies the package to use as the anchor point from which to resolve the relative import to an absolute import.

visualization Package
visualization Package

Package for Galaxy visualization plugins.

genomes Module
class galaxy.visualization.genomes.Genome(key, description, len_file=None, twobit_file=None)[source]

Bases: object

Encapsulates information about a known genome/dbkey.

to_dict(num=None, chrom=None, low=None)[source]

Returns representation of self as a dictionary.

class galaxy.visualization.genomes.GenomeRegion(chrom=None, start=0, end=0, sequence=None)[source]

Bases: object

A genomic region on an individual chromosome.

static from_dict(obj_dict)[source]
static from_str(obj_str)[source]
class galaxy.visualization.genomes.Genomes(app)[source]

Bases: object

Provides information about available genome data and methods for manipulating that data.

check_and_reload()[source]
chroms(trans, dbkey=None, num=None, chrom=None, low=None)[source]

Returns a naturally sorted list of chroms/contigs for a given dbkey. Use either chrom or low to specify the starting chrom in the return list.

get_build(dbkey)[source]

Returns build for the given key.

get_dbkeys(trans, chrom_info=False, **kwd)[source]

Returns all known dbkeys. If chrom_info is True, only dbkeys with chromosome lengths are returned.

has_reference_data(dbkey, dbkey_owner=None)[source]

Returns true if there is reference data for the specified dbkey. If dbkey is custom, dbkey_owner is needed to determine if there is reference data.

reference(trans, dbkey, chrom, low, high)[source]

Return reference data for a build.

reload_genomes()[source]
galaxy.visualization.genomes.decode_dbkey(dbkey)[source]

Decodes dbkey and returns tuple ( username, dbkey )

Subpackages
data_providers Package
data_providers Package

Galaxy visualization/visual analysis data providers.

basic Module
class galaxy.visualization.data_providers.basic.BaseDataProvider(converted_dataset=None, original_dataset=None, dependencies=None, error_max_vals='Only the first %i values are returned.')[source]

Bases: object

Base class for data providers. Data providers (a) read and package data from datasets; and (b) write subsets of data to new datasets.

get_data(chrom, start, end, start_val=0, max_vals=9223372036854775807, **kwargs)[source]

Returns data as specified by kwargs. start_val is the first element to return and max_vals indicates the number of values to return.

Return value must be a dictionary with the following attributes:
dataset_type, data
get_iterator(**kwargs)[source]

Returns an iterator that provides data in the region chrom:start-end

has_data(**kwargs)[source]

Returns true if dataset has data in the specified genome window, false otherwise.

process_data(iterator, start_val=0, max_vals=None, **kwargs)[source]

Process data from an iterator to a format that can be provided to client.

write_data_to_file(filename, **kwargs)[source]

Write data in region defined by chrom, start, and end to a file.

class galaxy.visualization.data_providers.basic.ColumnDataProvider(original_dataset, max_lines_returned=30000)[source]

Bases: galaxy.visualization.data_providers.basic.BaseDataProvider

Data provider for columnar data

MAX_LINES_RETURNED = 30000
get_data(columns=None, start_val=0, max_vals=None, skip_comments=True, **kwargs)[source]

Returns data from specified columns in dataset. Format is list of lists where each list is a line of data.

genome Module
registry Module
Subpackages
phyloviz Package
phyloviz Package

Data providers code for PhyloViz

class galaxy.visualization.data_providers.phyloviz.PhylovizDataProvider(original_dataset=None)[source]

Bases: galaxy.visualization.data_providers.basic.BaseDataProvider

dataset_type = 'phylo'
get_data(tree_index=0)[source]

Returns trees. Trees are actually an array of JsonDicts. It’s usually one tree, except in the case of Nexus

baseparser Module
class galaxy.visualization.data_providers.phyloviz.baseparser.Base_Parser[source]

Bases: object

Base parsers contain all the methods to handle phylogeny tree creation and converting the data to json that all parsers should have

parseFile(filePath)[source]

Base method that all phylogeny file parser should have

toJson(jsonDict)[source]

Convenience method to get a json string from a python json dict

class galaxy.visualization.data_providers.phyloviz.baseparser.Node(nodeName, **kwargs)[source]

Bases: object

Node class of PhyloTree, which represents a CLAUDE in a phylogenetic tree

addChildNode(child)[source]

Adds a child node to the current node

addChildrenToJson(jsonDict)[source]

Needs a special method to addChildren, such that the key does not appear in the Jsondict when the children is empty this requirement is due to the layout algorithm used by d3 layout for hiding subtree

addMiscToJson(jsonDict)[source]

Adds other misc attributes to json if they are present

toJson()[source]

Converts the data in the node to a dict representation of json

class galaxy.visualization.data_providers.phyloviz.baseparser.PhyloTree[source]

Bases: object

Standardized python based class to represent the phylogenetic tree parsed from different phylogenetic file formats.

addAttributesToRoot(attrDict)[source]

Adds attributes to root, but first we put it in a temp store and bind it with root when .toJson is called

addRoot(root)[source]

Creates a root for phyloTree

generateJsonableDict()[source]

Changes itself into a dictonary by recurssively calling the tojson on all its nodes. Think of it as a dict in an array of dict in an array of dict and so on...

makeNode(nodeName, **kwargs)[source]

Called to make a node within PhyloTree, arbitrary kwargs can be passed to annotate nodes Tracks the number of nodes via internally incremented id

newickparser Module
class galaxy.visualization.data_providers.phyloviz.newickparser.Newick_Parser[source]

Bases: galaxy.visualization.data_providers.phyloviz.baseparser.Base_Parser

For parsing trees stored in the newick format (.nhx) It is necessarily more complex because this parser is later extended by Nexus for parsing newick as well..

cleanNewickString(rawNewick)[source]

removing semi colon, and illegal json characters (,’,”) and white spaces

parseData(newickString)[source]

To be called on a newickString directly to parse it. Returns: jsonableDict

parseFile(filePath)[source]

Parses a newick file to obtain the string inside. Returns: jsonableDict

parseNode(string, depth)[source]

Recursive method for parsing newick string, works by stripping down the string into substring of newick contained with brackers, which is used to call itself.

Eg ... ( A, B, (D, E)C, F, G ) ...

We will make the preceeding nodes first A, B, then the internal node C, its children D, E, and finally the succeeding nodes F, G

nexusparser Module
class galaxy.visualization.data_providers.phyloviz.nexusparser.Nexus_Parser[source]

Bases: galaxy.visualization.data_providers.phyloviz.newickparser.Newick_Parser

checkComments(line)[source]

Check to see if the line/lines is a comment.

parseFile(filePath)[source]

passes a file and extracts its Nexus content.

parseNexus(filename)[source]

Nexus data is stored in blocks between a line starting with begin and another line starting with end; Commends inside square brackets are to be ignored, For more information: http://wiki.christophchamp.com/index.php/NEXUS_file_format Nexus can store multiple trees

splitLinebyWhitespaces(line)[source]

replace tabs and write spaces to a single write space, so we can properly split it.

phyloxmlparser Module
class galaxy.visualization.data_providers.phyloviz.phyloxmlparser.Phyloxml_Parser[source]

Bases: galaxy.visualization.data_providers.phyloviz.baseparser.Base_Parser

Parses a phyloxml file into a json file that will be passed to PhyloViz for display

cleanTag(tagString)[source]
parseFile(filePath)[source]

passes a file and extracts its Phylogeny Tree content.

parseNode(node, depth)[source]

Parses any node within a phyloxml tree and looks out for claude, which signals the creation of nodes - internal OR leaf

genome Package
genome Package

Code for Galaxy genome visualizations.

visual_analytics Module
tracks Package
tracks Package

Summary.py required to be in this module due to pickling.

summary Module
web Package
web Package

The Galaxy web application framework

buildapp Module
form_builder Module

Classes for generating HTML forms

class galaxy.web.form_builder.AddressField(name, user=None, value=None, params=None)[source]

Bases: galaxy.web.form_builder.BaseField

static fields()[source]
get_html(disabled=False)[source]
class galaxy.web.form_builder.BaseField[source]

Bases: object

get_disabled_str(disabled=False)[source]
get_html(prefix='')[source]

Returns the html widget corresponding to the parameter

class galaxy.web.form_builder.CheckboxField(name, checked=None, refresh_on_change=False, refresh_on_change_values=None)[source]

Bases: galaxy.web.form_builder.BaseField

A checkbox (boolean input)

>>> print CheckboxField( "foo" ).get_html()
<input type="checkbox" id="foo" name="foo" value="true"><input type="hidden" name="foo" value="true">
>>> print CheckboxField( "bar", checked="yes" ).get_html()
<input type="checkbox" id="bar" name="bar" value="true" checked="checked"><input type="hidden" name="bar" value="true">
get_html(prefix='', disabled=False)[source]
static is_checked(value)[source]
set_checked(value)[source]
class galaxy.web.form_builder.DrillDownField(name, multiple=None, display=None, refresh_on_change=False, options=[], value=[], refresh_on_change_values=[])[source]

Bases: galaxy.web.form_builder.BaseField

A hierarchical select field, which allows users to ‘drill down’ a tree-like set of options.

>>> t = DrillDownField( "foo", multiple=True, display="checkbox", options=[{'name': 'Heading 1', 'value': 'heading1', 'options': [{'name': 'Option 1', 'value': 'option1', 'options': []}, {'name': 'Option 2', 'value': 'option2', 'options': []}, {'name': 'Heading 1', 'value': 'heading1', 'options': [{'name': 'Option 3', 'value': 'option3', 'options': []}, {'name': 'Option 4', 'value': 'option4', 'options': []}]}]}, {'name': 'Option 5', 'value': 'option5', 'options': []}] )
>>> print t.get_html()
<div class="form-row drilldown-container" id="drilldown--666f6f">
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--666f6f-68656164696e6731-click"></span>
<input type="checkbox" name="foo" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--666f6f-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="checkbox" name="foo" value="option1" >Option 1
</div>
<div class="form-row-input">
<input type="checkbox" name="foo" value="option2" >Option 2
</div>
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--666f6f-68656164696e6731-68656164696e6731-click"></span>
<input type="checkbox" name="foo" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--666f6f-68656164696e6731-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="checkbox" name="foo" value="option3" >Option 3
</div>
<div class="form-row-input">
<input type="checkbox" name="foo" value="option4" >Option 4
</div>
</div>
</div>
</div>
</div>
<div class="form-row-input">
<input type="checkbox" name="foo" value="option5" >Option 5
</div>
</div>
>>> t = DrillDownField( "foo", multiple=False, display="radio", options=[{'name': 'Heading 1', 'value': 'heading1', 'options': [{'name': 'Option 1', 'value': 'option1', 'options': []}, {'name': 'Option 2', 'value': 'option2', 'options': []}, {'name': 'Heading 1', 'value': 'heading1', 'options': [{'name': 'Option 3', 'value': 'option3', 'options': []}, {'name': 'Option 4', 'value': 'option4', 'options': []}]}]}, {'name': 'Option 5', 'value': 'option5', 'options': []}] )
>>> print t.get_html()
<div class="form-row drilldown-container" id="drilldown--666f6f">
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--666f6f-68656164696e6731-click"></span>
<input type="radio" name="foo" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--666f6f-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="radio" name="foo" value="option1" >Option 1
</div>
<div class="form-row-input">
<input type="radio" name="foo" value="option2" >Option 2
</div>
<div class="form-row-input">
<div><span class="form-toggle icon-button toggle-expand" id="drilldown--666f6f-68656164696e6731-68656164696e6731-click"></span>
<input type="radio" name="foo" value="heading1" >Heading 1
</div><div class="form-row" id="drilldown--666f6f-68656164696e6731-68656164696e6731-container" style="float: left; margin-left: 1em;">
<div class="form-row-input">
<input type="radio" name="foo" value="option3" >Option 3
</div>
<div class="form-row-input">
<input type="radio" name="foo" value="option4" >Option 4
</div>
</div>
</div>
</div>
</div>
<div class="form-row-input">
<input type="radio" name="foo" value="option5" >Option 5
</div>
</div>
get_html(prefix='')[source]
class galaxy.web.form_builder.FTPFileField(name, dir, ftp_site, value=None)[source]

Bases: galaxy.web.form_builder.BaseField

An FTP file upload input.

get_html(prefix='')[source]
tfoot = '\n </tbody>\n </table>\n '
thead = '\n <table id="grid-table" class="grid">\n <thead id="grid-table-header">\n <tr>\n <th id="select-header"></th>\n <th id="name-header">\n File\n </th>\n <th id="size-header">\n Size\n </th>\n <th id="date-header">\n Date\n </th>\n </tr>\n </thead>\n <tbody id="grid-table-body">\n '
trow = '\n <tr>\n <td><input type="checkbox" name="%s%s" value="%s"/></td>\n <td>%s</td>\n <td>%s</td>\n <td>%s</td>\n </tr>\n '
class galaxy.web.form_builder.FileField(name, value=None, ajax=False)[source]

Bases: galaxy.web.form_builder.BaseField

A file upload input.

>>> print FileField( "foo" ).get_html()
<input type="file" name="foo">
>>> print FileField( "foo", ajax = True ).get_html()
<input type="file" name="foo" galaxy-ajax-upload="true">
get_html(prefix='')[source]
class galaxy.web.form_builder.HiddenField(name, value=None)[source]

Bases: galaxy.web.form_builder.BaseField

A hidden field.

>>> print HiddenField( "foo", 100 ).get_html()
<input type="hidden" name="foo" value="100">
get_html(prefix='')[source]
class galaxy.web.form_builder.HistoryField(name, user=None, value=None, params=None)[source]

Bases: galaxy.web.form_builder.BaseField

get_display_text()[source]
get_html(disabled=False)[source]
class galaxy.web.form_builder.LibraryField(name, value=None, trans=None)[source]

Bases: galaxy.web.form_builder.BaseField

get_display_text()[source]
get_html(prefix='', disabled=False)[source]
class galaxy.web.form_builder.PasswordField(name, size=None, value=None)[source]

Bases: galaxy.web.form_builder.BaseField

A password input box. text appears as “**

>>> print PasswordField( "foo" ).get_html()
<input type="password" name="foo" size="10" value="">
>>> print PasswordField( "bins", size=4, value="default" ).get_html()
<input type="password" name="bins" size="4" value="default">
get_html(prefix='', disabled=False)[source]
set_size(size)[source]
class galaxy.web.form_builder.SelectField(name, multiple=None, display=None, refresh_on_change=False, refresh_on_change_values=None, size=None)[source]

Bases: galaxy.web.form_builder.BaseField

A select field.

>>> t = SelectField( "foo", multiple=True )
>>> t.add_option( "tuti", 1 )
>>> t.add_option( "fruity", "x" )
>>> print t.get_html()
<select name="foo" multiple>
<option value="1">tuti</option>
<option value="x">fruity</option>
</select>
>>> t = SelectField( "bar" )
>>> t.add_option( "automatic", 3 )
>>> t.add_option( "bazooty", 4, selected=True )
>>> print t.get_html()
<select name="bar" last_selected_value="4">
<option value="3">automatic</option>
<option value="4" selected>bazooty</option>
</select>
>>> t = SelectField( "foo", display="radio" )
>>> t.add_option( "tuti", 1 )
>>> t.add_option( "fruity", "x" )
>>> print t.get_html()
<div><input type="radio" name="foo" value="1" id="foo|1"><label class="inline" for="foo|1">tuti</label></div>
<div><input type="radio" name="foo" value="x" id="foo|x"><label class="inline" for="foo|x">fruity</label></div>
>>> t = SelectField( "bar", multiple=True, display="checkboxes" )
>>> t.add_option( "automatic", 3 )
>>> t.add_option( "bazooty", 4, selected=True )
>>> print t.get_html()
<div class="checkUncheckAllPlaceholder" checkbox_name="bar"></div>
<div><input type="checkbox" name="bar" value="3" id="bar|3"><label class="inline" for="bar|3">automatic</label></div>
<div><input type="checkbox" name="bar" value="4" id="bar|4" checked='checked'><label class="inline" for="bar|4">bazooty</label></div>
add_option(text, value, selected=False)[source]
get_html(prefix='', disabled=False)[source]
get_html_checkboxes(prefix='', disabled=False)[source]
get_html_default(prefix='', disabled=False)[source]
get_html_radio(prefix='', disabled=False)[source]
get_selected(return_label=False, return_value=False, multi=False)[source]

Return the currently selected option’s label, value or both as a tuple. For multi-select lists, a list is returned.

to_dict()[source]
class galaxy.web.form_builder.SwitchingSelectField(delegate_fields, default_field=None)[source]

Bases: galaxy.web.form_builder.BaseField

get_html(prefix='', disabled=False)[source]
primary_field
class galaxy.web.form_builder.TextArea(name, size=None, value=None)[source]

Bases: galaxy.web.form_builder.BaseField

A standard text area box.

>>> print TextArea( "foo" ).get_html()
<textarea name="foo" rows="5" cols="25"></textarea>
>>> print TextArea( "bins", size="4x5", value="default" ).get_html()
<textarea name="bins" rows="4" cols="5">default</textarea>
get_html(prefix='', disabled=False)[source]
set_size(rows, cols)[source]
class galaxy.web.form_builder.TextField(name, size=None, value=None)[source]

Bases: galaxy.web.form_builder.BaseField

A standard text input box.

>>> print TextField( "foo" ).get_html()
<input type="text" name="foo" size="10" value="">
>>> print TextField( "bins", size=4, value="default" ).get_html()
<input type="text" name="bins" size="4" value="default">
get_html(prefix='', disabled=False)[source]
set_size(size)[source]
class galaxy.web.form_builder.WorkflowField(name, user=None, value=None, params=None)[source]

Bases: galaxy.web.form_builder.BaseField

get_html(disabled=False)[source]
class galaxy.web.form_builder.WorkflowMappingField(name, user=None, value=None, params=None, **kwd)[source]

Bases: galaxy.web.form_builder.BaseField

get_display_text()[source]
get_html(disabled=False)[source]
galaxy.web.form_builder.build_select_field(trans, objs, label_attr, select_field_name, initial_value='none', selected_value='none', refresh_on_change=False, multiple=False, display=None, size=None)[source]

Build a SelectField given a set of objects. The received params are:

  • objs: the set of objects used to populate the option list

  • label_attr: the attribute of each obj (e.g., name, email, etc ) whose value is used to populate each option label.

    • If the string ‘self’ is passed as label_attr, each obj in objs is assumed to be a string, so the obj itself is used
  • select_field_name: the name of the SelectField

  • initial_value: the value of the first option in the SelectField - allows for an option telling the user to select something

  • selected_value: the value of the currently selected option

  • refresh_on_change: True if the SelectField should perform a refresh_on_change

galaxy.web.form_builder.get_suite()[source]

Get unittest suite for this module

params Module

Mixins for parsing web form and API parameters

class galaxy.web.params.BaseParamParser[source]

Bases: object

get_params(kwargs)[source]
class galaxy.web.params.QuotaParamParser[source]

Bases: galaxy.web.params.BaseParamParser

get_quota_params(kwargs)[source]
Subpackages
base Package
controller Module

Contains functionality needed in every web interface

class galaxy.web.base.controller.BaseAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseController

get_object(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]
not_implemented(trans, **kwd)[source]
validate_in_users_and_groups(trans, payload)[source]

For convenience, in_users and in_groups can be encoded IDs or emails/group names in the API.

class galaxy.web.base.controller.BaseController(app)[source]

Bases: object

Base class for Galaxy web application controllers.

decode_id(id)[source]
encode_all_ids(trans, rval, recursive=False)[source]

Encodes all integer values in the dict rval whose keys are ‘id’ or end with ‘_id’

It might be useful to turn this in to a decorator

get_class(class_name)[source]

Returns the class object that a string denotes. Without this method, we’d have to do eval(<class_name>).

get_group(trans, id, check_ownership=False, check_accessible=False, deleted=None)[source]
get_object(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]

Convenience method to get a model object with the specified checks.

get_role(trans, id, check_ownership=False, check_accessible=False, deleted=None)[source]
get_toolbox()[source]

Returns the application toolbox

get_user(trans, id, check_ownership=False, check_accessible=False, deleted=None)[source]
parse_filter_params(qdict, filter_attr_key='q', filter_value_key='qv', attr_op_split_char='-')[source]
parse_limit_offset(qdict)[source]
class galaxy.web.base.controller.BaseUIController(app)[source]

Bases: galaxy.web.base.controller.BaseController

get_object(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]
exception galaxy.web.base.controller.ControllerUnavailable[source]

Bases: exceptions.Exception

Deprecated: BaseController used to be available under the name Root

class galaxy.web.base.controller.CreatesApiKeysMixin[source]

Mixing centralizing logic for creating API keys for user objects.

Deprecated - please use api_keys.ApiKeyManager for new development.

create_api_key(trans, user)[source]
class galaxy.web.base.controller.CreatesUsersMixin[source]

Mixin centralizing logic for user creation between web and API controller.

Web controller handles additional features such e-mail subscription, activation, user forms, etc.... API created users are much more vanilla for the time being.

create_user(trans, email, username, password)[source]
class galaxy.web.base.controller.Datatype(extension, dtype, type_extension, mimetype, display_in_upload)[source]

Bases: object

Used for storing in-memory list of datatypes currently in the datatypes registry.

class galaxy.web.base.controller.ExportsHistoryMixin[source]
queue_history_export(trans, history, gzip=True, include_hidden=False, include_deleted=False)[source]
serve_ready_history_export(trans, jeha)[source]
class galaxy.web.base.controller.ImportsHistoryMixin[source]
queue_history_import(trans, archive_type, archive_source)[source]
galaxy.web.base.controller.Root

alias of BaseController

class galaxy.web.base.controller.SharableItemSecurityMixin[source]

Mixin for handling security for sharable items.

security_check(trans, item, check_ownership=False, check_accessible=False)[source]

Security checks for an item: checks if (a) user owns item or (b) item is accessible to user.

class galaxy.web.base.controller.SharableMixin[source]

Mixin for a controller that manages an item that can be shared.

create_item_slug(sa_session, item)[source]

Create/set item slug. Slug is unique among user’s importable items for item’s class. Returns true if item’s slug was set/changed; false otherwise.

display_by_username_and_slug(trans, username, slug)[source]

Display item by username and slug.

get_item(trans, id)[source]

Return item based on id.

get_item_content_async(trans, *args, **kwargs)[source]

Returns item content in HTML format.

Returns item’s name and link.

set_public_username(trans, *args, **kwargs)[source]

Set user’s public username and delegate to sharing()

set_slug_async(trans, *args, **kwargs)[source]
share(trans, *args, **kwargs)[source]

Handle sharing an item with a particular user.

sharing(trans, *args, **kwargs)[source]

Handle item sharing.

class galaxy.web.base.controller.UsesExtendedMetadataMixin[source]

Bases: galaxy.web.base.controller.SharableItemSecurityMixin

Mixin for getting and setting item extended metadata.

create_extended_metadata(trans, extmeta)[source]

Create/index an extended metadata object. The returned object is not associated with any items

delete_extended_metadata(trans, item)[source]
get_item_extended_metadata_obj(trans, item)[source]

Given an item object (such as a LibraryDatasetDatasetAssociation), find the object of the associated extended metadata

set_item_extended_metadata_obj(trans, item, extmeta_obj, check_writable=False)[source]
unset_item_extended_metadata_obj(trans, item, check_writable=False)[source]
class galaxy.web.base.controller.UsesFormDefinitionsMixin[source]

Mixin for controllers that use Galaxy form objects.

add_template(trans, cntrller, item_type, form_type, **kwd)[source]
build_form_id_select_field(trans, forms, selected_value='none')[source]
clean_field_contents(widgets, **kwd)[source]
delete_template(trans, cntrller, item_type, form_type, **kwd)[source]
edit_template(trans, cntrller, item_type, form_type, **kwd)[source]
edit_template_info(trans, cntrller, item_type, form_type, **kwd)[source]
field_param_values_ok(widget_name, widget_type, **kwd)[source]
get_all_forms(trans, all_versions=False, filter=None, form_type='All')[source]

Return all the latest forms from the form_definition_current table if all_versions is set to True. Otherwise return all the versions of all the forms from the form_definition table.

get_all_forms_by_type(trans, cntrller, form_type)[source]
get_form_values(trans, user, form_definition, **kwd)[source]

Returns the name:value dictionary containing all the form values

get_item_and_stuff(trans, item_type, **kwd)[source]
populate_widgets_from_kwd(trans, widgets, **kwd)[source]
save_widget_field(trans, field_obj, widget_name, **kwd)[source]
widget_fields_have_contents(widgets)[source]
class galaxy.web.base.controller.UsesLibraryMixin[source]
get_library(trans, id, check_ownership=False, check_accessible=True)[source]
class galaxy.web.base.controller.UsesLibraryMixinItems[source]

Bases: galaxy.web.base.controller.SharableItemSecurityMixin

can_current_user_add_to_library_item(trans, item)[source]
check_user_can_add_to_library_item(trans, item, check_accessible=True)[source]

Raise exception if user cannot add to the specified library item (i.e. Folder). Can set check_accessible to False if folder was loaded with this check.

copy_hda_to_library_folder(trans, hda, library_folder, roles=None, ldda_message='')[source]
get_library_dataset(trans, id, check_ownership=False, check_accessible=True)[source]
get_library_dataset_dataset_association(trans, id, check_ownership=False, check_accessible=True)[source]
get_library_folder(trans, id, check_ownership=False, check_accessible=True)[source]
class galaxy.web.base.controller.UsesQuotaMixin[source]

Bases: object

get_quota(trans, id, check_ownership=False, check_accessible=False, deleted=None)[source]
class galaxy.web.base.controller.UsesStoredWorkflowMixin[source]

Bases: galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations

Mixin for controllers that use StoredWorkflow objects.

get_stored_workflow(trans, id, check_ownership=True, check_accessible=False)[source]

Get a StoredWorkflow from the database by id, verifying ownership.

get_stored_workflow_steps(trans, stored_workflow)[source]

Restores states for a stored workflow’s steps.

class galaxy.web.base.controller.UsesTagsMixin[source]

Bases: galaxy.web.base.controller.SharableItemSecurityMixin

get_tag_handler(trans)[source]
get_user_tags_used(trans, user=None)[source]

Return a list of distinct ‘user_tname:user_value’ strings that the given user has used.

user defaults to trans.user. Returns an empty list if no user is given and trans.user is anonymous.

set_tags_from_list(trans, item, new_tags_list, user=None)[source]
class galaxy.web.base.controller.UsesVisualizationMixin[source]

Bases: galaxy.web.base.controller.UsesLibraryMixinItems

Mixin for controllers that use Visualization objects.

add_visualization_revision(trans, visualization, config, title, dbkey)[source]

Adds a new VisualizationRevision to the given visualization with the given parameters and set its parent visualization’s latest_revision to the new revision.

create_visualization(trans, type, title='Untitled Visualization', slug=None, dbkey=None, annotation=None, config={}, save=True)[source]

Create visualiation and first revision.

get_hda(trans, dataset_id, check_ownership=True, check_accessible=False, check_state=True)[source]

Get an HDA object by id performing security checks using the current transaction.

get_hda_or_ldda(trans, hda_ldda, dataset_id)[source]

Returns either HDA or LDDA for hda/ldda and id combination.

get_new_track_config(trans, dataset)[source]

Returns track configuration dict for a dataset.

get_published_visualizations(trans, exclude_user=None, order_by=None, query_only=False)[source]

Return query or query results for published visualizations optionally excluding the user in exclude_user.

Set order_by to a column or list of columns to change the order returned. Defaults to DEFAULT_ORDER_BY. Set query_only to return just the query for further filtering or processing.

get_tool_def(trans, hda)[source]

Returns definition of an interactive tool for an HDA.

get_visualization(trans, id, check_ownership=True, check_accessible=False)[source]

Get a Visualization from the database by id, verifying ownership.

get_visualization_config(trans, visualization)[source]

Returns a visualization’s configuration. Only works for trackster visualizations right now.

get_visualization_dict(visualization)[source]

Return a set of detailed attributes for a visualization in dictionary form. The visualization’s latest_revision is returned in its own sub-dictionary. NOTE: that encoding ids isn’t done here should happen at the caller level.

get_visualization_revision_dict(revision)[source]

Return a set of detailed attributes for a visualization in dictionary form. NOTE: that encoding ids isn’t done here should happen at the caller level.

get_visualization_summary_dict(visualization)[source]

Return a set of summary attributes for a visualization in dictionary form. NOTE: that encoding ids isn’t done here should happen at the caller level.

get_visualizations_by_user(trans, user, order_by=None, query_only=False)[source]

Return query or query results of visualizations filtered by a user.

Set order_by to a column or list of columns to change the order returned. Defaults to DEFAULT_ORDER_BY. Set query_only to return just the query for further filtering or processing.

get_visualizations_shared_with_user(trans, user, order_by=None, query_only=False)[source]

Return query or query results for visualizations shared with the given user.

Set order_by to a column or list of columns to change the order returned. Defaults to DEFAULT_ORDER_BY. Set query_only to return just the query for further filtering or processing.

import_visualization(trans, id, user=None)[source]

Copy the visualization with the given id and associate the copy with the given user (defaults to trans.user).

Raises ItemAccessibilityException if user is not passed and the current user is anonymous, and if the visualization is not importable. Raises ItemDeletionException if the visualization has been deleted.

save_visualization(trans, config, type, id=None, title=None, dbkey=None, slug=None, annotation=None)[source]
viz_types = ['trackster']
galaxy.web.base.controller.sort_by_attr(seq, attr)[source]

Sort the sequence of objects by object’s attribute Arguments: seq - the list or any sequence (including immutable one) of objects to sort. attr - the name of attribute to sort by

Subpackages
controllers Package
admin Module
class galaxy.web.base.controllers.admin.Admin[source]

Bases: object

center(trans, *args, **kwargs)[source]
create_group(trans, *args, **kwargs)[source]
create_new_user(trans, *args, **kwargs)[source]
create_role(trans, *args, **kwargs)[source]
delete_operation = None
group_list_grid = None
groups(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
job_info(trans, *args, **kwargs)[source]
jobs(trans, *args, **kwargs)[source]
manage_roles_and_groups_for_user(trans, *args, **kwargs)[source]
manage_users_and_groups_for_role(trans, *args, **kwargs)[source]
manage_users_and_roles_for_group(trans, *args, **kwargs)[source]
mark_group_deleted(trans, *args, **kwargs)[source]
mark_role_deleted(trans, *args, **kwargs)[source]
mark_user_deleted(trans, *args, **kwargs)[source]
name_autocomplete_data(trans, *args, **kwargs)[source]

Return autocomplete data for user emails

package_tool(trans, *args, **kwargs)[source]
purge_group(trans, *args, **kwargs)[source]
purge_operation = None
purge_role(trans, *args, **kwargs)[source]
purge_user(trans, *args, **kwargs)[source]
quota_list_grid = None
reload_tool(trans, *args, **kwargs)[source]
rename_group(trans, *args, **kwargs)[source]
rename_role(trans, *args, **kwargs)[source]
repository_list_grid = None
reset_user_password(trans, *args, **kwargs)[source]
role_list_grid = None
roles(trans, *args, **kwargs)[source]
tool_version_list_grid = None
tool_versions(trans, *args, **kwargs)[source]
undelete_group(trans, *args, **kwargs)[source]
undelete_operation = None
undelete_role(trans, *args, **kwargs)[source]
undelete_user(trans, *args, **kwargs)[source]
user_list_grid = None
users(trans, *args, **kwargs)[source]
galaxy.web.base.controllers.admin.get_group(trans, id)[source]

Get a Group from the database by id.

galaxy.web.base.controllers.admin.get_quota(trans, id)[source]

Get a Quota from the database by id.

galaxy.web.base.controllers.admin.get_role(trans, id)[source]

Get a Role from the database by id.

galaxy.web.base.controllers.admin.get_user(trans, user_id)[source]

Get a User from the database by id.

galaxy.web.base.controllers.admin.get_user_by_username(trans, username)[source]

Get a user from the database by username

framework Package
framework Package

Galaxy web application framework

base Module

A simple WSGI application/framework.

class galaxy.web.framework.base.DefaultWebTransaction(environ)[source]

Bases: object

Wraps the state of a single web transaction (request/response cycle).

TODO: Provide hooks to allow application specific state to be included
in here.
session[source]

Property that replaces itself with a calculated value the first time it is used.

class galaxy.web.framework.base.FieldStorage(fp=None, headers=None, outerboundary='', environ={'CELERY_LOG_REDIRECT_LEVEL': 'WARNING', 'NEW_RELIC_CONFIG_FILE': '/home/docs/newrelic.ini', 'CELERY_LOG_REDIRECT': '1', 'LOGNAME': 'docs', 'USER': 'docs', 'PATH': '/home/docs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/home/docs', 'PS1': '(docs)', 'TERM': 'linux', 'SHELL': '/bin/bash', 'TZ': 'America/Chicago', '_MP_FORK_LOGFORMAT_': '[%(asctime)s: %(levelname)s/%(processName)s] %(message)s', 'SHLVL': '1', 'SUPERVISOR_ENABLED': '1', 'CELERY_LOG_FILE': '/home/docs/log/celery_proc.log', 'DJANGO_PROJECT_DIR': '/home/docs/checkouts/readthedocs.org/readthedocs', 'SUDO_USER': 'root', 'EDITOR': 'vim', 'USERNAME': 'docs', 'READTHEDOCS': 'True', 'SUDO_UID': '0', 'VIRTUAL_ENV': '/home/docs', 'CELERY_LOADER': 'djcelery.loaders.DjangoLoader', '_MP_FORK_LOGLEVEL_': '20', 'SUPERVISOR_SERVER_URL': 'unix:///home/docs/run/supervisord-docs.sock', '_': '/home/docs/bin/supervisord', 'SUDO_COMMAND': '/bin/bash -c /home/docs/bin/supervisord --nodaemon', 'SUDO_GID': '0', 'SUPERVISOR_PROCESS_NAME': 'celery', 'OLDPWD': '/home/docs', 'PWD': '/var/build/user_builds/jmchilton-galaxy/checkouts/latest/doc/source', '_MP_FORK_LOGFILE_': '/home/docs/log/celery_proc.log', 'MAIL': '/var/mail/docs', 'CELERY_LOG_LEVEL': '20', 'SUPERVISOR_GROUP_NAME': 'celery'}, keep_blank_values=0, strict_parsing=0)[source]

Bases: cgi.FieldStorage

make_file(binary=None)[source]
read_lines()[source]
class galaxy.web.framework.base.LazyProperty(func)[source]

Bases: object

Property that replaces itself with a calculated value the first time it is used.

class galaxy.web.framework.base.Request(environ)[source]

Bases: webob.Request

Encapsulates an HTTP request.

base[source]

Property that replaces itself with a calculated value the first time it is used.

browser_url[source]

Property that replaces itself with a calculated value the first time it is used.

cookies[source]

Property that replaces itself with a calculated value the first time it is used.

path[source]

Property that replaces itself with a calculated value the first time it is used.

protocol

Descriptor that delegates a property to a key in the environ member of the associated object (provides property style access to keys in the WSGI environment)

remote_host[source]

Property that replaces itself with a calculated value the first time it is used.

remote_hostname[source]

Property that replaces itself with a calculated value the first time it is used.

remote_port

Descriptor that delegates a property to a key in the environ member of the associated object (provides property style access to keys in the WSGI environment)

class galaxy.web.framework.base.Response[source]

Bases: object

Describes an HTTP response. Currently very simple since the actual body of the request is handled separately.

get_content_type()[source]
send_redirect(url)[source]

Send an HTTP redirect response to (target url)

set_content_type(type)[source]

Sets the Content-Type header

wsgi_headeritems()[source]

Return headers in format appropriate for WSGI start_response

wsgi_status()[source]

Return status line in format appropriate for WSGI start_response

class galaxy.web.framework.base.WSGIEnvironmentProperty(key, default='')[source]

Bases: object

Descriptor that delegates a property to a key in the environ member of the associated object (provides property style access to keys in the WSGI environment)

class galaxy.web.framework.base.WebApplication[source]

Bases: object

A simple web application which maps requests to objects using routes, and to methods on those objects in the CherryPy style. Thus simple argument mapping in the CherryPy style occurs automatically, but more complicated encoding of arguments in the PATH_INFO can be performed with routes.

add_api_controller(controller_name, controller)[source]
add_route(route, **kwargs)[source]

Add a route to match a URL with a method. Accepts all keyword arguments of routes.Mapper.connect. Every route should result in at least a controller value which corresponds to one of the objects added with add_controller. It optionally may yield an action argument which will be used to locate the method to call on the controller. Additional arguments will be passed to the method as keyword args.

add_ui_controller(controller_name, controller)[source]

Add a controller class to this application. A controller class has methods which handle web requests. To connect a URL to a controller’s method use add_route.

finalize_config()[source]

Call when application is completely configured and ready to serve requests

handle_controller_exception(e, trans, **kwargs)[source]

Allow handling of exceptions raised in controller methods.

handle_request(environ, start_response)[source]
make_body_iterable(trans, body)[source]
set_transaction_factory(transaction_factory)[source]

Use the callable transaction_factory to create the transaction which will be passed to requests.

trace(**fields)[source]
galaxy.web.framework.base.flatten(seq)[source]

Flatten a possible nested set of iterables

galaxy.web.framework.base.iterate_file(file)[source]

Progressively return chunks from file.

galaxy.web.framework.base.lazy_property

alias of LazyProperty

galaxy.web.framework.base.send_file(start_response, trans, body)[source]
openid_manager Module

Manage the OpenID consumer and related data stores.

class galaxy.web.framework.openid_manager.OpenIDManager(cache_path)[source]

Bases: object

CANCEL = 'cancel'
FAILURE = 'failure'
SETUP_NEEDED = 'setup_needed'
SUCCESS = 'success'
add_sreg(trans, request, required=None, optional=None)[source]
get_consumer(trans)[source]
get_session(trans)[source]
get_sreg(info)[source]
persist_session(trans, oidconsumer)[source]
galaxy.web.framework.openid_manager.oidlog(message, level=0)[source]
Subpackages
helpers Package
helpers Package

Galaxy web framework helpers

galaxy.web.framework.helpers.css(*args)[source]

Take a list of stylesheet names (no extension) and return appropriate string of link tags.

Cache-bust with time that server started running on

galaxy.web.framework.helpers.iff(a, b, c)[source]

Ternary shortcut

galaxy.web.framework.helpers.is_true(val)[source]

Returns true if input is a boolean and true or is a string and looks like a true value.

galaxy.web.framework.helpers.js(*args)[source]

Take a prefix and list of javascript names and return appropriate string of script tags.

galaxy.web.framework.helpers.js_helper(prefix, *args)[source]

Take a prefix and list of javascript names and return appropriate string of script tags.

Cache-bust with time that server started running on

galaxy.web.framework.helpers.md5(s)[source]

Return hex encoded md5 hash of string s

galaxy.web.framework.helpers.templates(*args)[source]

Take a list of template names (no extension) and return appropriate string of script tags.

galaxy.web.framework.helpers.time_ago(x)[source]

Convert a datetime to a string.

galaxy.web.framework.helpers.to_unicode(a_string)[source]

Convert a string to unicode in utf-8 format; if string is already unicode, does nothing because string’s encoding cannot be determined by introspection.

galaxy.web.framework.helpers.truncate(content, length=100, suffix='...')[source]

Smart string truncation

grids Module
class galaxy.web.framework.helpers.grids.BooleanColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_single_filter(user, a_filter)[source]
sort(trans, query, ascending, column_name=None)[source]

Sort query using this column.

class galaxy.web.framework.helpers.grids.CommunityRatingColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn, galaxy.model.item_attrs.UsesItemRatings

Column that displays community ratings for an item.

get_value(trans, grid, item)[source]
sort(trans, query, ascending, column_name=None)[source]
class galaxy.web.framework.helpers.grids.CommunityTagsColumn(col_name, key, model_class=None, model_tag_association_class=None, filterable=None, grid_name=None)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

Column that supports community tags.

filter(trans, user, query, column_filter)[source]

Modify query to filter model_class by tag. Multiple filters are ANDed.

get_filter(trans, user, column_filter)[source]
get_value(trans, grid, item)[source]
class galaxy.web.framework.helpers.grids.DateTimeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

sort(trans, query, ascending, column_name=None)[source]

Sort query using this column.

class galaxy.web.framework.helpers.grids.DeletedColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

Column that tracks and filters for items with deleted attribute.

filter(trans, user, query, column_filter)[source]

Modify query to filter self.model_class by state.

get_accepted_filters()[source]

Returns a list of accepted filters for this column.

class galaxy.web.framework.helpers.grids.DisplayByUsernameAndSlugGridOperation(label, key=None, condition=None, allow_multiple=True, allow_popup=True, target=None, url_args=None, async_compatible=False, confirm=None, global_operation=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridOperation

Operation to display an item by username and slug.

get_url_args(item)[source]
class galaxy.web.framework.helpers.grids.Grid[source]

Bases: object

Specifies the content and format of a grid (data table).

apply_query_filter(trans, query, **kwargs)[source]
async_template = 'grid_base_async.mako'
build_initial_query(trans, **kwargs)[source]
columns = []
cur_filter_pref_name = '.filter'
cur_sort_key_pref_name = '.sort_key'
default_filter = {}
default_sort_key = None
exposed = True
get_current_item(trans, **kwargs)[source]
get_ids(**kwargs)[source]
global_actions = []
handle_operation(trans, operation, ids, **kwargs)[source]
info_text = None
legend = None
model_class = None
num_rows_per_page = 25
operations = []
pass_through_operations = {}
preserve_state = False
show_item_checkboxes = False
standard_filters = []
template = 'grid_base.mako'
title = ''
use_async = False
use_hide_message = True
use_paging = False
class galaxy.web.framework.helpers.grids.GridAction(label=None, url_args=None, inbound=False)[source]

Bases: object

class galaxy.web.framework.helpers.grids.GridColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: object

filter(trans, user, query, column_filter)[source]

Modify query to reflect the column filter.

get_accepted_filters()[source]

Returns a list of accepted filters for this column.

get_value(trans, grid, item)[source]
sort(trans, query, ascending, column_name=None)[source]

Sort query using this column.

class galaxy.web.framework.helpers.grids.GridColumnFilter(label, args=None)[source]

Bases: object

get_url_args()[source]
class galaxy.web.framework.helpers.grids.GridOperation(label, key=None, condition=None, allow_multiple=True, allow_popup=True, target=None, url_args=None, async_compatible=False, confirm=None, global_operation=None, inbound=False)[source]

Bases: object

allowed(item)[source]
get_url_args(item)[source]
class galaxy.web.framework.helpers.grids.IndividualTagsColumn(col_name, key, model_class=None, model_tag_association_class=None, filterable=None, grid_name=None)[source]

Bases: galaxy.web.framework.helpers.grids.CommunityTagsColumn

Column that supports individual tags.

get_filter(trans, user, column_filter)[source]
get_value(trans, grid, item)[source]
class galaxy.web.framework.helpers.grids.IntegerColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

Integer column that employs freetext, but checks that the text is an integer, so support filtering on integer values.

IMPORTANT NOTE: grids that use this column type should not include the column in the cols_to_filter list of MulticolFilterColumn ( i.e., searching on this column type should not be performed in the grid’s standard search - it won’t throw exceptions, but it also will not find what you’re looking for ). Grids that search on this column should use ‘filterable=”advanced”’ so that searching is only performed in the advanced search component, restricting the search to the specific column.

This is useful for searching on object ids or other integer columns. See the JobIdColumn column in the SpecifiedDateListGrid class in the jobs controller of the reports webapp for an example.

get_single_filter(user, a_filter)[source]
sort(trans, query, ascending, column_name=None)[source]

Sort query using this column.

class galaxy.web.framework.helpers.grids.MulticolFilterColumn(col_name, cols_to_filter, key, visible, filterable='default')[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

Column that performs multicolumn filtering.

filter(trans, user, query, column_filter)[source]

Modify query to filter model_class by tag. Multiple filters are ANDed.

class galaxy.web.framework.helpers.grids.OwnerAnnotationColumn(col_name, key, model_class=None, model_annotation_association_class=None, filterable=None)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn, galaxy.model.item_attrs.UsesAnnotations

Column that displays and filters item owner’s annotations.

get_single_filter(user, a_filter)[source]

Filter by annotation and annotation owner.

get_value(trans, grid, item)[source]

Returns first 150 characters of annotation.

class galaxy.web.framework.helpers.grids.OwnerColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

Column that lists item’s owner.

get_value(trans, grid, item)[source]
sort(trans, query, ascending, column_name=None)[source]

Sort column using case-insensitive alphabetical sorting on item’s username.

class galaxy.web.framework.helpers.grids.PublicURLColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

Column displays item’s public URL based on username and slug.

class galaxy.web.framework.helpers.grids.ReverseSortColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

Column that reverses sorting; this is useful when the natural sort is descending.

sort(trans, query, ascending, column_name=None)[source]
class galaxy.web.framework.helpers.grids.SharingStatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

Grid column to indicate sharing status.

filter(trans, user, query, column_filter)[source]

Modify query to filter histories by sharing status.

get_accepted_filters()[source]

Returns a list of accepted filters for this column.

get_value(trans, grid, item)[source]
class galaxy.web.framework.helpers.grids.StateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

Column that tracks and filters for items with state attribute.

IMPORTANT NOTE: self.model_class must have a states Bunch or dict if this column type is used in the grid.

filter(trans, user, query, column_filter)[source]

Modify query to filter self.model_class by state.

get_accepted_filters()[source]

Returns a list of accepted filters for this column.

get_value(trans, grid, item)[source]
class galaxy.web.framework.helpers.grids.TextColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

Generic column that employs freetext and, hence, supports freetext, case-independent filtering.

filter(trans, user, query, column_filter)[source]

Modify query to filter using free text, case independence.

get_filter(trans, user, column_filter)[source]

Returns a SQLAlchemy criterion derived from column_filter.

get_single_filter(user, a_filter)[source]

Returns a SQLAlchemy criterion derived for a single filter. Single filter is the most basic filter–usually a string–and cannot be a list.

sort(trans, query, ascending, column_name=None)[source]

Sort column using case-insensitive alphabetical sorting.

middleware Package
middleware Package

WSGI Middleware.

profile Module

Middleware that profiles the request with cProfile and displays profiling information at the bottom of each page.

class galaxy.web.framework.middleware.profile.ProfileMiddleware(app, global_conf=None, limit=40)[source]

Bases: object

Middleware that profiles all requests.

All HTML pages will have profiling information appended to them. The data is isolated to that single request, and does not include data from previous requests.

galaxy.web.framework.middleware.profile.func_std_string(func_name)[source]

Match what old profile produced

galaxy.web.framework.middleware.profile.get_func_list(stats, sel_list)[source]

Use ‘sel_list’ to select a list of functions to display.

galaxy.web.framework.middleware.profile.pstats_as_html(stats, *sel_list)[source]

Return an HTML representation of a pstats.Stats object.

remoteuser Module

Middleware for handling $REMOTE_USER if use_remote_user is enabled.

class galaxy.web.framework.middleware.remoteuser.RemoteUser(app, maildomain=None, display_servers=None, admin_users=None, remote_user_header=None, remote_user_secret_header=None)[source]

Bases: object

error(start_response, title='Access denied', message='Please contact your local Galaxy administrator.')[source]
static Module
class galaxy.web.framework.middleware.static.CacheableStaticURLParser(directory, cache_seconds=None)[source]

Bases: paste.urlparser.StaticURLParser

galaxy.web.framework.middleware.static.make_static(global_conf, document_root, cache_seconds=None)[source]
translogger Module

Middleware for logging requests, using Apache combined log format

class galaxy.web.framework.middleware.translogger.TransLogger(application, logger=None, format=None, logging_level=20, logger_name='wsgi', setup_console_handler=True, set_logger_level=10)[source]

Bases: object

This logging middleware will log all requests as they go through. They are, by default, sent to a logger named 'wsgi' at the INFO level.

If setup_console_handler is true, then messages for the named logger will be sent to the console.

format = '%(REMOTE_ADDR)s - %(REMOTE_USER)s [%(time)s] "%(REQUEST_METHOD)s %(REQUEST_URI)s %(HTTP_VERSION)s" %(status)s %(bytes)s "%(HTTP_REFERER)s" "%(HTTP_USER_AGENT)s"'
write_log(environ, method, req_uri, start, status, bytes)[source]
galaxy.web.framework.middleware.translogger.make_filter(app, global_conf, logger_name='wsgi', format=None, logging_level=20, setup_console_handler=True, set_logger_level=10)[source]

This logging middleware will log all requests as they go through. They are, by default, sent to a logger named 'wsgi' at the INFO level.

If setup_console_handler is true, then messages for the named logger will be sent to the console.

xforwardedhost Module
class galaxy.web.framework.middleware.xforwardedhost.XForwardedHostMiddleware(app, global_conf=None)[source]

Bases: object

A WSGI middleware that changes the HTTP host header in the WSGI environ based on the X-Forwarded-Host header IF found

security Package
security Package
class galaxy.web.security.SecurityHelper(**config)[source]

Bases: object

decode_guid(session_key)[source]
decode_id(obj_id, kind=None)[source]
encode_all_ids(rval, recursive=False)[source]

Encodes all integer values in the dict rval whose keys are ‘id’ or end with ‘_id’ excluding tool_id which are consumed and produced as is via the API.

encode_dict_ids(a_dict, kind=None)[source]

Encode all ids in dictionary. Ids are identified by (a) an ‘id’ key or (b) a key that ends with ‘_id’

encode_guid(session_key)[source]
encode_id(obj_id, kind=None)[source]
get_new_guid()[source]
galaxy.web.security.get_random_bytes(nbytes)[source]
webapps Package
webapps Package

Galaxy webapps root package – this is a namespace package.

Subpackages
community Package
community Package
app Module
buildapp Module
config Module
Subpackages
controllers Package
controllers Package
admin Module
common Module
hg Module
repository Module
repository_review Module
upload Module
user Module
framework Package
framework Package
Subpackages
middleware Package
middleware Package
hg Module
remoteuser Module
model Package
model Package
mapping Module
Subpackages
migrate Package
check Module
security Package
security Package
util Package
container_util Module
hgweb_config Module
shed_statistics Module
workflow_util Module
galaxy Package
buildapp Module
Subpackages
Galaxy API Documentation
Background

In addition to being accessible through a web interface, Galaxy can also be accessed programmatically, through shell scripts and other programs. The web interface is appropriate for things like exploratory analysis, visualization, construction of workflows, and rerunning workflows on new datasets.

The web interface is less suitable for things like
  • Connecting a Galaxy instance directly to your sequencer and running workflows whenever data is ready.
  • Running a workflow against multiple datasets (which can be done with the web interface, but is tedious).
  • When the analysis involves complex control, such as looping and branching.

The Galaxy API addresses these and other situations by exposing Galaxy internals through an additional interface, known as an Application Programming Interface, or API.

Quickstart

Log in as your user, navigate to the API Keys page in the User menu, and generate a new API key. Make a note of the API key, and then pull up a terminal. Now we’ll use the display.py script in your galaxy/scripts/api directory for a short example:

% ./display.py my_key http://localhost:4096/api/histories
Collection Members
------------------
#1: /api/histories/8c49be448cfe29bc
  name: Unnamed history
  id: 8c49be448cfe29bc
#2: /api/histories/33b43b4e7093c91f
  name: output test
  id: 33b43b4e7093c91f

The result is a Collection of the histories of the user specified by the API key (you). To look at the details of a particular history, say #1 above, do the following:

% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc
Member Information
------------------
state_details: {'ok': 1, 'failed_metadata': 0, 'upload': 0, 'discarded': 0, 'running': 0, 'setting_metadata': 0, 'error': 0, 'new': 0, 'queued': 0, 'empty': 0}
state: ok
contents_url: /api/histories/8c49be448cfe29bc/contents
id: 8c49be448cfe29bc
name: Unnamed history

This gives detailed information about the specific member in question, in this case the History. To view history contents, do the following:

% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc/contents
Collection Members
------------------
#1: /api/histories/8c49be448cfe29bc/contents/6f91353f3eb0fa4a
  name: Pasted Entry
  type: file
  id: 6f91353f3eb0fa4a

What we have here is another Collection of items containing all of the datasets in this particular history. Finally, to view details of a particular dataset in this collection, execute the following:

% ./display.py my_key http://localhost:4096/api/histories/8c49be448cfe29bc/contents/6f91353f3eb0fa4a
Member Information
------------------
misc_blurb: 1 line
name: Pasted Entry
data_type: txt
deleted: False
file_name: /Users/yoplait/work/galaxy-stock/database/files/000/dataset_82.dat
state: ok
download_url: /datasets/6f91353f3eb0fa4a/display?to_ext=txt
visible: True
genome_build: ?
model_class: HistoryDatasetAssociation
file_size: 17
metadata_data_lines: 1
id: 6f91353f3eb0fa4a
misc_info: uploaded txt file
metadata_dbkey: ?

And now you’ve successfully used the API to request and select a history, browse the contents of that history, and then look at detailed information about a particular dataset.

For a more comprehensive Data Library example, set the following option in your galaxy.ini as well, and restart galaxy again:

admin_users = you@example.org
library_import_dir = /path/to/some/directory

In the directory you specified for ‘library_import_dir’, create some subdirectories, and put (or symlink) files to import into Galaxy into those subdirectories.

In Galaxy, create an account that matches the address you put in ‘admin_users’, then browse to that user’s preferences and generate a new API Key. Copy the key to your clipboard and then use these scripts:

% ./display.py my_key http://localhost:4096/api/libraries
Collection Members
------------------

0 elements in collection

% ./library_create_library.py my_key http://localhost:4096/api/libraries api_test 'API Test Library'
Response
--------
/api/libraries/f3f73e481f432006
  name: api_test
  id: f3f73e481f432006

% ./display.py my_key http://localhost:4096/api/libraries
Collection Members
------------------
/api/libraries/f3f73e481f432006
  name: api_test
  id: f3f73e481f432006

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006
Member Information
------------------
synopsis: None
contents_url: /api/libraries/f3f73e481f432006/contents
description: API Test Library
name: api_test

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
Collection Members
------------------
/api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670
  name: /
  type: folder
  id: 28202595c0d2591f61ddda595d2c3670

% ./library_create_folder.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591f61ddda595d2c3670 api_test_folder1 'API Test Folder 1'
Response
--------
/api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89
  name: api_test_folder1
  id: 28202595c0d2591fa4f9089d2303fd89

% ./library_upload_from_import_dir.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents 28202595c0d2591fa4f9089d2303fd89 bed bed hg19
Response
--------
/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
  name: 2.bed
  id: e9ef7fdb2db87d7b
/api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018
  name: 3.bed
  id: 3b7f6a31f80a5018

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents
Collection Members
------------------
/api/libraries/f3f73e481f432006/contents/28202595c0d2591f61ddda595d2c3670
  name: /
  type: folder
  id: 28202595c0d2591f61ddda595d2c3670
/api/libraries/f3f73e481f432006/contents/28202595c0d2591fa4f9089d2303fd89
  name: /api_test_folder1
  type: folder
  id: 28202595c0d2591fa4f9089d2303fd89
/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
  name: /api_test_folder1/2.bed
  type: file
  id: e9ef7fdb2db87d7b
/api/libraries/f3f73e481f432006/contents/3b7f6a31f80a5018
  name: /api_test_folder1/3.bed
  type: file
  id: 3b7f6a31f80a5018

% ./display.py my_key http://localhost:4096/api/libraries/f3f73e481f432006/contents/e9ef7fdb2db87d7b
Member Information
------------------
misc_blurb: 68 regions
metadata_endCol: 3
data_type: bed
metadata_columns: 6
metadata_nameCol: 4
uploaded_by: nate@...
metadata_strandCol: 6
name: 2.bed
genome_build: hg19
metadata_comment_lines: None
metadata_startCol: 2
metadata_chromCol: 1
file_size: 4272
metadata_data_lines: 68
message:
metadata_dbkey: hg19
misc_info: uploaded bed file
date_uploaded: 2010-06-22T17:01:51.266119
metadata_column_types: str, int, int, str, int, str

Other parameters are valid when uploading, they are the same parameters as are used in the web form, like ‘link_data_only’ and etc.

The request and response format should be considered alpha and are subject to change.

API Design Guidelines

The following section outlines guidelines related to extending and/or modifing the Galaxy API. The Galaxy API has grown in an ad-hoc fashion over time by many contributors and so clients SHOULD NOT expect the API will conform to these guidelines - but developers contributing to the Galaxy API SHOULD follow these guidelines.

  • API functionality should include docstring documentation for consumption by readthedocs.org.

  • Developers should familiarize themselves with the HTTP status code definitions http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. The API responses should properly set the status code according to the result - in particular 2XX responses should be used for successful requests, 4XX for various kinds of client errors, and 5XX for the errors on the server side.

  • If there is an error processing some part of request (one item in a list for instance), the status code should be set to reflect the error and the partial result may or may not be returned depending on the controller - this behavior should be documented.

  • API methods should throw a finite number of exceptions (defined in exceptions Package) and these should subclass MessageException and not paste/wsgi HTTP exceptions. When possible, the framework itself should be responsible catching these exceptions, setting the status code, and building an error response.

  • Error responses should not consist of plain text strings - they should be dictionaries describing the error and containing the following:

    {
      "status_code": 400,
      "err_code": 400007,
      "err_msg": "Request contained invalid parameter, action could not be completed.",
      "type": "error",
      "extra_error_info": "Extra information."
    }
    

    Various error conditions (once a format has been chosen and framework to enforce it in place) should be spelled out in this document.

  • Backward compatibility is important and should be maintained when possible. If changing behavior in a non-backward compatibile way please ensure one of the following holds - there is a strong reason to believe no consumers depend on a behavior, the behavior is effectively broken, or the API method being modified has not been part of a tagged dist release.

The following bullet points represent good practices more than guidelines, please consider them when modifying the API.

  • Functionality should not be copied and pasted between controllers - consider refactoring functionality into associated classes or short of that into Mixins (http://en.wikipedia.org/wiki/Composition_over_inheritance) or into Managers (managers Package).
  • API additions are more permanent changes to Galaxy than many other potential changes and so a second opinion on API changes should be sought. (Consider a pull request!)
  • New API functionality should include functional tests. These functional tests should be implemented in Python and placed in test/functional/api. (Once such a framework is in place - it is not right now).
  • Changes to reflect modifications to the API should be pushed upstream to the BioBlend project if possible.

Longer term goals/notes.

  • It would be advantageous to have a clearer separation of anonymous and admin handling functionality.
  • If at some point in the future, functionality needs to be added that breaks backward compatibility in a significant way to a component used by the community - a “dev” variant of the API will be established and the community should be alerted and given a timeframe for when the old behavior will be replaced with the new behavior.
  • Consistent standards for range-based requests, batch requests, filtered requests, etc... should be established and documented here.
API Controllers

Galaxy offers the following API controllers:

annotations Module

API operations on annotations.

class galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesAnnotations

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
undelete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.annotations.HistoryAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'history_annotations'
tagged_item_id = 'history_id'
class galaxy.webapps.galaxy.api.annotations.HistoryContentAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'history_content_annotations'
tagged_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.annotations.WorkflowAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'workflow_annotations'
tagged_item_id = 'workflow_id'
authenticate Module

API key retrieval through BaseAuth Sample usage:

curl –user zipzap@foo.com:password http://localhost:8080/api/authenticate/baseauth

Returns:

{
“api_key”: “baa4d6e3a156d3033f05736255f195f9”

}

class galaxy.webapps.galaxy.api.authenticate.AuthenticationController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

get_api_key(trans, *args, **kwargs)[source]

def get_api_key( self, trans, **kwd ) * GET /api/authenticate/baseauth

returns an API key for authenticated user based on BaseAuth headers
Returns:api_key in json format
Return type:dict
Raises:ObjectNotFound, HTTPBadRequest
configuration Module

API operations allowing clients to determine Galaxy instance’s capabilities and configuration settings.

class galaxy.webapps.galaxy.api.configuration.ConfigurationController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

dynamic_tool_confs(trans, *args, **kwargs)[source]
get_config_dict(trans, return_admin=False, view=None, keys=None, default_view='all')[source]

Return a dictionary with (a subset of) current Galaxy settings.

If return_admin also include a subset of more sensitive keys. Pass in view (String) and comma seperated list of keys to control which configuration settings are returned.

index(trans, *args, **kwargs)[source]

GET /api/configuration Return an object containing exposable configuration settings.

Note: a more complete list is returned if the user is an admin.

tool_lineages(trans, *args, **kwargs)[source]
version(trans, *args, **kwargs)[source]

GET /api/version Return a description of the major version of Galaxy (e.g. 15.03).

Return type:dict
Returns:dictionary with major version keyed on ‘version_major’
dataset_collections Module
class galaxy.webapps.galaxy.api.dataset_collections.DatasetCollectionsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixinItems

create(trans, *args, **kwargs)[source]
  • POST /api/dataset_collections:

    create a new dataset collection instance.

Parameters:payload (dict) – (optional) dictionary structure containing: * collection_type: dataset colltion type to create. * instance_type: Instance type - ‘history’ or ‘library’. * name: the new dataset collections’s name * datasets: object describing datasets for collection
Return type:dict
Returns:element view of new dataset collection
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
datasets Module
datatypes Module

API operations allowing clients to determine datatype supported by Galaxy.

class galaxy.webapps.galaxy.api.datatypes.DatatypesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

converters(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]

GET /api/datatypes Return an object containing upload datatypes.

mapping(trans, *args, **kwargs)[source]

GET /api/datatypes/mapping Return a dictionary of class to class mappings.

sniffers(trans, *args, **kwargs)[source]

GET /api/datatypes/sniffers Return a list of sniffers.

extended_metadata Module

API operations on annotations.

class galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesExtendedMetadataMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesStoredWorkflowMixin

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
undelete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.extended_metadata.HistoryDatasetExtendMetadataController(app)[source]

Bases: galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController

controller_name = 'history_dataset_extended_metadata'
exmeta_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.extended_metadata.LibraryDatasetExtendMetadataController(app)[source]

Bases: galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController

controller_name = 'library_dataset_extended_metadata'
exmeta_item_id = 'library_content_id'
folder_contents Module

API operations on the contents of a library folder.

class galaxy.webapps.galaxy.api.folder_contents.FolderContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

Class controls retrieval, creation and updating of folder contents.

build_path(trans, folder)[source]

Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.

Parameters:
  • folder – current folder for navigating up
  • type – Galaxy LibraryFolder
Returns:

list consisting of full path to the library

Type:

list

create(self, trans, library_id, payload, **kwd)[source]
  • POST /api/folders/{encoded_id}/contents

    create a new library file from an HDA

Parameters:payload – dictionary structure containing:
Returns:a dictionary containing the id, name, and ‘show’ url of the new item
Return type:dict
Raises:ObjectAttributeInvalidException, InsufficientPermissionsException, ItemAccessibilityException, InternalServerError
index(trans, *args, **kwargs)[source]

GET /api/folders/{encoded_folder_id}/contents

Displays a collection (list) of a folder’s contents (files and folders). Encoded folder ID is prepended with ‘F’ if it is a folder as opposed to a data set which does not have it. Full path is provided in response as a separate object providing data for breadcrumb path building.

Parameters:
  • folder_id (encoded string) – encoded ID of the folder which contents should be library_dataset_dict
  • kwd (dict) – keyword dictionary with other params
Returns:

dictionary containing all items and metadata

Type:

dict

Raises:

MalformedId, InconsistentDatabase, ObjectNotFound, InternalServerError

show(trans, *args, **kwargs)[source]

GET /api/folders/{encoded_folder_id}/

update(trans, *args, **kwargs)[source]

PUT /api/folders/{encoded_folder_id}/contents

folders Module

API operations on library folders.

class galaxy.webapps.galaxy.api.folders.FoldersController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

create(self, trans, encoded_parent_folder_id, **kwd)[source]

*POST /api/folders/{encoded_parent_folder_id}

Create a new folder object underneath the one specified in the parameters.

Parameters:
  • encoded_parent_folder_id (an encoded id string (should be prefixed by ‘F’)) – the parent folder’s id (required)
  • name (str) – the name of the new folder (required)
  • description (str) – the description of the new folder
Returns:

information about newly created folder, notably including ID

Return type:

dictionary

Raises:

RequestParameterMissingException

delete(self, trans, id, **kwd)[source]
  • DELETE /api/folders/{id}

    marks the folder with the given id as deleted (or removes the deleted mark if the undelete param is true)

Note

Currently, only admin users can un/delete folders.

Parameters:
  • id (an encoded id string) – the encoded id of the folder to un/delete
  • undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
Returns:

detailed folder information

Return type:

dictionary

Raises:

ItemAccessibilityException, MalformedId, ObjectNotFound

get_permissions(trans, *args, **kwargs)[source]
  • GET /api/folders/{id}/permissions

Load all permissions for the given folder id and return it.

Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder
  • scope (string) – either ‘current’ or ‘available’
Returns:

dictionary with all applicable permissions’ values

Return type:

dictionary

Raises:

ObjectNotFound, InsufficientPermissionsException

index(trans, *args, **kwargs)[source]

*GET /api/folders/ This would normally display a list of folders. However, that would be across multiple libraries, so it’s not implemented.

set_permissions(trans, *args, **kwargs)[source]
def set_permissions( self, trans, encoded_folder_id, **kwd ):
*POST /api/folders/{encoded_folder_id}/permissions
Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to set the permissions of
  • action (string) – (required) describes what action should be performed available actions: set_permissions
  • add_ids[] (string or list) – list of Role.id defining roles that should have add item permission on the folder
  • manage_ids[] (string or list) – list of Role.id defining roles that should have manage permission on the folder
  • modify_ids[] (string or list) – list of Role.id defining roles that should have modify permission on the folder
Return type:

dictionary

Returns:

dict of current roles for all available permission types.

Raises:

RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

show(self, trans, id, **kwd)[source]

*GET /api/folders/{encoded_folder_id}

Displays information about a folder.

Parameters:id (an encoded id string (has to be prefixed by ‘F’)) – the folder’s encoded id (required)
Returns:dictionary including details of the folder
Return type:dict
update(trans, *args, **kwargs)[source]

PUT /api/folders/{encoded_folder_id}

forms Module

API operations on FormDefinition objects.

class galaxy.webapps.galaxy.api.forms.FormDefinitionAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/forms Creates a new form.

index(trans, *args, **kwargs)[source]

GET /api/forms Displays a collection (list) of forms.

show(trans, *args, **kwargs)[source]

GET /api/forms/{encoded_form_id} Displays information about a form.

ftp_files Module
genomes Module
class galaxy.webapps.galaxy.api.genomes.GenomesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with genome data.

index(trans, *args, **kwargs)[source]

GET /api/genomes: returns a list of installed genomes

show(trans, *args, **kwargs)[source]

GET /api/genomes/{id}

Returns information about build <id>

galaxy.webapps.galaxy.api.genomes.get_id(base, format)[source]
group_roles Module

API operations on Group objects.

class galaxy.webapps.galaxy.api.group_roles.GroupRolesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

delete(trans, *args, **kwargs)[source]

DELETE /api/groups/{encoded_group_id}/roles/{encoded_role_id} Removes a role from a group

index(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/roles Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/roles/{encoded_role_id} Displays information about a group role.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id}/roles/{encoded_role_id} Adds a role to a group

group_users Module

API operations on Group objects.

class galaxy.webapps.galaxy.api.group_users.GroupUsersAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

delete(trans, *args, **kwargs)[source]

DELETE /api/groups/{encoded_group_id}/users/{encoded_user_id} Removes a user from a group

index(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/users Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/users/{encoded_user_id} Displays information about a group user.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id}/users/{encoded_user_id} Adds a user to a group

groups Module

API operations on Group objects.

class galaxy.webapps.galaxy.api.groups.GroupAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/groups Creates a new group.

index(trans, *args, **kwargs)[source]

GET /api/groups Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id} Displays information about a group.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id} Modifies a group.

histories Module

API operations on a history.

class galaxy.webapps.galaxy.api.histories.HistoriesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.ExportsHistoryMixin, galaxy.web.base.controller.ImportsHistoryMixin

archive_download(trans, *args, **kwargs)[source]

export_download( self, trans, id, jeha_id ) * GET /api/histories/{id}/exports/{jeha_id}:

If ready and available, return raw contents of exported history. Use/poll “PUT /api/histories/{id}/exports” to initiate the creation of such an export - when ready that route will return 200 status code (instead of 202) with a JSON dictionary containing a download_url.
archive_export(trans, *args, **kwargs)[source]

export_archive( self, trans, id, payload ) * PUT /api/histories/{id}/exports:

start job (if needed) to create history export for corresponding history.
Parameters:id (str) – the encoded id of the history to export
Return type:dict
Returns:object containing url to fetch export from.
citations(trans, *args, **kwargs)[source]
create(trans, payload)[source]
  • POST /api/histories:

    create a new history

Parameters:
  • payload (dict) – (optional) dictionary structure containing: * name: the new history’s name * history_id: the id of the history to copy * archive_source: the url that will generate the archive to import * archive_type: ‘url’ (default)
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

element view of new history

delete(self, trans, id, **kwd)[source]
  • DELETE /api/histories/{id}

    delete the history with the given id

Note

Stops all active jobs in the history if purge is set.

Parameters:
  • id (str) – the encoded id of the history to delete
  • kwd (dict) – (optional) dictionary structure containing extra parameters

You can purge a history, removing all it’s datasets from disk (if unshared), by passing in purge=True in the url.

Parameters:
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

the deleted or purged history

index(trans, deleted='False')[source]
  • GET /api/histories:

    return undeleted histories for the current user

  • GET /api/histories/deleted:

    return deleted histories for the current user

Note

Anonymous users are allowed to get their current history

Parameters:deleted (boolean) – if True, show only deleted histories, if False, non-deleted
Return type:list
Returns:list of dictionaries containing summary history information
The following are optional parameters:
view: string, one of (‘summary’,’detailed’), defaults to ‘summary’
controls which set of properties to return
keys: comma separated strings, unused by default
keys/names of individual properties to return

If neither keys or views are sent, the default view (set of keys) is returned. If both a view and keys are sent, the key list and the view’s keys are combined. If keys are send and no view, only those properties in keys are returned.

For which properties are available see:
galaxy/managers/histories/HistorySerializer
The list returned can be filtered by using two optional parameters:
q: string, generally a property name to filter by followed
by an (often optional) hyphen and operator string.

qv: string, the value to filter by

..example:

To filter the list to only those created after 2015-01-29, the query string would look like:

‘?q=create_time-gt&qv=2015-01-29’
Multiple filters can be sent in using multiple q/qv pairs:
‘?q=create_time-gt&qv=2015-01-29&q=tag-has&qv=experiment-1’
The list returned can be paginated using two optional parameters:
limit: integer, defaults to no value and no limit (return all)
how many items to return
offset: integer, defaults to 0 and starts at the beginning
skip the first ( offset - 1 ) items and begin returning at the Nth item
..example:
limit and offset can be combined. Skip the first two and return five:
‘?limit=5&offset=3’
show(trans, id, deleted='False')[source]
  • GET /api/histories/{id}:

    return the history with id

  • GET /api/histories/deleted/{id}:

    return the deleted history with id

  • GET /api/histories/most_recently_used:

    return the most recently used history

Parameters:
  • id (an encoded id string) – the encoded id of the history to query or the string ‘most_recently_used’
  • deleted (boolean) – if True, allow information on a deleted history to be shown.
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dictionary

Returns:

detailed history information

undelete(self, trans, id, **kwd)[source]
  • POST /api/histories/deleted/{id}/undelete:

    undelete history (that hasn’t been purged) with the given id

Parameters:
  • id (str) – the encoded id of the history to undelete
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

str

Returns:

‘OK’ if the history was undeleted

update(self, trans, id, payload, **kwd)[source]
  • PUT /api/histories/{id}

    updates the values for the history with the given id

Parameters:
  • id (str) – the encoded id of the history to update
  • payload (dict) –

    a dictionary containing any or all the fields in galaxy.model.History.to_dict() and/or the following:

    • annotation: an annotation for the history
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated

history_contents Module

API operations on the contents of a history.

class galaxy.webapps.galaxy.api.history_contents.HistoryContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesTagsMixin

create(self, trans, history_id, payload, **kwd)[source]
  • POST /api/histories/{history_id}/contents/{type}

    create a new HDA by copying an accessible LibraryDataset

Parameters:
  • history_id (str) – encoded id string of the new HDA’s History
  • type (str) – Type of history content - ‘dataset’ (default) or ‘dataset_collection’.
  • payload (dict) –

    dictionary structure containing:: copy from library (for type ‘dataset’): ‘source’ = ‘library’ ‘content’ = [the encoded id from the library dataset]

    copy from history dataset (for type ‘dataset’): ‘source’ = ‘hda’ ‘content’ = [the encoded id from the HDA]

    copy from history dataset collection (for type ‘dataset_collection’) ‘source’ = ‘hdca’ ‘content’ = [the encoded id from the HDCA]

    create new history dataset collection (for type ‘dataset_collection’) ‘source’ = ‘new_collection’ (default ‘source’ if type is

    ‘dataset_collection’ - no need to specify this)

    ‘collection_type’ = For example, “list”, “paired”, “list:paired”. ‘name’ = Name of new dataset collection. ‘element_identifiers’ = Recursive list structure defining collection.

    Each element must have ‘src’ which can be ‘hda’, ‘ldda’, ‘hdca’, or ‘new_collection’, as well as a ‘name’ which is the name of element (e.g. “forward” or “reverse” for paired datasets, or arbitrary sample names for instance for lists). For all src’s except ‘new_collection’ - a encoded ‘id’ attribute must be included wiht element as well. ‘new_collection’ sources must defined a ‘collection_type’ and their own list of (potentially) nested ‘element_identifiers’.
..note:
Currently, a user can only copy an HDA from a history that the user owns.
Return type:dict
Returns:dictionary containing detailed information for the new HDA
delete(self, trans, history_id, id, **kwd)[source]
  • DELETE /api/histories/{history_id}/contents/{id}

    delete the HDA with the given id

Note

Currently does not stop any active jobs for which this dataset is an output.

Parameters:
  • id (str) – the encoded id of the history to delete
  • purge (bool) – if True, purge the HDA
  • kwd (dict) –

    (optional) dictionary structure containing:

    • payload: a dictionary itself containing:
      • purge: if True, purge the HDA

Note

that payload optionally can be placed in the query string of the request. This allows clients that strip the request body to still purge the dataset.

Return type:dict
Returns:an error object if an error occurred or a dictionary containing: * id: the encoded id of the history, * deleted: if the history was marked as deleted, * purged: if the history was purged
index(self, trans, history_id, ids=None, **kwd)[source]
  • GET /api/histories/{history_id}/contents

    return a list of HDA data for the history with the given id

Note

Anonymous users are allowed to get their current history contents

If Ids is not given, index returns a list of summary objects for every HDA associated with the given history_id.

If ids is given, index returns a more complete json object for each HDA in the ids list.

Parameters:
  • history_id (str) – encoded id string of the HDA’s History
  • ids (str) – (optional) a comma separated list of encoded HDA ids
  • types (str) – (optional) kinds of contents to index (currently just dataset, but dataset_collection will be added shortly).
Return type:

list

Returns:

dictionaries containing summary or detailed HDA information

show(self, trans, id, history_id, **kwd)[source]
  • GET /api/histories/{history_id}/contents/{id}

    return detailed information about an HDA within a history

Note

Anonymous users are allowed to get their current history contents

Parameters:
  • ids – the encoded id of the HDA to return
  • history_id (str) – encoded id string of the HDA’s History
Return type:

dict

Returns:

dictionary containing detailed HDA information

update(self, trans, history_id, id, payload, **kwd)[source]
  • PUT /api/histories/{history_id}/contents/{id}

    updates the values for the HDA with the given id

Parameters:
  • history_id (str) – encoded id string of the HDA’s History
  • id (str) – the encoded id of the history to undelete
  • payload (dict) –

    a dictionary containing any or all the fields in galaxy.model.HistoryDatasetAssociation.to_dict() and/or the following:

    • annotation: an annotation for the HDA
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated

item_tags Module

API operations related to tagging items.

class galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesTagsMixin

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
update(trans, *args, **kwargs)
class galaxy.webapps.galaxy.api.item_tags.HistoryContentTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'history_content_tags'
tagged_item_class = 'HistoryDatasetAssociation'
tagged_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.item_tags.HistoryTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'history_tags'
tagged_item_class = 'History'
tagged_item_id = 'history_id'
class galaxy.webapps.galaxy.api.item_tags.WorkflowTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'workflow_tags'
tagged_item_class = 'StoredWorkflow'
tagged_item_id = 'workflow_id'
job_files Module

API for asynchronous job running mechanisms can use to fetch or put files related to running and queued jobs.

class galaxy.webapps.galaxy.api.job_files.JobFilesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

This job files controller allows remote job running mechanisms to read and modify the current state of files for queued and running jobs. It is certainly not meant to represent part of Galaxy’s stable, user facing API.

Furthermore, even if a user key corresponds to the user running the job, it should not be accepted for authorization - this API allows access to low-level unfiltered files and such authorization would break Galaxy’s security model for tool execution.

create(self, trans, job_id, payload, **kwargs)[source]
  • POST /api/jobs/{job_id}/files

    Populate an output file (formal dataset, task split part, working directory file (such as those related to metadata)). This should be a multipart post with a ‘file’ parameter containing the contents of the actual file to create.

Parameters:
  • job_id (str) – encoded id string of the job
  • payload (dict) – dictionary structure containing:: ‘job_key’ = Key authenticating ‘path’ = Path to file to create.
..note:
This API method is intended only for consumption by job runners, not end users.
Return type:dict
Returns:an okay message
index(self, trans, job_id, **kwargs)[source]
  • GET /api/jobs/{job_id}/files

    Get a file required to staging a job (proper datasets, extra inputs, task-split inputs, working directory files).

Parameters:
  • job_id (str) – encoded id string of the job
  • path (str) – Path to file.
  • job_key (str) – A key used to authenticate this request as acting on behalf or a job runner for the specified job.
..note:
This API method is intended only for consumption by job runners, not end users.
Return type:binary
Returns:contents of file
jobs Module

API operations on a jobs.

See also

galaxy.model.Jobs

class galaxy.webapps.galaxy.api.jobs.JobController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixinItems

create(trans, *args, **kwargs)[source]

See the create method in tools.py in order to submit a job.

index(trans, state=None, tool_id=None, history_id=None, date_range_min=None, date_range_max=None, user_details=False)[source]
  • GET /api/jobs:

    return jobs for current user

    !! if user is admin and user_details is True, then

    return jobs for all galaxy users based on filtering - this is an extended service

Parameters:state (string or list) – limit listing of jobs to those that match one of the included states. If none, all are returned.
Valid Galaxy job states include:
‘new’, ‘upload’, ‘waiting’, ‘queued’, ‘running’, ‘ok’, ‘error’, ‘paused’, ‘deleted’, ‘deleted_new’
Parameters:
  • tool_id (string or list) – limit listing of jobs to those that match one of the included tool_ids. If none, all are returned.
  • user_details (boolean) – if true, and requestor is an admin, will return external job id and user email.
  • date_range_min (string ‘2014-01-01’) – limit the listing of jobs to those updated on or after requested date
  • date_range_max (string ‘2014-12-31’) – limit the listing of jobs to those updated on or before requested date
  • history_id (string) – limit listing of jobs to those that match the history_id. If none, all are returned.
Return type:

list

Returns:

list of dictionaries containing summary job information

inputs(trans, *args, **kwargs)[source]

show( trans, id ) * GET /api/jobs/{job_id}/inputs

returns input datasets created by job
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing input dataset associations
outputs(trans, *args, **kwargs)[source]

show( trans, id ) * GET /api/jobs/{job_id}/outputs

returns output datasets created by job
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing output dataset associations
search(trans, payload)[source]
  • POST /api/jobs/search:

    return jobs for current user

Parameters:payload (dict) – Dictionary containing description of requested job. This is in the same format as a request to POST /apt/tools would take to initiate a job
Return type:list
Returns:list of dictionaries containing summary job information of the jobs that match the requested job run

This method is designed to scan the list of previously run jobs and find records of jobs that had the exact some input parameters and datasets. This can be used to minimize the amount of repeated work, and simply recycle the old results.

show(trans, id)[source]
  • GET /api/jobs/{job_id}:

    return jobs for current user

Parameters:
  • id (string) – Specific job id
  • full (boolean) – whether to return extra information
Return type:

dictionary

Returns:

dictionary containing full description of job data

lda_datasets Module

API operations on the library datasets.

class galaxy.webapps.galaxy.api.lda_datasets.LibraryDatasetsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin

delete(trans, *args, **kwargs)[source]

delete( self, trans, encoded_dataset_id, **kwd ): * DELETE /api/libraries/datasets/{encoded_dataset_id}

Marks the dataset deleted or undeleted based on the value of the undelete flag. If the flag is not present it is considered False and the item is marked deleted.
Parameters:encoded_dataset_id (an encoded id string) – the encoded id of the dataset to change
Returns:dict containing information about the dataset
Return type:dictionary
download(self, trans, format, **kwd)[source]
  • GET /api/libraries/datasets/download/{format}

  • POST /api/libraries/datasets/download/{format}

    Downloads requested datasets (identified by encoded IDs) in requested format.

example: GET localhost:8080/api/libraries/datasets/download/tbz?ld_ids%255B%255D=a0d84b45643a2678&ld_ids%255B%255D=fe38c84dcd46c828

Note

supported format values are: ‘zip’, ‘tgz’, ‘tbz’, ‘uncompressed’

Parameters:
  • format (string) – string representing requested archive format
  • ld_ids[] (an array) – an array of encoded ids
Return type:

file

Returns:

either archive with the requested datasets packed inside or a single uncompressed dataset

Raises:

MessageException, ItemDeletionException, ItemAccessibilityException, HTTPBadRequest, OSError, IOError, ObjectNotFound

load(trans, *args, **kwargs)[source]

load( self, trans, **kwd ): * POST /api/libraries/datasets Load dataset from the given source into the library. Source can be:

user directory - root folder specified in galaxy.ini as “$user_library_import_dir”
example path: path/to/galaxy/$user_library_import_dir/user@example.com/{user can browse everything here} the folder with the user login has to be created beforehand
(admin)import directory - root folder specified in galaxy ini as “$library_import_dir”
example path: path/to/galaxy/$library_import_dir/{admin can browse everything here}

(admin)any absolute or relative path - option allowed with “allow_library_path_paste” in galaxy.ini

Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to import dataset(s) to
  • source (str) – source the datasets should be loaded form
  • link_data (bool) – flag whether to link the dataset to data or copy it to Galaxy, defaults to copy while linking is set to True all symlinks will be resolved _once_
  • preserve_dirs (bool) – flag whether to preserve the directory structure when importing dir if False only datasets will be imported
  • file_type (str) – file type of the loaded datasets, defaults to ‘auto’ (autodetect)
  • dbkey (str) – dbkey of the loaded genome, defaults to ‘?’ (unknown)
Returns:

dict containing information about the created upload job

Return type:

dictionary

show(self, trans, id, **kwd)[source]
  • GET /api/libraries/datasets/{encoded_dataset_id}:

    Displays information about the dataset identified by the encoded ID.

Parameters:id (an encoded id string) – the encoded id of the dataset to query
Returns:detailed dataset information from base controller
Return type:dictionary
show_roles(trans, *args, **kwargs)[source]

show_roles( self, trans, id, **kwd ): * GET /api/libraries/datasets/{encoded_dataset_id}/permissions

Displays information about current or available roles for a given dataset permission.
Parameters:
  • encoded_dataset_id (an encoded id string) – the encoded id of the dataset to query
  • scope (string) – either ‘current’ or ‘available’
Return type:

dictionary

Returns:

either dict of current roles for all permission types or dict of available roles to choose from (is the same for any permission type)

show_version(trans, *args, **kwargs)[source]

show_version( self, trans, encoded_dataset_id, encoded_ldda_id, **kwd ): * GET /api/libraries/datasets/:encoded_dataset_id/versions/:encoded_ldda_id

Displays information about specific version of the library_dataset (i.e. ldda).
Parameters:
  • encoded_dataset_id (an encoded id string) – the encoded id of the dataset to query
  • encoded_ldda_id (an encoded id string) – the encoded id of the ldda to query
Return type:

dictionary

Returns:

dict of ldda’s details

update_permissions(trans, *args, **kwargs)[source]
def update( self, trans, encoded_dataset_id, **kwd ):
*POST /api/libraries/datasets/{encoded_dataset_id}/permissions
Parameters:
  • encoded_dataset_id (an encoded id string) – the encoded id of the dataset to update permissions of
  • action (string) – (required) describes what action should be performed available actions: make_private, remove_restrictions, set_permissions
  • access_ids[] (string or list) – list of Role.name defining roles that should have access permission on the dataset
  • manage_ids[] (string or list) – list of Role.name defining roles that should have manage permission on the dataset
  • modify_ids[] (string or list) – list of Role.name defining roles that should have modify permission on the library dataset item
Return type:

dictionary

Returns:

dict of current roles for all available permission types

Raises:

RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

libraries Module

API operations on a data library.

class galaxy.webapps.galaxy.api.libraries.LibrariesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(self, trans, payload, **kwd)[source]
  • POST /api/libraries:

    Creates a new library. Only name parameter is required.

Note

Currently, only admin users can create libraries.

Parameters:payload (dict) – dictionary structure containing:: ‘name’: the new library’s name (required) ‘description’: the new library’s description (optional) ‘synopsis’: the new library’s synopsis (optional)
Returns:detailed library information
Return type:dict
Raises:ItemAccessibilityException, RequestParameterMissingException
delete(self, trans, id, **kwd)[source]
  • DELETE /api/libraries/{id}

    marks the library with the given id as deleted (or removes the deleted mark if the undelete param is true)

Note

Currently, only admin users can un/delete libraries.

Parameters:
  • id (an encoded id string) – the encoded id of the library to un/delete
  • undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
Returns:

detailed library information

Return type:

dictionary

Raises:ItemAccessibilityException, MalformedId, ObjectNotFound
get_permissions(trans, *args, **kwargs)[source]
  • GET /api/libraries/{id}/permissions

Load all permissions for the given library id and return it.

Parameters:
  • encoded_library_id (an encoded id string) – the encoded id of the library
  • scope (string) – either ‘current’ or ‘available’
  • is_library_access (bool) – indicates whether the roles available for the library access are requested
Returns:

dictionary with all applicable permissions’ values

Return type:

dictionary

Raises:

ObjectNotFound, InsufficientPermissionsException

index(self, trans, **kwd)[source]
  • GET /api/libraries:

    Returns a list of summary data for all libraries.

Parameters:deleted (boolean (optional)) – if True, show only deleted libraries, if False show only non-deleted
Returns:list of dictionaries containing library information
Return type:list
set_permissions(trans, *args, **kwargs)[source]
def set_permissions( self, trans, encoded_dataset_id, **kwd ):
*POST /api/libraries/{encoded_library_id}/permissions
Parameters:
  • encoded_library_id (an encoded id string) – the encoded id of the library to set the permissions of
  • action (string) – (required) describes what action should be performed available actions: remove_restrictions, set_permissions
  • access_ids[] (string or list) – list of Role.id defining roles that should have access permission on the library
  • add_ids[] (string or list) – list of Role.id defining roles that should have add item permission on the library
  • manage_ids[] (string or list) – list of Role.id defining roles that should have manage permission on the library
  • modify_ids[] (string or list) – list of Role.id defining roles that should have modify permission on the library
Return type:

dictionary

Returns:

dict of current roles for all available permission types

Raises:

RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

set_permissions_old(trans, library, payload, **kwd)[source]

* old implementation for backward compatibility *

POST /api/libraries/{encoded_library_id}/permissions Updates the library permissions.

show(self, trans, id, deleted='False', **kwd)[source]
  • GET /api/libraries/{encoded_id}:

    returns detailed information about a library

  • GET /api/libraries/deleted/{encoded_id}:

    returns detailed information about a deleted library

Parameters:
  • id (an encoded id string) – the encoded id of the library
  • deleted (boolean) – if True, allow information on a deleted library
Returns:

detailed library information

Return type:

dictionary

Raises:MalformedId, ObjectNotFound
update(trans, *args, **kwargs)[source]
  • PATCH /api/libraries/{encoded_id}

    Updates the library defined by an encoded_id with the data in the payload.

Note

Currently, only admin users can update libraries. Also the library must not be deleted.

param id:the encoded id of the library
type id:an encoded id string
param payload:(required) dictionary structure containing:: ‘name’: new library’s name, cannot be empty ‘description’: new library’s description ‘synopsis’: new library’s synopsis
type payload:dict
returns:detailed library information
rtype:dict
raises:ItemAccessibilityException, MalformedId, ObjectNotFound, RequestParameterInvalidException, RequestParameterMissingException
library_contents Module

API operations on the contents of a data library.

class galaxy.webapps.galaxy.api.library_contents.LibraryContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

create(self, trans, library_id, payload, **kwd)[source]
  • POST /api/libraries/{library_id}/contents:

    create a new library file or folder

To copy an HDA into a library send create_type of ‘file’ and the HDA’s encoded id in from_hda_id (and optionally ldda_message).

Parameters:
  • library_id (str) – the encoded id of the library where to create the new item
  • payload (dict) –

    dictionary structure containing:

    • folder_id: the encoded id of the parent folder of the new item
    • create_type: the type of item to create (‘file’, ‘folder’ or ‘collection’)
    • from_hda_id: (optional, only if create_type is ‘file’) the
      encoded id of an accessible HDA to copy into the library
    • ldda_message: (optional) the new message attribute of the LDDA created
    • extended_metadata: (optional) dub-dictionary containing any extended
      metadata to associate with the item
    • upload_option: (optional) one of ‘upload_file’ (default), ‘upload_directory’ or ‘upload_paths’
    • server_dir: (optional, only if upload_option is
      ‘upload_directory’) relative path of the subdirectory of Galaxy library_import_dir to upload. All and only the files (i.e. no subdirectories) contained in the specified directory will be uploaded.
    • filesystem_paths: (optional, only if upload_option is
      ‘upload_paths’ and the user is an admin) file paths on the Galaxy server to upload to the library, one file per line
    • link_data_only: (optional, only when upload_option is
      ‘upload_directory’ or ‘upload_paths’) either ‘copy_files’ (default) or ‘link_to_files’. Setting to ‘link_to_files’ symlinks instead of copying the files
    • name: (optional, only if create_type is ‘folder’) name of the
      folder to create
    • description: (optional, only if create_type is ‘folder’)
      description of the folder to create
Return type:

dict

Returns:

a dictionary containing the id, name, and ‘show’ url of the new item

delete(self, trans, library_id, id, **kwd)[source]
  • DELETE /api/libraries/{library_id}/contents/{id}

    delete the LibraryDataset with the given id

Parameters:
  • id (str) – the encoded id of the library dataset to delete
  • kwd (dict) –

    (optional) dictionary structure containing:

    • payload: a dictionary itself containing:
      • purge: if True, purge the LD
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing: * id: the encoded id of the library dataset, * deleted: if the library dataset was marked as deleted, * purged: if the library dataset was purged

index(self, trans, library_id, **kwd)[source]
  • GET /api/libraries/{library_id}/contents:

    Returns a list of library files and folders.

Note

May be slow! Returns all content traversing recursively through all folders.

See also

galaxy.webapps.galaxy.api.FolderContentsController.index for a non-recursive solution

Parameters:library_id (str) – the encoded id of the library
Returns:list of dictionaries of the form: * id: the encoded id of the library item * name: the ‘library path’
or relationship of the library item to the root
  • type: ‘file’ or ‘folder’
  • url: the url to get detailed information on the library item
Return type:list
Raises:MalformedId, InconsistentDatabase, RequestParameterInvalidException, InternalServerError
show(self, trans, id, library_id, **kwd)[source]
  • GET /api/libraries/{library_id}/contents/{id}

    Returns information about library file or folder.

Parameters:
  • id (str) – the encoded id of the library item to return
  • library_id (str) – the encoded id of the library that contains this item
Returns:

detailed library item information

Return type:

dict

update(self, trans, id, library_id, payload, **kwd)[source]
  • PUT /api/libraries/{library_id}/contents/{id}

    create a ImplicitlyConvertedDatasetAssociation

Parameters:
  • id (str) – the encoded id of the library item to return
  • library_id (str) – the encoded id of the library that contains this item
  • payload (dict) – dictionary structure containing:: ‘converted_dataset_id’:
Return type:

None

Returns:

None

metrics Module

API operations for for querying and recording user metrics from some client (typically a user’s browser).

class galaxy.webapps.galaxy.api.metrics.MetricsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, payload)[source]
  • POST /api/metrics:

    record any metrics sent and return some status object

Note

Anonymous users can post metrics

Parameters:payload (dict) –

(optional) dictionary structure containing: * metrics: a list containing dictionaries of the form:

** namespace: label indicating the source of the metric ** time: isoformat datetime when the metric was recorded ** level: an integer representing the metric’s log level ** args: a json string containing an array of extra data
Return type:dict
Returns:status object
debugging = None

set to true to send additional debugging info to the log

page_revisions Module

API for updating Galaxy Pages

class galaxy.webapps.galaxy.api.page_revisions.PageRevisionsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

create(self, trans, page_id, payload **kwd)[source]
  • POST /api/pages/{page_id}/revisions

    Create a new revision for a page

Parameters:
  • page_id – Add revision to Page with ID=page_id
  • payload – A dictionary containing:: ‘title’ = New title of the page ‘content’ = New content of the page
Return type:

dictionary

Returns:

Dictionary with ‘success’ or ‘error’ element to indicate the result of the request

index(self, trans, page_id, **kwd)[source]
  • GET /api/pages/{page_id}/revisions

    return a list of Page revisions

Parameters:page_id – Display the revisions of Page with ID=page_id
Return type:list
Returns:dictionaries containing different revisions of the page
pages Module

API for updating Galaxy Pages

class galaxy.webapps.galaxy.api.pages.PagesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

create(self, trans, payload, **kwd)[source]
  • POST /api/pages

    Create a page and return dictionary containing Page summary

Parameters:payload – dictionary structure containing:: ‘slug’ = The title slug for the page URL, must be unique ‘title’ = Title of the page ‘content’ = HTML contents of the page ‘annotation’ = Annotation that will be attached to the page
Return type:dict
Returns:Dictionary return of the Page.to_dict call
delete(self, trans, id, **kwd)[source]
  • DELETE /api/pages/{id}

    Create a page and return dictionary containing Page summary

Parameters:id – ID of page to be deleted
Return type:dict
Returns:Dictionary with ‘success’ or ‘error’ element to indicate the result of the request
index(self, trans, deleted=False, **kwd)[source]
  • GET /api/pages

    return a list of Pages viewable by the user

Parameters:deleted – Display deleted pages
Return type:list
Returns:dictionaries containing summary or detailed Page information
show(self, trans, id, **kwd)[source]
  • GET /api/pages/{id}

    View a page summary and the content of the latest revision

Parameters:id – ID of page to be displayed
Return type:dict
Returns:Dictionary return of the Page.to_dict call with the ‘content’ field populated by the most recent revision
provenance Module

API operations provenance

class galaxy.webapps.galaxy.api.provenance.BaseProvenanceController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.provenance.HDAProvenanceController(app)[source]

Bases: galaxy.webapps.galaxy.api.provenance.BaseProvenanceController

controller_name = 'history_content_provenance'
provenance_item_class = 'HistoryDatasetAssociation'
provenance_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.provenance.LDDAProvenanceController(app)[source]

Bases: galaxy.webapps.galaxy.api.provenance.BaseProvenanceController

controller_name = 'ldda_provenance'
provenance_item_class = 'LibraryDatasetDatasetAssociation'
provenance_item_id = 'library_content_id'
quotas Module

API operations on Quota objects.

class galaxy.webapps.galaxy.api.quotas.QuotaAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controllers.admin.Admin, galaxy.actions.admin.AdminActions, galaxy.web.base.controller.UsesQuotaMixin, galaxy.web.params.QuotaParamParser

create(trans, *args, **kwargs)[source]

POST /api/quotas Creates a new quota.

delete(trans, *args, **kwargs)[source]

DELETE /api/quotas/{encoded_quota_id} Deletes a quota

index(trans, *args, **kwargs)[source]

GET /api/quotas GET /api/quotas/deleted Displays a collection (list) of quotas.

show(trans, *args, **kwargs)[source]

GET /api/quotas/{encoded_quota_id} GET /api/quotas/deleted/{encoded_quota_id} Displays information about a quota.

undelete(trans, *args, **kwargs)[source]

POST /api/quotas/deleted/{encoded_quota_id}/undelete Undeletes a quota

update(trans, *args, **kwargs)[source]

PUT /api/quotas/{encoded_quota_id} Modifies a quota.

request_types Module

API operations on RequestType objects.

class galaxy.webapps.galaxy.api.request_types.RequestTypeAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/request_types Creates a new request type (external_service configuration).

index(trans, *args, **kwargs)[source]

GET /api/request_types Displays a collection (list) of request_types.

show(trans, *args, **kwargs)[source]

GET /api/request_types/{encoded_request_type_id} Displays information about a request_type.

requests Module

API operations on a sample tracking system.

class galaxy.webapps.galaxy.api.requests.RequestsAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/requests Displays a collection (list) of sequencing requests.

show(trans, *args, **kwargs)[source]

GET /api/requests/{encoded_request_id} Displays details of a sequencing request.

update(trans, *args, **kwargs)[source]

PUT /api/requests/{encoded_request_id} Updates a request state, sample state or sample dataset transfer status depending on the update_type

v = ('REQUEST', 'request_state')
roles Module

API operations on Role objects.

class galaxy.webapps.galaxy.api.roles.RoleAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

create(trans, *args, **kwargs)[source]

POST /api/roles Creates a new role.

index(trans, *args, **kwargs)[source]

GET /api/roles Displays a collection (list) of roles.

show(trans, *args, **kwargs)[source]

GET /api/roles/{encoded_role_id} Displays information about a role.

samples Module

API operations for samples in the Galaxy sample tracking system.

class galaxy.webapps.galaxy.api.samples.SamplesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/requests/{encoded_request_id}/samples Displays a collection (list) of sample of a sequencing request.

k = 'SAMPLE_DATASET'
update(trans, *args, **kwargs)[source]

PUT /api/samples/{encoded_sample_id} Updates a sample or objects related ( mapped ) to a sample.

update_type_values = ['sample_state', 'run_details', 'sample_dataset_transfer_status']
update_types = <galaxy.util.bunch.Bunch object>
v = ['sample_dataset_transfer_status']
search Module

API for searching Galaxy Datasets

class galaxy.webapps.galaxy.api.search.SearchController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin

create(trans, *args, **kwargs)[source]

POST /api/search Do a search of the various elements of Galaxy.

tool_data Module
class galaxy.webapps.galaxy.api.tool_data.ToolData(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool data

delete(trans, *args, **kwargs)[source]

DELETE /api/tool_data/{id} Removes an item from a data table

Parameters:
  • id (str) – the id of the data table containing the item to delete
  • kwd (dict) –

    (required) dictionary structure containing:

    • payload: a dictionary itself containing:
      • values: <TAB> separated list of column contents, there must be a value for all the columns of the data table
download_field_file(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]

GET /api/tool_data: returns a list tool_data tables:

reload(trans, *args, **kwargs)[source]

GET /api/tool_data/{id}/reload

Reloads a tool_data table.

show(trans, *args, **kwargs)[source]
show_field(trans, *args, **kwargs)[source]

GET /api/tool_data/<id>/fields/<value>

Get information about a partiular field in a tool_data table

tool_shed_repositories Module
class galaxy.webapps.galaxy.api.tool_shed_repositories.ToolShedRepositoriesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool shed repositories.

exported_workflows(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{encoded_tool_shed_repository_id}/exported_workflows

Display a list of dictionaries containing information about this tool shed repository’s exported workflows.

Parameters:id – the encoded id of the ToolShedRepository object
get_latest_installable_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/get_latest_installable_revision Get the latest installable revision of a specified repository from a specified Tool Shed.

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed from which to retrieve the Repository revision. :param name (required): the name of the Repository :param owner (required): the owner of the Repository

import_workflow(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/import_workflow

Import the specified exported workflow contained in the specified installed tool shed repository into Galaxy.

Parameters:
  • key – the API key of the Galaxy user with which the imported workflow will be associated.
  • id – the encoded id of the ToolShedRepository object

The following parameters are included in the payload. :param index: the index location of the workflow tuple in the list of exported workflows stored in the metadata for the specified repository

import_workflows(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/import_workflows

Import all of the exported workflows contained in the specified installed tool shed repository into Galaxy.

Parameters:
  • key – the API key of the Galaxy user with which the imported workflows will be associated.
  • id – the encoded id of the ToolShedRepository object
index(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories Display a list of dictionaries containing information about installed tool shed repositories.

install_repository_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install_repository_revision Install a specified repository revision from a specified tool shed into Galaxy.

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed from which to install the Repository :param name (required): the name of the Repository :param owner (required): the owner of the Repository :param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository :param new_tool_panel_section_label (optional): label of a new section to be added to the Galaxy tool panel in which to load

tools contained in the Repository. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string or both must be an empty string (both cannot be used simultaneously).
Parameters:
  • (optional) (shed_tool_conf) – id of the Galaxy tool panel section in which to load tools contained in the Repository. If this parameter is an empty string and the above new_tool_panel_section_label parameter is an empty string, tools will be loaded outside of any sections in the tool panel. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string of both must be an empty string (both cannot be used simultaneously).
  • (optional) – Set to True if you want to install repository dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – Set to True if you want to install tool dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – The shed-related tool panel configuration file configured in the “tool_config_file” setting in the Galaxy config file (e.g., galaxy.ini). At least one shed-related tool panel config file is required to be configured. Setting this parameter to a specific file enables you to choose where the specified repository will be installed because the tool_path attribute of the <toolbox> from the specified file is used as the installation location (e.g., <toolbox tool_path=”../shed_tools”>). If this parameter is not set, a shed-related tool panel configuration file will be selected automatically.
install_repository_revisions(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install_repository_revisions Install one or more specified repository revisions from one or more specified tool sheds into Galaxy. The received parameters must be ordered lists so that positional values in tool_shed_urls, names, owners and changeset_revisions are associated.

It’s questionable whether this method is needed as the above method for installing a single repository can probably cover all desired scenarios. We’ll keep this one around just in case...

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_urls: the base URLs of the Tool Sheds from which to install a specified Repository :param names: the names of the Repositories to be installed :param owners: the owners of the Repositories to be installed :param changeset_revisions: the changeset_revisions of each RepositoryMetadata object associated with each Repository to be installed :param new_tool_panel_section_label: optional label of a new section to be added to the Galaxy tool panel in which to load

tools contained in the Repository. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string, as both cannot be used.
Parameters:
  • tool_panel_section_id – optional id of the Galaxy tool panel section in which to load tools contained in the Repository. If not set, tools will be loaded outside of any sections in the tool panel. Either this parameter must be an empty string or the tool_panel_section_id parameter must be an empty string, as both cannot be used.
  • (optional) (shed_tool_conf) – Set to True if you want to install repository dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – Set to True if you want to install tool dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – The shed-related tool panel configuration file configured in the “tool_config_file” setting in the Galaxy config file (e.g., galaxy.ini). At least one shed-related tool panel config file is required to be configured. Setting this parameter to a specific file enables you to choose where the specified repository will be installed because the tool_path attribute of the <toolbox> from the specified file is used as the installation location (e.g., <toolbox tool_path=”../shed_tools”>). If this parameter is not set, a shed-related tool panel configuration file will be selected automatically.
repair_repository_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/repair_repository_revision Repair a specified repository revision previously installed into Galaxy.

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository was installed :param name (required): the name of the Repository :param owner (required): the owner of the Repository :param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository

reset_metadata_on_installed_repositories(trans, *args, **kwargs)[source]

PUT /api/tool_shed_repositories/reset_metadata_on_installed_repositories

Resets all metadata on all repositories installed into Galaxy in an “orderly fashion”.

Parameters:key – the API key of the Galaxy admin user.
show(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{encoded_tool_shed_repsository_id} Display a dictionary containing information about a specified tool_shed_repository.

Parameters:id – the encoded id of the ToolShedRepository object
galaxy.webapps.galaxy.api.tool_shed_repositories.get_message_for_no_shed_tool_config()[source]
tools Module
users Module

API operations on User objects.

class galaxy.webapps.galaxy.api.users.UserAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesTagsMixin, galaxy.web.base.controller.CreatesUsersMixin, galaxy.web.base.controller.CreatesApiKeysMixin

anon_user_api_value(trans)[source]

Returns data for an anonymous user, truncated to only usage and quota_percent

api_key(trans, *args, **kwargs)[source]

POST /api/users/{encoded_user_id}/api_key Creates a new API key for specified user.

create(trans, *args, **kwargs)[source]

POST /api/users Creates a new Galaxy user.

delete(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]

GET /api/users GET /api/users/deleted Displays a collection (list) of users.

show(trans, *args, **kwargs)[source]

GET /api/users/{encoded_user_id} GET /api/users/deleted/{encoded_user_id} GET /api/users/current Displays information about a user.

undelete(trans, *args, **kwargs)[source]
update(trans, *args, **kwargs)[source]
visualizations Module

Visualizations resource control over the API.

NOTE!: this is a work in progress and functionality and data structures may change often.

class galaxy.webapps.galaxy.api.visualizations.VisualizationsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin, galaxy.web.base.controller.SharableMixin, galaxy.model.item_attrs.UsesAnnotations

RESTful controller for interactions with visualizations.

create(trans, *args, **kwargs)[source]

POST /api/visualizations creates a new visualization using the given payload

POST /api/visualizations?import_id={encoded_visualization_id} imports a copy of an existing visualization into the user’s workspace

index(trans, *args, **kwargs)[source]

GET /api/visualizations:

show(trans, *args, **kwargs)[source]

GET /api/visualizations/{viz_id}

update(trans, *args, **kwargs)[source]

PUT /api/visualizations/{encoded_visualization_id}

workflows Module

API operations for Workflows

class galaxy.webapps.galaxy.api.workflows.WorkflowsAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

build_module(trans, *args, **kwargs)[source]

POST /api/workflows/build_module Builds module details including a tool model for the workflow editor.

cancel_invocation(trans, *args, **kwargs)[source]

DELETE /api/workflows/{workflow_id}/invocation/{invocation_id} Cancel the specified workflow invocation.

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the usage id (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

create(trans, *args, **kwargs)[source]

POST /api/workflows

Run or create workflows from the api.

If installed_repository_file or from_history_id is specified a new workflow will be created for this user. Otherwise, workflow_id must be specified and this API method will cause a workflow to execute.

:param installed_repository_file The path of a workflow to import. Either workflow_id, installed_repository_file or from_history_id must be specified :type installed_repository_file str

Parameters:
  • workflow_id (str) – An existing workflow id. Either workflow_id, installed_repository_file or from_history_id must be specified
  • parameters (dict) – If workflow_id is set - see _update_step_parameters()
  • ds_map (dict) – If workflow_id is set - a dictionary mapping each input step id to a dictionary with 2 keys: ‘src’ (which can be ‘ldda’, ‘ld’ or ‘hda’) and ‘id’ (which should be the id of a LibraryDatasetDatasetAssociation, LibraryDataset or HistoryDatasetAssociation respectively)
  • no_add_to_history (str) – If workflow_id is set - if present in the payload with any value, the input datasets will not be added to the selected history
  • history (str) – If workflow_id is set - optional history where to run the workflow, either the name of a new history or “hist_id=HIST_ID” where HIST_ID is the id of an existing history. If not specified, the workflow will be run a new unnamed history
  • replacement_params (dict) – If workflow_id is set - an optional dictionary used when renaming datasets
  • from_history_id (str) – Id of history to extract a workflow from. Either workflow_id, installed_repository_file or from_history_id must be specified
  • job_ids (str) – If from_history_id is set - optional list of jobs to include when extracting a workflow from history
  • dataset_ids (str) – If from_history_id is set - optional list of HDA `hid`s corresponding to workflow inputs when extracting a workflow from history
  • dataset_collection_ids (str) – If from_history_id is set - optional list of HDCA `hid`s corresponding to workflow inputs when extracting a workflow from history
  • workflow_name (str) – If from_history_id is set - name of the workflow to create when extracting a workflow from history
delete(trans, *args, **kwargs)[source]

DELETE /api/workflows/{encoded_workflow_id} Deletes a specified workflow Author: rpark

copied from galaxy.web.controllers.workflows.py (delete)

import_new_workflow_deprecated(trans, *args, **kwargs)[source]

POST /api/workflows/upload Importing dynamic workflows from the api. Return newly generated workflow id. Author: rpark

# currently assumes payload[‘workflow’] is a json representation of a workflow to be inserted into the database

Deprecated in favor to POST /api/workflows with encoded ‘workflow’ in payload the same way.

import_shared_workflow_deprecated(trans, *args, **kwargs)[source]

POST /api/workflows/import Import a workflow shared by other users.

Parameters:workflow_id (str) – the workflow id (required)
Raises:exceptions.MessageException, exceptions.ObjectNotFound
index(trans, *args, **kwargs)[source]

GET /api/workflows

Displays a collection of workflows.

Parameters:show_published (boolean) – if True, show also published workflows
index_invocations(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocations

Get the list of the workflow invocations

Parameters:workflow_id (str) – the workflow id (required)
Raises:exceptions.MessageException, exceptions.ObjectNotFound
invocation_step(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id}

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the invocation id (required)
  • step_id (str) – encoded id of the WorkflowInvocationStep (required)
  • payload – payload containing update action information for running workflow.
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

invoke(trans, *args, **kwargs)[source]

POST /api/workflows/{encoded_workflow_id}/invocations

Schedule the workflow specified by workflow_id to run.

show(trans, *args, **kwargs)[source]

GET /api/workflows/{encoded_workflow_id}

Displays information needed to run a workflow from the command line.

show_invocation(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocation/{invocation_id} Get detailed description of workflow invocation

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the invocation id (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

update(trans, *args, **kwargs)[source]
  • PUT /api/workflows/{id}

    updates the workflow stored with id

Parameters:
  • id (str) – the encoded id of the workflow to update
  • payload (dict) –

    a dictionary containing any or all the * workflow the json description of the workflow as would be

    produced by GET workflows/<id>/download or given to POST workflows

    The workflow contents will be updated to target this.

Return type:

dict

Returns:

serialized version of the workflow

update_invocation_step(trans, *args, **kwargs)[source]

PUT /api/workflows/{workflow_id}/invocation/{invocation_id}/steps/{step_id} Update state of running workflow step invocation - still very nebulous but this would be for stuff like confirming paused steps can proceed etc....

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the usage id (required)
  • step_id (str) – encoded id of the WorkflowInvocationStep (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

workflow_dict(trans, *args, **kwargs)[source]

GET /api/workflows/{encoded_workflow_id}/download Returns a selected workflow as a json dictionary.

controllers Package
controllers Package

Galaxy web controllers.

admin Module
class galaxy.webapps.galaxy.controllers.admin.AdminGalaxy(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controllers.admin.Admin, galaxy.actions.admin.AdminActions, galaxy.web.base.controller.UsesQuotaMixin, galaxy.web.params.QuotaParamParser

check_for_tool_dependencies(trans, migration_stage)[source]
create_quota(trans, *args, **kwargs)[source]
delete_operation = <galaxy.web.framework.helpers.grids.GridOperation object>
display_applications(trans, *args, **kwargs)[source]
edit_quota(trans, *args, **kwargs)[source]
group_list_grid = <galaxy.webapps.galaxy.controllers.admin.GroupListGrid object>
impersonate(trans, *args, **kwargs)[source]
manage_users_and_groups_for_quota(trans, *args, **kwargs)[source]
mark_quota_deleted(trans, *args, **kwargs)[source]
purge_operation = <galaxy.web.framework.helpers.grids.GridOperation object>
purge_quota(trans, *args, **kwargs)[source]
quota_list_grid = <galaxy.webapps.galaxy.controllers.admin.QuotaListGrid object>
quotas(trans, *args, **kwargs)[source]
recalculate_user_disk_usage(trans, *args, **kwargs)[source]
reload_display_application(trans, *args, **kwargs)[source]
rename_quota(trans, *args, **kwargs)[source]
review_tool_migration_stages(trans, *args, **kwargs)[source]
role_list_grid = <galaxy.webapps.galaxy.controllers.admin.RoleListGrid object>
set_quota_default(trans, *args, **kwargs)[source]
tool_version_list_grid = <galaxy.webapps.galaxy.controllers.admin.ToolVersionListGrid object>
undelete_operation = <galaxy.web.framework.helpers.grids.GridOperation object>
undelete_quota(trans, *args, **kwargs)[source]
unset_quota_default(trans, *args, **kwargs)[source]
user_list_grid = <galaxy.webapps.galaxy.controllers.admin.UserListGrid object>
view_datatypes_registry(trans, *args, **kwargs)[source]
view_tool_data_tables(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.controllers.admin.GroupListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, group)[source]
class GroupListGrid.RolesColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, group)[source]
class GroupListGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, group)[source]
class GroupListGrid.UsersColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, group)[source]
GroupListGrid.columns = [<galaxy.webapps.galaxy.controllers.admin.NameColumn object at 0x7f2aa6d27d90>, <galaxy.webapps.galaxy.controllers.admin.UsersColumn object at 0x7f2aa6d272d0>, <galaxy.webapps.galaxy.controllers.admin.RolesColumn object at 0x7f2aa6d27ed0>, <galaxy.webapps.galaxy.controllers.admin.StatusColumn object at 0x7f2aa6d27390>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aa6d27790>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aa6d27250>]
GroupListGrid.default_sort_key = 'name'
GroupListGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aa6d279d0>]
GroupListGrid.model_class

alias of Group

GroupListGrid.num_rows_per_page = 50
GroupListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27650>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27b90>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27110>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27710>]
GroupListGrid.preserve_state = False
GroupListGrid.standard_filters = [<galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27450>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27c90>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d273d0>]
GroupListGrid.template = '/admin/dataset_security/group/grid.mako'
GroupListGrid.title = 'Groups'
GroupListGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.admin.QuotaListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class AmountColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, quota)[source]
class QuotaListGrid.DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, quota)[source]
class QuotaListGrid.GroupsColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, quota)[source]
class QuotaListGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, quota)[source]
class QuotaListGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, quota)[source]
class QuotaListGrid.UsersColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, quota)[source]
QuotaListGrid.columns = [<galaxy.webapps.galaxy.controllers.admin.NameColumn object at 0x7f2aa6d276d0>, <galaxy.webapps.galaxy.controllers.admin.DescriptionColumn object at 0x7f2aa6d27690>, <galaxy.webapps.galaxy.controllers.admin.AmountColumn object at 0x7f2aa6d27e90>, <galaxy.webapps.galaxy.controllers.admin.UsersColumn object at 0x7f2aa6d27290>, <galaxy.webapps.galaxy.controllers.admin.GroupsColumn object at 0x7f2aa6d27410>, <galaxy.webapps.galaxy.controllers.admin.StatusColumn object at 0x7f2aa6d27890>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aa6d27d50>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aa6d27150>]
QuotaListGrid.default_sort_key = 'name'
QuotaListGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aa6d27550>]
QuotaListGrid.model_class

alias of Quota

QuotaListGrid.num_rows_per_page = 50
QuotaListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27e50>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d275d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27090>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa43e64d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa43e6810>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa43e6490>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa43e6750>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa43e6510>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa43e6710>]
QuotaListGrid.preserve_state = False
QuotaListGrid.standard_filters = [<galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa43e6410>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa43e6210>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa43e6550>]
QuotaListGrid.template = '/admin/quota/grid.mako'
QuotaListGrid.title = 'Quotas'
QuotaListGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.admin.RoleListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, role)[source]
class RoleListGrid.GroupsColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, role)[source]
class RoleListGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, role)[source]
class RoleListGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, role)[source]
class RoleListGrid.TypeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, role)[source]
class RoleListGrid.UsersColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, role)[source]
RoleListGrid.apply_query_filter(trans, query, **kwargs)[source]
RoleListGrid.columns = [<galaxy.webapps.galaxy.controllers.admin.NameColumn object at 0x7f2aa6d27f10>, <galaxy.webapps.galaxy.controllers.admin.DescriptionColumn object at 0x7f2a9ece7e90>, <galaxy.webapps.galaxy.controllers.admin.TypeColumn object at 0x7f2a9fba2490>, <galaxy.webapps.galaxy.controllers.admin.GroupsColumn object at 0x7f2aa6d27dd0>, <galaxy.webapps.galaxy.controllers.admin.UsersColumn object at 0x7f2aa6d27990>, <galaxy.webapps.galaxy.controllers.admin.StatusColumn object at 0x7f2aa6d27e10>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aa6d27c50>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aa6d27bd0>]
RoleListGrid.default_sort_key = 'name'
RoleListGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aa6d27910>]
RoleListGrid.model_class

alias of Role

RoleListGrid.num_rows_per_page = 50
RoleListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27750>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27510>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d27810>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aa6d271d0>]
RoleListGrid.preserve_state = False
RoleListGrid.standard_filters = [<galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27610>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27fd0>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27a10>]
RoleListGrid.template = '/admin/dataset_security/role/grid.mako'
RoleListGrid.title = 'Roles'
RoleListGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.admin.ToolVersionListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class ToolIdColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, tool_version)[source]
class ToolVersionListGrid.ToolVersionsColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, tool_version)[source]
ToolVersionListGrid.build_initial_query(trans, **kwd)[source]
ToolVersionListGrid.columns = [<galaxy.webapps.galaxy.controllers.admin.ToolIdColumn object at 0x7f2aa43e6190>, <galaxy.webapps.galaxy.controllers.admin.ToolVersionsColumn object at 0x7f2aa43e60d0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aa43e62d0>]
ToolVersionListGrid.default_filter = {}
ToolVersionListGrid.default_sort_key = 'tool_id'
ToolVersionListGrid.global_actions = []
ToolVersionListGrid.model_class

alias of ToolVersion

ToolVersionListGrid.num_rows_per_page = 50
ToolVersionListGrid.operations = []
ToolVersionListGrid.preserve_state = False
ToolVersionListGrid.standard_filters = []
ToolVersionListGrid.template = '/admin/tool_version/grid.mako'
ToolVersionListGrid.title = 'Tool versions'
ToolVersionListGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.admin.UserListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class ActivatedColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.EmailColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, user)[source]
class UserListGrid.ExternalColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.GroupsColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.LastLoginColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.RolesColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.TimeCreatedColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, user)[source]
class UserListGrid.UserNameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, user)[source]
UserListGrid.columns = [<galaxy.webapps.galaxy.controllers.admin.EmailColumn object at 0x7f2aabed4690>, <galaxy.webapps.galaxy.controllers.admin.UserNameColumn object at 0x7f2aabed4550>, <galaxy.webapps.galaxy.controllers.admin.GroupsColumn object at 0x7f2aabed4c90>, <galaxy.webapps.galaxy.controllers.admin.RolesColumn object at 0x7f2aabed4810>, <galaxy.webapps.galaxy.controllers.admin.ExternalColumn object at 0x7f2aabed4790>, <galaxy.webapps.galaxy.controllers.admin.LastLoginColumn object at 0x7f2aabc63d10>, <galaxy.webapps.galaxy.controllers.admin.StatusColumn object at 0x7f2aabed4b90>, <galaxy.webapps.galaxy.controllers.admin.TimeCreatedColumn object at 0x7f2aabed4710>, <galaxy.webapps.galaxy.controllers.admin.ActivatedColumn object at 0x7f2aabed4510>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aabed4e50>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aabed4190>]
UserListGrid.default_sort_key = 'email'
UserListGrid.get_current_item(trans, **kwargs)[source]
UserListGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aabed4f90>]
UserListGrid.model_class

alias of User

UserListGrid.num_rows_per_page = 50
UserListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aabed4610>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aabed4910>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aabed4390>]
UserListGrid.preserve_state = False
UserListGrid.standard_filters = [<galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa928e9d0>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa928e050>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27310>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2aa6d27cd0>]
UserListGrid.template = '/admin/user/grid.mako'
UserListGrid.title = 'Users'
UserListGrid.use_paging = True
admin_toolshed Module
class galaxy.webapps.galaxy.controllers.admin_toolshed.AdminToolshed(app)[source]

Bases: galaxy.webapps.galaxy.controllers.admin.AdminGalaxy

activate_repository(trans, *args, **kwargs)[source]

Activate a repository that was deactivated but not uninstalled.

browse_repositories(trans, *args, **kwargs)[source]
browse_repository(trans, *args, **kwargs)[source]
browse_tool_dependency(trans, *args, **kwargs)[source]
browse_tool_shed(trans, *args, **kwargs)[source]
browse_tool_sheds(trans, *args, **kwargs)[source]
check_for_updates(trans, *args, **kwargs)[source]

Send a request to the relevant tool shed to see if there are any updates.

deactivate_or_uninstall_repository(trans, *args, **kwargs)[source]

Handle all changes when a tool shed repository is being deactivated or uninstalled. Notice that if the repository contents include a file named tool_data_table_conf.xml.sample, its entries are not removed from the defined config.shed_tool_data_table_config. This is because it becomes a bit complex to determine if other installed repositories include tools that require the same entry. For now we’ll never delete entries from config.shed_tool_data_table_config, but we may choose to do so in the future if it becomes necessary.

display_image_in_repository(trans, **kwd)[source]

Open an image file that is contained in an installed tool shed repository or that is referenced by a URL for display. The image can be defined in either a README.rst file contained in the repository or the help section of a Galaxy tool config that is contained in the repository. The following image definitions are all supported. The former $PATH_TO_IMAGES is no longer required, and is now ignored. .. image:: https://raw.github.com/galaxy/some_image.png .. image:: $PATH_TO_IMAGES/some_image.png .. image:: /static/images/some_image.gif .. image:: some_image.jpg .. image:: /deep/some_image.png

find_tools_in_tool_shed(trans, *args, **kwargs)[source]
find_workflows_in_tool_shed(trans, *args, **kwargs)[source]
generate_workflow_image(trans, *args, **kwargs)[source]

Return an svg image representation of a workflow dictionary created when the workflow was exported.

get_file_contents(trans, *args, **kwargs)[source]
get_tool_dependencies(trans, *args, **kwargs)[source]

Send a request to the appropriate tool shed to retrieve the dictionary of tool dependencies defined for the received repository name, owner and changeset revision. The received repository_id is the encoded id of the installed tool shed repository in Galaxy. We need it so that we can derive the tool shed from which it was installed.

get_updated_repository_information(trans, *args, **kwargs)[source]

Send a request to the appropriate tool shed to retrieve the dictionary of information required to reinstall an updated revision of an uninstalled tool shed repository.

import_workflow(trans, *args, **kwargs)[source]

Import a workflow contained in an installed tool shed repository into Galaxy.

initiate_tool_dependency_installation(trans, *args, **kwargs)[source]

Install specified dependencies for repository tools. The received list of tool_dependencies are the database records for those dependencies defined in the tool_dependencies.xml file (contained in the repository) that should be installed. This allows for filtering out dependencies that have not been checked for installation on the ‘Manage tool dependencies’ page for an installed tool shed repository.

install_latest_repository_revision(trans, *args, **kwargs)[source]

Install the latest installable revision of a repository that has been previously installed.

install_tool_dependencies_with_update(trans, *args, **kwargs)[source]

Updating an installed tool shed repository where new tool dependencies but no new repository dependencies are included in the updated revision.

installed_repository_grid = <tool_shed.galaxy_install.grids.admin_toolshed_grids.InstalledRepositoryGrid object>
manage_repositories(trans, *args, **kwargs)[source]
manage_repository(trans, *args, **kwargs)[source]
manage_repository_tool_dependencies(trans, *args, **kwargs)[source]
manage_tool_dependencies(trans, *args, **kwargs)[source]
monitor_repository_installation(trans, *args, **kwargs)[source]
open_folder(trans, *args, **kwargs)[source]
prepare_for_install(trans, *args, **kwargs)[source]
purge_repository(trans, *args, **kwargs)[source]

Purge a “white ghost” repository from the database.

reinstall_repository(trans, *args, **kwargs)[source]

Reinstall a tool shed repository that has been previously uninstalled, making sure to handle all repository and tool dependencies of the repository.

repair_repository(trans, *args, **kwargs)[source]

Inspect the repository dependency hierarchy for a specified repository and attempt to make sure they are all properly installed as well as each repository’s tool dependencies.

repair_tool_shed_repositories(trans, *args, **kwargs)[source]

Repair specified tool shed repositories.

repository_installation_grid = <tool_shed.galaxy_install.grids.admin_toolshed_grids.RepositoryInstallationGrid object>
repository_installation_status_updates(trans, *args, **kwargs)[source]
reselect_tool_panel_section(trans, *args, **kwargs)[source]

Select or change the tool panel section to contain the tools included in the tool shed repository being reinstalled. If there are updates available for the repository in the tool shed, the tool_dependencies and repository_dependencies associated with the updated changeset revision will have been retrieved from the tool shed and passed in the received kwd. In this case, the stored tool shed repository metadata from the Galaxy database will not be used since it is outdated.

reset_metadata_on_selected_installed_repositories(trans, *args, **kwargs)[source]
reset_repository_metadata(trans, *args, **kwargs)[source]

Reset all metadata on a single installed tool shed repository.

reset_to_install(trans, *args, **kwargs)[source]

An error occurred while cloning the repository, so reset everything necessary to enable another attempt.

set_tool_versions(trans, *args, **kwargs)[source]

Get the tool_versions from the tool shed for each tool in the installed revision of a selected tool shed repository and update the metadata for the repository’s revision in the Galaxy database.

tool_dependency_grid = <tool_shed.galaxy_install.grids.admin_toolshed_grids.ToolDependencyGrid object>
tool_dependency_status_updates(trans, *args, **kwargs)[source]
uninstall_tool_dependencies(trans, *args, **kwargs)[source]
update_to_changeset_revision(trans, *args, **kwargs)[source]

Update a cloned repository to the latest revision possible.

update_tool_shed_status_for_installed_repository(trans, *args, **kwargs)[source]
view_tool_metadata(trans, *args, **kwargs)[source]
view_workflow(trans, *args, **kwargs)[source]

Retrieve necessary information about a workflow from the database so that it can be displayed in an svg image.

async Module

Upload class

class galaxy.webapps.galaxy.controllers.async.ASync(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

default(trans, tool_id=None, data_id=None, data_secret=None, **kwd)[source]

Catches the tool id and redirects as needed

index(trans, tool_id=None, data_secret=None, **kwd)[source]

Manages ascynchronous connections

cloudlaunch Module
data_admin Module
dataset Module
class galaxy.webapps.galaxy.controllers.dataset.DatasetInterface(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.model.item_attrs.UsesAnnotations, galaxy.model.item_attrs.UsesItemRatings, galaxy.web.base.controller.UsesExtendedMetadataMixin

annotate_async(trans, id, new_annotation=None, **kwargs)[source]
copy_datasets(trans, source_history=None, source_content_ids='', target_history_id=None, target_history_ids='', new_history_name='', do_copy=False, **kwd)[source]
default(trans, dataset_id=None, **kwd)[source]
delete(trans, dataset_id, filename, show_deleted_on_refresh=False)[source]
delete_async(trans, dataset_id, filename)[source]
display(trans, dataset_id=None, preview=False, filename=None, to_ext=None, chunk=None, **kwd)[source]
display_application(trans, dataset_id=None, user_id=None, app_name=None, link_name=None, app_action=None, action_param=None, **kwds)[source]

Access to external display applications

display_at(trans, dataset_id, filename=None, **kwd)[source]

Sets up a dataset permissions so it is viewable at an external site

display_by_username_and_slug(trans, username, slug, filename=None, preview=True)[source]

Display dataset by username and slug; because datasets do not yet have slugs, the slug is the dataset’s id.

edit(trans, dataset_id=None, filename=None, hid=None, **kwd)[source]

Allows user to modify parameters of an HDA.

errors(trans, id)[source]
exit_code(trans, dataset_id=None, **kwargs)[source]
get_annotation_async(trans, id)[source]
get_embed_html_async(trans, id)[source]

Returns HTML for embedding a dataset in a page.

get_item_content_async(trans, id)[source]

Returns item content in HTML format.

get_metadata_file(trans, hda_id, metadata_name)[source]

Allows the downloading of metadata files associated with datasets (eg. bai index for bam files)

Returns dataset’s name and link.

imp(trans, dataset_id=None, **kwd)[source]

Import another user’s dataset via a shared URL; dataset is added to user’s current history.

list(trans, *args, **kwargs)[source]

List all available datasets

purge(trans, dataset_id, filename, show_deleted_on_refresh=False)[source]
purge_async(trans, dataset_id, filename)[source]
rate_async(trans, *args, **kwargs)[source]

Rate a dataset asynchronously and return updated community data.

report_error(trans, id, email='', message='', **kwd)[source]
set_accessible_async(trans, *args, **kwargs)[source]

Does nothing because datasets do not have an importable/accessible attribute. This method could potentially set another attribute.

show_params(trans, dataset_id=None, from_noframe=None, **kwd)[source]

Show the parameters used for the job associated with an HDA

stderr(trans, dataset_id=None, **kwargs)[source]
stdout(trans, dataset_id=None, **kwargs)[source]
stored_list_grid = <galaxy.webapps.galaxy.controllers.dataset.HistoryDatasetAssociationListGrid object>
transfer_status(trans, *args, **kwargs)[source]

Primarily used for the S3ObjectStore - get the status of data transfer if the file is not in cache

undelete(trans, dataset_id, filename)[source]
undelete_async(trans, dataset_id, filename)[source]
unhide(trans, dataset_id, filename)[source]
class galaxy.webapps.galaxy.controllers.dataset.HistoryDatasetAssociationListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class HistoryColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, hda)[source]
class HistoryDatasetAssociationListGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_accepted_filters()[source]

Returns a list of accepted filters for this column.

get_value(trans, grid, hda)[source]
HistoryDatasetAssociationListGrid.build_initial_query(trans, **kwargs)[source]
HistoryDatasetAssociationListGrid.columns = [<galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2a9dfa17d0>, <galaxy.webapps.galaxy.controllers.dataset.HistoryColumn object at 0x7f2a9dd4ad10>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9dd4ac90>, <galaxy.webapps.galaxy.controllers.dataset.StatusColumn object at 0x7f2a9dd4ad50>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9dd4ad90>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9dd4add0>]
HistoryDatasetAssociationListGrid.default_filter = {'deleted': 'False', 'name': 'All', 'tags': 'All'}
HistoryDatasetAssociationListGrid.default_sort_key = '-update_time'
HistoryDatasetAssociationListGrid.model_class

alias of HistoryDatasetAssociation

HistoryDatasetAssociationListGrid.num_rows_per_page = 50
HistoryDatasetAssociationListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9dd4ae10>]
HistoryDatasetAssociationListGrid.preserve_state = False
HistoryDatasetAssociationListGrid.standard_filters = []
HistoryDatasetAssociationListGrid.template = '/dataset/grid.mako'
HistoryDatasetAssociationListGrid.title = 'Saved Datasets'
HistoryDatasetAssociationListGrid.use_async = True
HistoryDatasetAssociationListGrid.use_paging = True
error Module
class galaxy.webapps.galaxy.controllers.error.Error(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

index(trans)[source]
external_service Module
class galaxy.webapps.galaxy.controllers.external_service.ExternalService(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin

browse_external_services(trans, *args, **kwargs)[source]
create_external_service(trans, *args, **kwargs)[source]
delete_external_service(trans, *args, **kwargs)[source]
edit_external_service(trans, *args, **kwargs)[source]
edit_external_service_form_definition(trans, *args, **kwargs)[source]
external_service_grid = <galaxy.webapps.galaxy.controllers.external_service.ExternalServiceGrid object>
get_external_service_type(trans, external_service_type_id, action='browse_external_services')[source]
reload_external_service_types(trans, *args, **kwargs)[source]
undelete_external_service(trans, *args, **kwargs)[source]
update_external_service_form_definition(trans, *args, **kwargs)[source]
view_external_service(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.controllers.external_service.ExternalServiceGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class ExternalServiceTypeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, external_service)[source]
class ExternalServiceGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, external_service)[source]
ExternalServiceGrid.columns = [<galaxy.webapps.galaxy.controllers.external_service.NameColumn object at 0x7f2aab9e8f10>, <galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2aac01e750>, <galaxy.webapps.galaxy.controllers.external_service.ExternalServiceTypeColumn object at 0x7f2aac01e290>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aac01e350>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aac01ee90>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aac01e110>]
ExternalServiceGrid.default_filter = {'deleted': 'False'}
ExternalServiceGrid.default_sort_key = '-create_time'
ExternalServiceGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aac01e550>, <galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aac01e810>]
ExternalServiceGrid.model_class

alias of ExternalService

ExternalServiceGrid.num_rows_per_page = 50
ExternalServiceGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aac01e7d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aac01e310>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aac01e590>]
ExternalServiceGrid.preserve_state = True
ExternalServiceGrid.template = 'admin/external_service/grid.mako'
ExternalServiceGrid.title = 'External Services'
ExternalServiceGrid.use_paging = True
external_services Module
class galaxy.webapps.galaxy.controllers.external_services.ExternalServiceController(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

access_action(trans, *args, **kwargs)[source]
forms Module
class galaxy.webapps.galaxy.controllers.forms.Forms(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

browse_form_definitions(trans, *args, **kwargs)[source]
build_form_definition_field_widgets(trans, layout_grids, field_index, field, form_type)[source]

This method returns a list of widgets which describes a form definition field. This includes the field label, helptext, type, selectfield options, required/optional & layout

create_form_definition(trans, *args, **kwargs)[source]
delete_form_definition(trans, *args, **kwargs)[source]
edit_form_definition(trans, *args, **kwargs)[source]

This callback method is for handling form editing. The value of response_redirect should be an URL that is defined by the caller. This allows for redirecting as desired when the form changes have been saved. For an example of how this works, see the edit_template() method in the base controller.

empty_field = {'visible': True, 'helptext': '', 'name': '', 'default': '', 'layout': 'none', 'selectlist': [], 'required': False, 'type': 'TextField', 'label': ''}
forms_grid = <galaxy.webapps.galaxy.controllers.forms.FormsGrid object>
get_current_form(trans, **kwd)[source]

This method gets all the unsaved user-entered form details and returns a dictionary containing the name, desc, type, layout & fields of the form

get_saved_form(form_definition)[source]

This retrieves the saved form and returns a dictionary containing the name, desc, type, layout & fields of the form

save_form_definition(trans, form_definition_current_id=None, **kwd)[source]

This method saves the current form

show_editable_form_definition(trans, form_definition, current_form, message='', status='done', response_redirect=None, **kwd)[source]

Displays the form and any of the changes made to it in edit mode. In this method all the widgets are build for all name, description and all the fields of a form definition.

undelete_form_definition(trans, *args, **kwargs)[source]
view_latest_form_definition(trans, *args, **kwargs)[source]

Displays the layout of the latest version of the form definition

class galaxy.webapps.galaxy.controllers.forms.FormsGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, form)[source]
class FormsGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, form)[source]
class FormsGrid.TypeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, form)[source]
FormsGrid.build_initial_query(trans, **kwargs)[source]
FormsGrid.columns = [<galaxy.webapps.galaxy.controllers.forms.NameColumn object at 0x7f2a9e2a7bd0>, <galaxy.webapps.galaxy.controllers.forms.DescriptionColumn object at 0x7f2a9e2a7b90>, <galaxy.webapps.galaxy.controllers.forms.TypeColumn object at 0x7f2a9e2a7890>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9e2a7690>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9e2a7dd0>]
FormsGrid.default_filter = {'deleted': 'False'}
FormsGrid.default_sort_key = '-create_time'
FormsGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2a9e40f150>]
FormsGrid.model_class

alias of FormDefinitionCurrent

FormsGrid.num_rows_per_page = 50
FormsGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9e2a78d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9e2a7790>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9e40f110>]
FormsGrid.preserve_state = True
FormsGrid.template = 'admin/forms/grid.mako'
FormsGrid.title = 'Forms'
FormsGrid.use_paging = True
history Module
class galaxy.webapps.galaxy.controllers.history.HistoryAllPublishedGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class NameURLColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.PublicURLColumn, galaxy.webapps.galaxy.controllers.history.NameColumn

HistoryAllPublishedGrid.apply_query_filter(trans, query, **kwargs)[source]
HistoryAllPublishedGrid.build_initial_query(trans, **kwargs)[source]
HistoryAllPublishedGrid.columns = [<galaxy.webapps.galaxy.controllers.history.NameURLColumn object at 0x7f2a9d33a4d0>, <galaxy.web.framework.helpers.grids.OwnerAnnotationColumn object at 0x7f2a9d281610>, <galaxy.web.framework.helpers.grids.OwnerColumn object at 0x7f2a9d281690>, <galaxy.web.framework.helpers.grids.CommunityRatingColumn object at 0x7f2a9d2816d0>, <galaxy.web.framework.helpers.grids.CommunityTagsColumn object at 0x7f2a9d281710>, <galaxy.web.framework.helpers.grids.ReverseSortColumn object at 0x7f2a9d281750>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9d33a250>]
HistoryAllPublishedGrid.default_filter = {'username': 'All', 'public_url': 'All', 'tags': 'All'}
HistoryAllPublishedGrid.default_sort_key = 'update_time'
HistoryAllPublishedGrid.model_class

alias of History

HistoryAllPublishedGrid.num_rows_per_page = 50
HistoryAllPublishedGrid.operations = []
HistoryAllPublishedGrid.title = 'Published Histories'
HistoryAllPublishedGrid.use_async = True
HistoryAllPublishedGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.history.HistoryController(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.SharableMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.model.item_attrs.UsesItemRatings, galaxy.web.base.controller.ExportsHistoryMixin, galaxy.web.base.controller.ImportsHistoryMixin

citations(trans)[source]
copy(trans, *args, **kwargs)[source]

Copy one or more histories

create_new_current(trans, *args, **kwargs)[source]
current_history_json(trans, *args, **kwargs)[source]
delete_current(trans, purge=False)[source]

Delete just the active history – this does not require a logged in user.

delete_hidden_datasets(trans)[source]

This method deletes all hidden datasets in the current history.

display_by_username_and_slug(trans, username, slug)[source]

Display history based on a username and slug.

display_structured(trans, id=None)[source]

Display a history as a nested structure showing the jobs and workflow invocations that created each dataset (if any).

export_archive(trans, id=None, gzip=True, include_hidden=False, include_deleted=False, preview=False)[source]

Export a history to an archive.

get_item(trans, id)[source]

Returns history’s name and link.

history_data(trans, history)[source]
imp(trans, id=None, confirm=False, **kwd)[source]

Import another user’s history via a shared URL

import_archive(trans, *args, **kwargs)[source]

Import a history from a file archive.

index(trans)[source]
list(trans, *args, **kwargs)[source]

List all available histories

list_as_xml(trans)[source]

XML history list for functional tests

list_published(trans, **kwargs)[source]
list_shared(trans, *args, **kwargs)[source]

List histories shared with current user by others

name_autocomplete_data(trans, q=None, limit=None, timestamp=None)[source]

Return autocomplete data for history names

published_list_grid = <galaxy.webapps.galaxy.controllers.history.HistoryAllPublishedGrid object>
purge_deleted_datasets(trans)[source]
rate_async(trans, *args, **kwargs)[source]

Rate a history asynchronously and return updated community data.

rename(trans, *args, **kwargs)[source]
resume_paused_jobs(trans, current=False, ids=None)[source]

Resume paused jobs the active history – this does not require a logged in user.

set_accessible_async(trans, *args, **kwargs)[source]

Set history’s importable attribute and slug.

set_as_current(trans, *args, **kwargs)[source]
share(trans, *args, **kwargs)[source]
share_restricted(trans, *args, **kwargs)[source]
shared_list_grid = <galaxy.webapps.galaxy.controllers.history.SharedHistoryListGrid object>
sharing(trans, *args, **kwargs)[source]

Handle history sharing.

stored_list_grid = <galaxy.webapps.galaxy.controllers.history.HistoryListGrid object>
structure(trans, id=None, **kwargs)[source]
switch_to_history(trans, *args, **kwargs)[source]
unhide_datasets(trans, current=False, ids=None)[source]

Unhide the datasets in the active history – this does not require a logged in user.

view(trans, id=None, show_deleted=False, show_hidden=False, use_panels=True)[source]

View a history. If a history is importable, then it is viewable by any user.

view_multiple(trans, include_deleted_histories=False, order='update')[source]
class galaxy.webapps.galaxy.controllers.history.HistoryListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DatasetsByStateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, history)[source]
class HistoryListGrid.DeletedColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.DeletedColumn

get_value(trans, grid, history)[source]
sort(trans, query, ascending, column_name=None)[source]
class HistoryListGrid.HistoryListNameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.webapps.galaxy.controllers.history.NameColumn

HistoryListGrid.apply_query_filter(trans, query, **kwargs)[source]
HistoryListGrid.columns = [<galaxy.webapps.galaxy.controllers.history.HistoryListNameColumn object at 0x7f2a9d33a150>, <galaxy.webapps.galaxy.controllers.history.DatasetsByStateColumn object at 0x7f2a9d33a390>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9d33a350>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9d275fd0>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d326dd0>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d281050>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d281090>, <galaxy.webapps.galaxy.controllers.history.DeletedColumn object at 0x7f2a9d2810d0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9d33a3d0>]
HistoryListGrid.default_filter = {'deleted': 'False', 'sharing': 'All', 'name': 'All', 'tags': 'All'}
HistoryListGrid.default_sort_key = '-update_time'
HistoryListGrid.get_current_item(trans, **kwargs)[source]
HistoryListGrid.info_text = 'Histories that have been deleted for more than a time period specified by the Galaxy administrator(s) may be permanently deleted.'
HistoryListGrid.model_class

alias of History

HistoryListGrid.num_rows_per_page = 50
HistoryListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281110>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281150>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281190>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d2811d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281210>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281250>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281290>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d2812d0>]
HistoryListGrid.preserve_state = False
HistoryListGrid.standard_filters = [<galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d281310>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d281350>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d281390>]
HistoryListGrid.template = '/history/grid.mako'
HistoryListGrid.title = 'Saved Histories'
HistoryListGrid.use_async = True
HistoryListGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.history.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, history)[source]
class galaxy.webapps.galaxy.controllers.history.SharedHistoryListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DatasetsByStateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, history)[source]
class SharedHistoryListGrid.SharedByColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, history)[source]
SharedHistoryListGrid.apply_query_filter(trans, query, **kwargs)[source]
SharedHistoryListGrid.build_initial_query(trans, **kwargs)[source]
SharedHistoryListGrid.columns = [<galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d281410>, <galaxy.webapps.galaxy.controllers.history.DatasetsByStateColumn object at 0x7f2a9d281450>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d281490>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d2814d0>, <galaxy.webapps.galaxy.controllers.history.SharedByColumn object at 0x7f2a9d281510>]
SharedHistoryListGrid.default_filter = {}
SharedHistoryListGrid.default_sort_key = '-update_time'
SharedHistoryListGrid.model_class

alias of History

SharedHistoryListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281550>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d281590>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9d2815d0>]
SharedHistoryListGrid.standard_filters = []
SharedHistoryListGrid.title = 'Histories shared with you by others'
library Module
class galaxy.webapps.galaxy.controllers.library.Library(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

browse_libraries(trans, **kwd)[source]
index(trans, **kwd)[source]
library_list_grid = <galaxy.webapps.galaxy.controllers.library.LibraryListGrid object>
list(trans, **kwd)[source]
class galaxy.webapps.galaxy.controllers.library.LibraryListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, library)[source]
class LibraryListGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, library)[source]
LibraryListGrid.apply_query_filter(trans, query, **kwd)[source]
LibraryListGrid.build_initial_query(trans, **kwargs)[source]
LibraryListGrid.columns = [<galaxy.webapps.galaxy.controllers.library.NameColumn object at 0x7f2aab9e8fd0>, <galaxy.webapps.galaxy.controllers.library.DescriptionColumn object at 0x7f2a9d96b1d0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9d96b510>]
LibraryListGrid.default_filter = {'deleted': 'False', 'description': 'All', 'purged': 'False', 'name': 'All'}
LibraryListGrid.default_sort_key = 'name'
LibraryListGrid.model_class

alias of Library

LibraryListGrid.num_rows_per_page = 50
LibraryListGrid.preserve_state = False
LibraryListGrid.standard_filters = []
LibraryListGrid.template = '/library/grid.mako'
LibraryListGrid.title = 'Data Libraries'
LibraryListGrid.use_paging = True
library_admin Module
class galaxy.webapps.galaxy.controllers.library_admin.LibraryAdmin(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

browse_libraries(trans, *args, **kwargs)[source]
create_library(trans, *args, **kwargs)[source]
delete_library(trans, *args, **kwargs)[source]
library_list_grid = <galaxy.webapps.galaxy.controllers.library_admin.LibraryListGrid object>
purge_library(trans, *args, **kwargs)[source]
undelete_library(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.controllers.library_admin.LibraryListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, library)[source]
class LibraryListGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, library)[source]
class LibraryListGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, library)[source]
LibraryListGrid.columns = [<galaxy.webapps.galaxy.controllers.library_admin.NameColumn object at 0x7f2a9d4ac850>, <galaxy.webapps.galaxy.controllers.library_admin.DescriptionColumn object at 0x7f2a9d4acad0>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d4acc50>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9d4acbd0>, <galaxy.webapps.galaxy.controllers.library_admin.StatusColumn object at 0x7f2a9d4acd50>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9d4accd0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9d4acb90>]
LibraryListGrid.default_filter = {'deleted': 'False', 'description': 'All', 'purged': 'False', 'name': 'All'}
LibraryListGrid.default_sort_key = 'name'
LibraryListGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2a9d4acc90>]
LibraryListGrid.model_class

alias of Library

LibraryListGrid.num_rows_per_page = 50
LibraryListGrid.preserve_state = False
LibraryListGrid.standard_filters = [<galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d4acc10>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d4ac510>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d4ac490>, <galaxy.web.framework.helpers.grids.GridColumnFilter object at 0x7f2a9d4ac410>]
LibraryListGrid.template = '/admin/library/grid.mako'
LibraryListGrid.title = 'Data Libraries'
LibraryListGrid.use_paging = True
library_common Module
class galaxy.webapps.galaxy.controllers.library_common.LibraryCommon(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin, galaxy.web.base.controller.UsesExtendedMetadataMixin, galaxy.web.base.controller.UsesLibraryMixinItems

act_on_multiple_datasets(trans, cntrller, library_id=None, ldda_ids='', **kwd)[source]
add_history_datasets_to_library(trans, cntrller, library_id, folder_id, hda_ids='', **kwd)[source]
browse_library(trans, cntrller='library', **kwd)[source]
create_folder(trans, cntrller, parent_id, library_id, **kwd)[source]
delete_library_item(trans, cntrller, library_id, item_id, item_type, **kwd)[source]
download_dataset_from_folder(trans, cntrller, id, library_id=None, **kwd)[source]

Catches the dataset id and displays file contents as directed

folder_info(trans, cntrller, id, library_id, **kwd)[source]
folder_permissions(trans, cntrller, id, library_id, **kwd)[source]
get_path_paste_uploaded_datasets(trans, cntrller, params, library_bunch, response_code, message)[source]
get_server_dir_uploaded_datasets(trans, cntrller, params, full_dir, import_dir_desc, library_bunch, response_code, message)[source]
import_datasets_to_histories(trans, cntrller, library_id='', folder_id='', ldda_ids='', target_history_id='', target_history_ids='', new_history_name='', **kwd)[source]
ldda_edit_info(trans, cntrller, library_id, folder_id, id, **kwd)[source]
ldda_info(trans, cntrller, library_id, folder_id, id, **kwd)[source]
ldda_permissions(trans, cntrller, library_id, folder_id, id, **kwd)[source]
library_dataset_info(trans, cntrller, id, library_id, **kwd)[source]
library_dataset_permissions(trans, cntrller, id, library_id, **kwd)[source]
library_info(trans, cntrller, **kwd)[source]
library_item_updates(trans, *args, **kwargs)[source]
library_permissions(trans, cntrller, **kwd)[source]
make_library_item_public(trans, cntrller, library_id, item_type, id, **kwd)[source]
make_library_uploaded_dataset(trans, cntrller, params, name, path, type, library_bunch, in_folder=None)[source]
manage_template_inheritance(trans, cntrller, item_type, library_id, folder_id=None, ldda_id=None, **kwd)[source]
move_library_item(trans, cntrller, item_type, item_id, source_library_id='', make_target_current=True, **kwd)[source]
undelete_library_item(trans, cntrller, library_id, item_id, item_type, **kwd)[source]
upload_dataset(trans, cntrller, library_id, folder_id, replace_dataset=None, **kwd)[source]
upload_library_dataset(trans, cntrller, library_id, folder_id, **kwd)[source]
galaxy.webapps.galaxy.controllers.library_common.activatable_folders(trans, folder)[source]
galaxy.webapps.galaxy.controllers.library_common.activatable_folders_and_library_datasets(trans, folder)[source]
galaxy.webapps.galaxy.controllers.library_common.active_folders(trans, folder)[source]
galaxy.webapps.galaxy.controllers.library_common.active_folders_and_library_datasets(trans, folder)[source]
galaxy.webapps.galaxy.controllers.library_common.branch_deleted(folder)[source]
galaxy.webapps.galaxy.controllers.library_common.datasets_for_lddas(trans, lddas)[source]

Given a list of LDDAs, return a list of Datasets for them.

galaxy.webapps.galaxy.controllers.library_common.get_comptypes(trans)[source]
galaxy.webapps.galaxy.controllers.library_common.get_containing_library_from_library_dataset(trans, library_dataset)[source]

Given a library_dataset, get the containing library

galaxy.webapps.galaxy.controllers.library_common.get_sorted_accessible_library_items(trans, cntrller, items, sort_attr)[source]

Return display of results from a full-text lucene search of data libraries.

galaxy.webapps.galaxy.controllers.library_common.map_library_datasets_to_lddas(trans, lib_datasets)[source]

Given a list of LibraryDatasets, return a map from the LibraryDatasets to their LDDAs. If an LDDA does not exist for a LibraryDataset, then there will be no entry in the return hash.

galaxy.webapps.galaxy.controllers.library_common.sort_by_attr(seq, attr)[source]

Sort the sequence of objects by object’s attribute Arguments: seq - the list or any sequence (including immutable one) of objects to sort. attr - the name of attribute to sort by

Return display of results from a full-text whoosh search of data libraries.

mobile Module
class galaxy.webapps.galaxy.controllers.mobile.Mobile(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

dataset_detail(trans, id)[source]
dataset_peek(trans, id)[source]
history_detail(trans, id)[source]
history_list(trans)[source]
index(trans, **kwargs)[source]
settings(trans, email=None, password=None)[source]
page Module
class galaxy.webapps.galaxy.controllers.page.HistoryDatasetAssociationSelectionGrid[source]

Bases: galaxy.webapps.galaxy.controllers.page.ItemSelectionGrid

Grid for selecting HDAs.

apply_query_filter(trans, query, **kwargs)[source]
columns = [<galaxy.webapps.galaxy.controllers.page.NameColumn object at 0x7f2a9cc81ad0>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9cc81b10>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9cc81c50>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9cc81a90>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9cc81910>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc81bd0>]
model_class

alias of HistoryDatasetAssociation

title = 'Saved Datasets'
class galaxy.webapps.galaxy.controllers.page.HistorySelectionGrid[source]

Bases: galaxy.webapps.galaxy.controllers.page.ItemSelectionGrid

Grid for selecting histories.

apply_query_filter(trans, query, **kwargs)[source]
columns = [<galaxy.webapps.galaxy.controllers.page.NameColumn object at 0x7f2a9ce4a610>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9cc81490>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9cc81990>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9cc819d0>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9cc81a10>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc81a50>]
model_class

alias of History

title = 'Saved Histories'
class galaxy.webapps.galaxy.controllers.page.ItemSelectionGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

Base class for pages’ item selection grids.

class NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, item)[source]
ItemSelectionGrid.apply_query_filter(trans, query, **kwargs)[source]
ItemSelectionGrid.default_filter = {'deleted': 'False', 'sharing': 'All'}
ItemSelectionGrid.default_sort_key = '-update_time'
ItemSelectionGrid.num_rows_per_page = 10
ItemSelectionGrid.show_item_checkboxes = True
ItemSelectionGrid.template = '/page/select_items_grid.mako'
ItemSelectionGrid.use_async = True
ItemSelectionGrid.use_paging = True
class galaxy.webapps.galaxy.controllers.page.PageAllPublishedGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

apply_query_filter(trans, query, **kwargs)[source]
build_initial_query(trans, **kwargs)[source]
columns = [<galaxy.web.framework.helpers.grids.PublicURLColumn object at 0x7f2a9cc78350>, <galaxy.web.framework.helpers.grids.OwnerAnnotationColumn object at 0x7f2a9ce4a490>, <galaxy.web.framework.helpers.grids.OwnerColumn object at 0x7f2a9cc783d0>, <galaxy.web.framework.helpers.grids.CommunityRatingColumn object at 0x7f2a9cc78490>, <galaxy.web.framework.helpers.grids.CommunityTagsColumn object at 0x7f2a9cc78790>, <galaxy.web.framework.helpers.grids.ReverseSortColumn object at 0x7f2a9ce4a450>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc78050>]
default_filter = {'username': 'All', 'title': 'All'}
default_sort_key = 'update_time'
model_class

alias of Page

title = 'Published Pages'
use_async = True
use_panels = True
class galaxy.webapps.galaxy.controllers.page.PageController(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.SharableMixin, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.web.base.controller.UsesVisualizationMixin, galaxy.model.item_attrs.UsesItemRatings

create(trans, *args, **kwargs)[source]

Create a new page

display(trans, *args, **kwargs)[source]
display_by_username_and_slug(trans, username, slug)[source]

Display page based on a username and slug.

edit(trans, *args, **kwargs)[source]

Edit a page’s attributes.

edit_content(trans, *args, **kwargs)[source]

Render the main page editor interface.

get_editor_iframe(trans)[source]

Returns the document for the page editor’s iframe.

get_embed_html_async(trans, id)[source]

Returns HTML for embedding a workflow in a page.

get_item(trans, id)[source]

Returns page’s name and link.

get_page(trans, id, check_ownership=True, check_accessible=False)[source]

Get a page from the database by id.

list(trans, *args, **kwargs)[source]

List user’s pages.

list_datasets_for_selection(trans, *args, **kwargs)[source]

Returns HTML that enables a user to select one or more datasets.

list_histories_for_selection(trans, *args, **kwargs)[source]

Returns HTML that enables a user to select one or more histories.

list_pages_for_selection(trans, *args, **kwargs)[source]

Returns HTML that enables a user to select one or more pages.

list_published(trans, *args, **kwargs)[source]
list_visualizations_for_selection(trans, *args, **kwargs)[source]

Returns HTML that enables a user to select one or more visualizations.

list_workflows_for_selection(trans, *args, **kwargs)[source]

Returns HTML that enables a user to select one or more workflows.

rate_async(trans, *args, **kwargs)[source]

Rate a page asynchronously and return updated community data.

save(trans, *args, **kwargs)[source]
set_accessible_async(trans, *args, **kwargs)[source]

Set page’s importable attribute and slug.

share(trans, *args, **kwargs)[source]

Handle sharing with an individual user.

sharing(trans, *args, **kwargs)[source]

Handle page sharing.

class galaxy.webapps.galaxy.controllers.page.PageListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class URLColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.PublicURLColumn

get_value(trans, grid, item)[source]
PageListGrid.apply_query_filter(trans, query, **kwargs)[source]
PageListGrid.columns = [<galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2a9ce4a9d0>, <galaxy.webapps.galaxy.controllers.page.URLColumn object at 0x7f2a9ce4a950>, <galaxy.web.framework.helpers.grids.OwnerAnnotationColumn object at 0x7f2a9ce4a150>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9cc78f10>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9cc78ed0>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9ce4a310>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9cc78e90>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc78ad0>]
PageListGrid.default_filter = {'title': 'All', 'sharing': 'All', 'tags': 'All', 'published': 'All'}
PageListGrid.default_sort_key = '-update_time'
PageListGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2a9cc78c50>]
PageListGrid.model_class

alias of Page

PageListGrid.operations = [<galaxy.web.framework.helpers.grids.DisplayByUsernameAndSlugGridOperation object at 0x7f2a9cc78bd0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9ce4a590>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9cc78b90>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9cc78b50>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9cc78250>]
PageListGrid.title = 'Pages'
PageListGrid.use_panels = True
class galaxy.webapps.galaxy.controllers.page.PageSelectionGrid[source]

Bases: galaxy.webapps.galaxy.controllers.page.ItemSelectionGrid

Grid for selecting pages.

columns = [<galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2a9ce4a3d0>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9cc81710>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9cc81690>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9cc816d0>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9cc817d0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc81750>]
model_class

alias of Page

title = 'Saved Pages'
class galaxy.webapps.galaxy.controllers.page.VisualizationSelectionGrid[source]

Bases: galaxy.webapps.galaxy.controllers.page.ItemSelectionGrid

Grid for selecting visualizations.

columns = [<galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2a9cc81790>, <galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2a9cc81810>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9cc81cd0>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9cc81650>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9cc81e10>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc81610>]
model_class

alias of Visualization

title = 'Saved Visualizations'
class galaxy.webapps.galaxy.controllers.page.WorkflowSelectionGrid[source]

Bases: galaxy.webapps.galaxy.controllers.page.ItemSelectionGrid

Grid for selecting workflows.

columns = [<galaxy.webapps.galaxy.controllers.page.NameColumn object at 0x7f2a9ce4a390>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2a9cc81890>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2a9cc81950>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9cc81c10>, <galaxy.web.framework.helpers.grids.SharingStatusColumn object at 0x7f2a9cc81d10>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9cc81850>]
model_class

alias of StoredWorkflow

title = 'Saved Workflows'
galaxy.webapps.galaxy.controllers.page.format_bool(b)[source]
request_type Module
class galaxy.webapps.galaxy.controllers.request_type.RequestType(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin

browse_request_types(trans, *args, **kwargs)[source]
create_request_type(trans, *args, **kwargs)[source]
delete_request_type(trans, *args, **kwargs)[source]
edit_request_type(trans, *args, **kwargs)[source]
request_type_grid = <galaxy.webapps.galaxy.controllers.request_type.RequestTypeGrid object>
request_type_permissions(trans, *args, **kwargs)[source]
undelete_request_type(trans, *args, **kwargs)[source]
view_editable_request_type(trans, *args, **kwargs)[source]
view_form_definition(trans, *args, **kwargs)[source]
view_request_type(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.controllers.request_type.RequestTypeGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request_type)[source]
class RequestTypeGrid.ExternalServiceColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.IntegerColumn

get_value(trans, grid, request_type)[source]
class RequestTypeGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request_type)[source]
class RequestTypeGrid.RequestFormColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request_type)[source]
class RequestTypeGrid.SampleFormColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request_type)[source]
RequestTypeGrid.columns = [<galaxy.webapps.galaxy.controllers.request_type.NameColumn object at 0x7f2a9ce4a550>, <galaxy.webapps.galaxy.controllers.request_type.DescriptionColumn object at 0x7f2a9ba3a450>, <galaxy.webapps.galaxy.controllers.request_type.RequestFormColumn object at 0x7f2a9ba3a490>, <galaxy.webapps.galaxy.controllers.request_type.SampleFormColumn object at 0x7f2a9ba3a4d0>, <galaxy.webapps.galaxy.controllers.request_type.ExternalServiceColumn object at 0x7f2a9ba3a510>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2a9ba3a550>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9ba3a590>]
RequestTypeGrid.default_filter = {'deleted': 'False'}
RequestTypeGrid.default_sort_key = '-create_time'
RequestTypeGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2a9ba3a750>]
RequestTypeGrid.model_class

alias of RequestType

RequestTypeGrid.num_rows_per_page = 50
RequestTypeGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9ba3a610>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9ba3a650>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9ba3a690>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9ba3a6d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9ba3a710>]
RequestTypeGrid.preserve_state = True
RequestTypeGrid.template = 'admin/request_type/grid.mako'
RequestTypeGrid.title = 'Request Types'
RequestTypeGrid.use_paging = True
requests Module
class galaxy.webapps.galaxy.controllers.requests.Requests(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

browse_requests(trans, **kwd)[source]
find_samples_index(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
request_grid = <galaxy.webapps.galaxy.controllers.requests.UserRequestsGrid object>
class galaxy.webapps.galaxy.controllers.requests.UserRequestsGrid[source]

Bases: galaxy.webapps.galaxy.controllers.requests_common.RequestsGrid

apply_query_filter(trans, query, **kwd)[source]
operation = <galaxy.web.framework.helpers.grids.GridOperation object>
operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aac01e490>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6392d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b639290>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6393d0>]
requests_admin Module
class galaxy.webapps.galaxy.controllers.requests_admin.AdminRequestsGrid[source]

Bases: galaxy.webapps.galaxy.controllers.requests_common.RequestsGrid

class UserColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request)[source]
AdminRequestsGrid.col = <galaxy.web.framework.helpers.grids.MulticolFilterColumn object>
AdminRequestsGrid.columns = [<galaxy.webapps.galaxy.controllers.requests_common.NameColumn object at 0x7f2aab9c8d50>, <galaxy.webapps.galaxy.controllers.requests_common.DescriptionColumn object at 0x7f2aab9c8e10>, <galaxy.webapps.galaxy.controllers.requests_common.SamplesColumn object at 0x7f2aac01e5d0>, <galaxy.webapps.galaxy.controllers.requests_common.TypeColumn object at 0x7f2aac01e4d0>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aac01ef10>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aac01ee50>, <galaxy.webapps.galaxy.controllers.requests_common.StateColumn object at 0x7f2aac01e450>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aac01ead0>, <galaxy.webapps.galaxy.controllers.requests_admin.UserColumn object at 0x7f2aa3f66b50>]
AdminRequestsGrid.global_actions = [<galaxy.web.framework.helpers.grids.GridAction object at 0x7f2aacf8fa50>]
AdminRequestsGrid.operation = <galaxy.web.framework.helpers.grids.GridOperation object>
AdminRequestsGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aac01e490>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8f210>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8fc90>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8f710>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8f850>]
class galaxy.webapps.galaxy.controllers.requests_admin.DataTransferGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class ExternalServiceColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, sample_dataset)[source]
class DataTransferGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, sample_dataset)[source]
class DataTransferGrid.SizeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, sample_dataset)[source]
class DataTransferGrid.StatusColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, sample_dataset)[source]
DataTransferGrid.apply_query_filter(trans, query, **kwd)[source]
DataTransferGrid.columns = [<galaxy.webapps.galaxy.controllers.requests_admin.NameColumn object at 0x7f2aacf8f410>, <galaxy.webapps.galaxy.controllers.requests_admin.SizeColumn object at 0x7f2aacf8f510>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aacf8fad0>, <galaxy.webapps.galaxy.controllers.requests_admin.ExternalServiceColumn object at 0x7f2aacf8f990>, <galaxy.webapps.galaxy.controllers.requests_admin.StatusColumn object at 0x7f2aacf8fe90>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aacf8f190>]
DataTransferGrid.default_sort_key = '-create_time'
DataTransferGrid.model_class

alias of SampleDataset

DataTransferGrid.num_rows_per_page = 50
DataTransferGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8f7d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8fcd0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aacf8f650>]
DataTransferGrid.preserve_state = True
DataTransferGrid.template = 'admin/requests/sample_datasets_grid.mako'
DataTransferGrid.title = 'Sample Datasets'
DataTransferGrid.use_paging = False
class galaxy.webapps.galaxy.controllers.requests_admin.RequestsAdmin(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin

browse_requests(trans, *args, **kwargs)[source]
datatx_grid = <galaxy.webapps.galaxy.controllers.requests_admin.DataTransferGrid object>
get_file_details(trans, *args, **kwargs)[source]
index(trans, *args, **kwargs)[source]
initiate_data_transfer(trans, *args, **kwargs)[source]
manage_datasets(trans, *args, **kwargs)[source]
open_folder(trans, *args, **kwargs)[source]
reject_request(trans, *args, **kwargs)[source]
rename_datasets(trans, *args, **kwargs)[source]
request_grid = <galaxy.webapps.galaxy.controllers.requests_admin.AdminRequestsGrid object>
select_datasets_to_transfer(trans, *args, **kwargs)[source]
update_sample_dataset_status(trans, cntrller, sample_dataset_ids, new_status, error_msg=None)[source]
galaxy.webapps.galaxy.controllers.requests_admin.build_rename_datasets_for_sample_select_field(trans, sample_dataset, selected_value='none')[source]
requests_common Module
class galaxy.webapps.galaxy.controllers.requests_common.RequestsCommon(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin

add_sample(trans, *args, **kwargs)[source]
add_samples(trans, *args, **kwargs)[source]
create_request(trans, *args, **kwargs)[source]
dataset_transfer_status_updates(trans, *args, **kwargs)[source]
delete_request(trans, *args, **kwargs)[source]
delete_sample(trans, *args, **kwargs)[source]
edit_basic_request_info(trans, *args, **kwargs)[source]
edit_email_settings(trans, *args, **kwargs)[source]

Allow for changing the email notification settings where email is sent to a list of users whenever the request state changes to one selected for notification.

edit_samples(trans, *args, **kwargs)[source]
find_samples(trans, *args, **kwargs)[source]
sample_datasets_updates(trans, *args, **kwargs)[source]
sample_state_updates(trans, *args, **kwargs)[source]
submit_request(trans, *args, **kwargs)[source]
undelete_request(trans, *args, **kwargs)[source]
update_request_state(trans, *args, **kwargs)[source]
update_sample_state(trans, cntrller, sample_ids, new_state, comment=None)[source]
view_request(trans, *args, **kwargs)[source]
view_request_history(trans, *args, **kwargs)[source]
view_sample(trans, *args, **kwargs)[source]
view_sample_datasets(trans, *args, **kwargs)[source]
view_sample_history(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.controllers.requests_common.RequestsGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class DescriptionColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request)[source]
class RequestsGrid.NameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request)[source]
class RequestsGrid.SamplesColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, request)[source]
class RequestsGrid.StateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.StateColumn

filter(trans, user, query, column_filter)[source]

Modify query to filter request by state.

get_value(trans, grid, request)[source]
class RequestsGrid.TypeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request)[source]
RequestsGrid.columns = [<galaxy.webapps.galaxy.controllers.requests_common.NameColumn object at 0x7f2aab9c8d50>, <galaxy.webapps.galaxy.controllers.requests_common.DescriptionColumn object at 0x7f2aab9c8e10>, <galaxy.webapps.galaxy.controllers.requests_common.SamplesColumn object at 0x7f2aac01e5d0>, <galaxy.webapps.galaxy.controllers.requests_common.TypeColumn object at 0x7f2aac01e4d0>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aac01ef10>, <galaxy.web.framework.helpers.grids.DeletedColumn object at 0x7f2aac01ee50>, <galaxy.webapps.galaxy.controllers.requests_common.StateColumn object at 0x7f2aac01e450>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aac01ead0>]
RequestsGrid.default_filter = {'deleted': 'False', 'state': 'All'}
RequestsGrid.default_sort_key = '-update_time'
RequestsGrid.model_class

alias of Request

RequestsGrid.num_rows_per_page = 50
RequestsGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2aac01e490>]
RequestsGrid.template = 'requests/grid.mako'
RequestsGrid.title = 'Sequencing Requests'
RequestsGrid.use_paging = True
galaxy.webapps.galaxy.controllers.requests_common.invalid_id_redirect(trans, cntrller, obj_id, item='sequencing request', action='browse_requests')[source]
root Module

Contains the main interface in the Universe class

class galaxy.webapps.galaxy.controllers.root.RootController(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.model.item_attrs.UsesAnnotations

Controller class that maps to the url root of Galaxy (i.e. ‘/’).

bucket_proxy(trans, bucket=None, **kwd)[source]
clear_history(trans)[source]

Clears the history for a user.

dataset_make_primary(trans, id=None)[source]

Copies a dataset and makes primary.

default(trans, target1=None, target2=None, **kwd)[source]

Called on any url that does not match a controller method.

display(trans, id=None, hid=None, tofile=None, toext='.txt', encoded_id=None, **kwd)[source]

Returns data directly into the browser.

Sets the mime-type according to the extension.

Used by the twill tool test driver - used anywhere else? Would like to drop hid argument and path if unneeded now. Likewise, would like to drop encoded_id=XXX and use assume id is encoded (likely id wouldn’t be coming in encoded if this is used anywhere else though.)

display_as(trans, id=None, display_app=None, **kwd)[source]

Returns a file in a format that can successfully be displayed in display_app.

display_child(trans, parent_id=None, designation=None, tofile=None, toext='.txt')[source]

Returns child data directly into the browser, based upon parent_id and designation.

echo(trans, **kwd)[source]

Echos parameters (debugging).

echo_json(trans, *args, **kwargs)[source]

Echos parameters as JSON (debugging).

Attempts to parse values passed as boolean, float, then int. Defaults to string. Non-recursive (will not parse lists).

generate_error(trans, code=500)[source]

Raises an exception (debugging).

generate_json_error(trans, *args, **kwargs)[source]

Raises an exception (debugging).

history(trans, as_xml=False, show_deleted=None, show_hidden=None, **kwd)[source]

Display the current history in its own page or as xml.

history_add_to(trans, history_id=None, file_data=None, name='Data Added to History', info=None, ext='txt', dbkey='?', copy_access_from=None, **kwd)[source]

Adds a POSTed file to a History.

history_as_xml(trans, show_deleted=None, show_hidden=None)[source]
history_delete(trans, id)[source]

Backward compatibility with check_galaxy script.

history_import(trans, id=None, confirm=False, **kwd)[source]
history_new(trans, name=None)[source]

Create a new history with the given name and refresh the history panel.

history_options(trans)[source]

Displays a list of history related actions.

history_set_default_permissions(trans, id=None, **kwd)[source]

Sets the permissions on a history.

index(trans, id=None, tool_id=None, mode=None, workflow_id=None, m_c=None, m_a=None, **kwd)[source]

Called on the root url to display the main Galaxy page.

peek(trans, id=None)[source]

Returns a ‘peek’ at the data.

tool_help(trans, id)[source]

Return help page for tool identified by ‘id’ if available

Searches the tool database and returns data for any tool whose text matches the query.

Data are returned in JSON format.

welcome(trans)[source]
tag Module

Tags Controller: handles tagging/untagging of entities and provides autocomplete support.

class galaxy.webapps.galaxy.controllers.tag.TagsController(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesTagsMixin

add_tag_async(trans, *args, **kwargs)[source]

Add tag to an item.

get_tagging_elt_async(trans, *args, **kwargs)[source]

Returns HTML for editing an item’s tags.

remove_tag_async(trans, *args, **kwargs)[source]

Remove tag from an item.

retag_async(trans, *args, **kwargs)[source]

Apply a new set of tags to an item; previous tags are deleted.

tag_autocomplete_data(trans, *args, **kwargs)[source]

Get autocomplete data for an item’s tags.

tool_runner Module

Upload class

class galaxy.webapps.galaxy.controllers.tool_runner.AddFrameData[source]
class galaxy.webapps.galaxy.controllers.tool_runner.ToolRunner(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

biomart(trans, tool_id='biomart', **kwd)[source]

Catches the tool id and redirects as needed

data_source_redirect(trans, tool_id=None)[source]

Redirects a user accessing a Data Source tool to its target action link. This method will subvert mix-mode content blocking in several browsers when accessing non-https data_source tools from an https galaxy server.

Tested as working on Safari 7.0 and FireFox 26 Subverting did not work on Chrome 31

default(trans, tool_id=None, **kwd)[source]

Catches the tool id and redirects as needed

hapmapmart(trans, tool_id='hapmapmart', **kwd)[source]

Catches the tool id and redirects as needed

index(trans, tool_id=None, from_noframe=None, **kwd)[source]
redirect(trans, redirect_url=None, **kwd)[source]
rerun(trans, id=None, from_noframe=None, job_id=None, **kwd)[source]

Given a HistoryDatasetAssociation id, find the job and that created the dataset, extract the parameters, and display the appropriate tool form with parameters already filled in.

upload_async_create(trans, *args, **kwargs)[source]

Precreate datasets for asynchronous uploading.

upload_async_message(trans, **kwd)[source]
ucsc_proxy Module

Contains the UCSC proxy

class galaxy.webapps.galaxy.controllers.ucsc_proxy.UCSCProxy(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

create_display(store)[source]

Creates a more meaningulf display name

index(trans, init=False, **kwd)[source]
user Module

Contains the user interface in the Universe class

class galaxy.webapps.galaxy.controllers.user.User(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin, galaxy.web.base.controller.CreatesUsersMixin, galaxy.web.base.controller.CreatesApiKeysMixin

activate(trans, **kwd)[source]

Check whether token fits the user and then activate the user’s account.

api_keys(trans, *args, **kwargs)[source]
change_password(trans, token=None, **kwd)[source]

Provides a form with which one can change their password. If token is provided, don’t require current password.

create(trans, cntrller='user', redirect_url='', refresh_frames=[], **kwd)[source]
dbkeys(trans, *args, **kwargs)[source]

Handle custom builds.

delete_address(trans, *args, **kwargs)[source]
edit_address(trans, *args, **kwargs)[source]
edit_info(trans, cntrller, **kwd)[source]

Edit user information = username, email or password.

edit_toolbox_filters(trans, *args, **kwargs)[source]
edit_username(trans, *args, **kwargs)[source]
get_activation_token(trans, email)[source]

Check for the activation token. Create new activation token and store it in the database if no token found.

get_most_recently_used_tool_async(trans, *args, **kwargs)[source]

Returns information about the most recently used tool.

index(trans, cntrller, **kwd)[source]
installed_len_files = None
is_outside_grace_period(trans, create_time)[source]

Function checks whether the user is outside the config-defined grace period for inactive accounts.

log_user_action_async(trans, action, context, params)[source]

Log a user action asynchronously. If user is not logged in, do nothing.

login(trans, refresh_frames=[], **kwd)[source]

Handle Galaxy Log in

logout(trans, logout_all=False)[source]
manage_addresses(trans, **kwd)[source]
manage_user_info(trans, cntrller, **kwd)[source]

Manage a user’s login, password, public username, type, addresses, etc.

new_address(trans, *args, **kwargs)[source]
openid_associate(trans, cntrller='user', **kwd)[source]

Associates a user with an OpenID log in

openid_auth(trans, **kwd)[source]

Handles user request to access an OpenID provider

openid_disassociate(trans, *args, **kwargs)[source]

Disassociates a user with an OpenID

openid_manage(trans, *args, **kwargs)[source]

Manage OpenIDs for user

openid_process(trans, **kwd)[source]

Handle’s response from OpenID Providers

Prepare the account activation link for the user.

proceed_login(trans, user, redirect)[source]

Function processes user login. It is called in case all the login requirements are valid.

resend_verification(trans)[source]

Exposed function for use outside of the class. E.g. when user click on the resend link in the masthead.

resend_verification_email(trans, email, username)[source]

Function resends the verification email in case user wants to log in with an inactive account or he clicks the resend link.

reset_password(trans, email=None, **kwd)[source]

Reset the user’s password. Send an email with token that allows a password change.

send_verification_email(trans, email, username)[source]

Send the verification email containing the activation link to the user’s email.

set_default_permissions(trans, cntrller, **kwd)[source]

Set the user’s default permissions for the new histories

set_user_pref_async(trans, pref_name, pref_value)[source]

Set a user preference asynchronously. If user is not logged in, do nothing.

toolbox_filters(trans, *args, **kwargs)[source]

Sets the user’s default filters for the toolbox. Toolbox filters are specified in galaxy.ini. The user can activate them and the choice is stored in user_preferences.

undelete_address(trans, *args, **kwargs)[source]
user_openid_grid = <galaxy.webapps.galaxy.controllers.user.UserOpenIDGrid object>
class galaxy.webapps.galaxy.controllers.user.UserOpenIDGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

build_initial_query(trans, **kwd)[source]
columns = [<galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2a9c0a7690>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aa870dd90>]
default_filter = {'openid': 'All'}
default_sort_key = '-create_time'
model_class

alias of UserOpenID

operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9c0a6e10>]
template = '/user/openid_manage.mako'
title = 'OpenIDs linked to your account'
use_panels = False
visualization Module
workflow Module
class galaxy.webapps.galaxy.controllers.workflow.SingleTagContentsParser(target_tag)[source]

Bases: sgmllib.SGMLParser

handle_data(text)[source]

Called for each block of plain text.

unknown_starttag(tag, attrs)[source]

Called for each start tag.

class galaxy.webapps.galaxy.controllers.workflow.StoredWorkflowAllPublishedGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

apply_query_filter(trans, query, **kwargs)[source]
build_initial_query(trans, **kwargs)[source]
columns = [<galaxy.web.framework.helpers.grids.PublicURLColumn object at 0x7f2a9b6fc490>, <galaxy.web.framework.helpers.grids.OwnerAnnotationColumn object at 0x7f2a9b6fc1d0>, <galaxy.web.framework.helpers.grids.OwnerColumn object at 0x7f2a9b6fc690>, <galaxy.web.framework.helpers.grids.CommunityRatingColumn object at 0x7f2a9b6fc8d0>, <galaxy.web.framework.helpers.grids.CommunityTagsColumn object at 0x7f2a9b6fcc10>, <galaxy.web.framework.helpers.grids.ReverseSortColumn object at 0x7f2a9b6fc610>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9b6fc190>]
default_filter = {'username': 'All', 'public_url': 'All', 'tags': 'All'}
default_sort_key = 'update_time'
model_class

alias of StoredWorkflow

operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fc710>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fc890>]
title = 'Published Workflows'
use_async = True
class galaxy.webapps.galaxy.controllers.workflow.StoredWorkflowListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class StepsColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, workflow)[source]
StoredWorkflowListGrid.apply_query_filter(trans, query, **kwargs)[source]
StoredWorkflowListGrid.columns = [<galaxy.web.framework.helpers.grids.TextColumn object at 0x7f2aa1126250>, <galaxy.web.framework.helpers.grids.IndividualTagsColumn object at 0x7f2aa1126210>, <galaxy.webapps.galaxy.controllers.workflow.StepsColumn object at 0x7f2aabc6bc50>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aabc6b810>, <galaxy.web.framework.helpers.grids.GridColumn object at 0x7f2aabc6bdd0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9b6fc6d0>]
StoredWorkflowListGrid.default_filter = {'name': 'All', 'tags': 'All'}
StoredWorkflowListGrid.default_sort_key = '-update_time'
StoredWorkflowListGrid.model_class

alias of StoredWorkflow

StoredWorkflowListGrid.operations = [<galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fc210>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fc7d0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fcbd0>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fce50>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fc290>, <galaxy.web.framework.helpers.grids.GridOperation object at 0x7f2a9b6fc750>]
StoredWorkflowListGrid.title = 'Saved Workflows'
StoredWorkflowListGrid.use_panels = True
class galaxy.webapps.galaxy.controllers.workflow.WorkflowController(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.SharableMixin, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesItemRatings

annotate_async(trans, *args, **kwargs)[source]
build_from_current_history(trans, job_ids=None, dataset_ids=None, dataset_collection_ids=None, workflow_name=None)[source]
configure_menu(trans, workflow_ids=None)[source]
copy(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]

Create a new stored workflow with name workflow_name.

delete(trans, id=None)[source]

Mark a workflow as deleted

display_by_id(trans, id)[source]

Display workflow based on id.

display_by_username_and_slug(trans, username, slug, format='html')[source]

Display workflow based on a username and slug. Format can be html, json, or json-download.

editor(trans, *args, **kwargs)[source]

Render the main workflow editor interface. The canvas is embedded as an iframe (necessary for scrolling to work properly), which is rendered by editor_canvas.

editor_form_post(trans, *args, **kwargs)[source]

Accepts a tool state and incoming values, and generates a new tool form and some additional information, packed into a json dictionary. This is used for the form shown in the right pane when a node is selected.

export(trans, *args, **kwargs)[source]

Handles download/export workflow command.

export_to_file(trans, *args, **kwargs)[source]

Get the latest Workflow for the StoredWorkflow identified by id and encode it as a json string that can be imported back into Galaxy

This has slightly different information than the above. In particular, it does not attempt to decode forms and build UIs, it just stores the raw state.

export_to_myexp(trans, *args, **kwargs)[source]

Exports a workflow to myExperiment website.

for_direct_import(trans, *args, **kwargs)[source]

Get the latest Workflow for the StoredWorkflow identified by id and encode it as a json string that can be imported back into Galaxy

This has slightly different information than the above. In particular, it does not attempt to decode forms and build UIs, it just stores the raw state.

gen_image(trans, *args, **kwargs)[source]
get_embed_html_async(trans, id)[source]

Returns HTML for embedding a workflow in a page.

get_item(trans, id)[source]
get_item_content_async(trans, id)[source]

Returns item content in HTML format.

Returns workflow’s name and link.

get_new_module_info(trans, *args, **kwargs)[source]

Get the info for a new instance of a module initialized with default parameters (any keyword arguments will be passed along to the module). Result includes data inputs and outputs, html representation of the initial form, and the initial tool state (with default values). This is called asynchronously whenever a new node is added.

imp(trans, *args, **kwargs)[source]

Imports a workflow shared by other users.

import_workflow(trans, cntrller='workflow', **kwd)[source]

Import a workflow by reading an url, uploading a file, opening and reading the contents of a local file, or receiving the textual representation of a workflow via http.

index(trans)[source]
list(trans, *args, **kwargs)[source]

Render workflow main page (management of existing workflows)

list_for_run(trans, *args, **kwargs)[source]

Render workflow list for analysis view (just allows running workflow or switching to management view)

list_grid(trans, *args, **kwargs)[source]

List user’s stored workflows.

list_published(trans, **kwargs)[source]
load_workflow(trans, *args, **kwargs)[source]

Get the latest Workflow for the StoredWorkflow identified by id and encode it as a json string that can be read by the workflow editor web interface.

published_list_grid = <galaxy.webapps.galaxy.controllers.workflow.StoredWorkflowAllPublishedGrid object>
rate_async(trans, *args, **kwargs)[source]

Rate a workflow asynchronously and return updated community data.

rename(trans, *args, **kwargs)[source]
rename_async(trans, *args, **kwargs)[source]
run(trans, id, history_id=None, hide_fixed_params=False, **kwargs)[source]
save_workflow(trans, *args, **kwargs)[source]

Save the workflow described by workflow_data with id id.

set_accessible_async(trans, *args, **kwargs)[source]

Set workflow’s importable attribute and slug.

share(trans, *args, **kwargs)[source]
sharing(trans, *args, **kwargs)[source]

Handle workflow sharing.

stored_list_grid = <galaxy.webapps.galaxy.controllers.workflow.StoredWorkflowListGrid object>
tag_outputs(trans, id, **kwargs)[source]
reports Package
reports Package

The Galaxy Reports application.

app Module
class galaxy.webapps.reports.app.UniverseApplication(**kwargs)[source]

Bases: object

Encapsulates the state of a Universe application

shutdown()[source]
buildapp Module

Provides factory methods to assemble the Galaxy web application

class galaxy.webapps.reports.buildapp.ReportsWebApplication(galaxy_app, session_cookie='galaxysession', name=None)[source]

Bases: galaxy.web.framework.webapp.WebApplication

galaxy.webapps.reports.buildapp.add_ui_controllers(webapp, app)[source]

Search for controllers in the ‘galaxy.webapps.controllers’ module and add them to the webapp.

galaxy.webapps.reports.buildapp.app_factory(global_conf, **kwargs)[source]

Return a wsgi application serving the root object

galaxy.webapps.reports.buildapp.build_template_error_formatters()[source]

Build a list of template error formatters for WebError. When an error occurs, WebError pass the exception to each function in this list until one returns a value, which will be displayed on the error page.

galaxy.webapps.reports.buildapp.wrap_in_middleware(app, global_conf, **local_conf)[source]

Based on the configuration wrap app in a set of common and useful middleware.

galaxy.webapps.reports.buildapp.wrap_in_static(app, global_conf, **local_conf)[source]
config Module

Universe configuration builder.

class galaxy.webapps.reports.config.Configuration(**kwargs)[source]

Bases: object

check()[source]
get(key, default)[source]
exception galaxy.webapps.reports.config.ConfigurationError[source]

Bases: exceptions.Exception

galaxy.webapps.reports.config.configure_logging(config)[source]

Allow some basic logging configuration to be read from the cherrpy config.

galaxy.webapps.reports.config.get_database_engine_options(kwargs)[source]

Allow options for the SQLAlchemy database engine to be passed by using the prefix “database_engine_option”.

galaxy.webapps.reports.config.resolve_path(path, root)[source]

If ‘path’ is relative make absolute by prepending ‘root’

Subpackages
controllers Package
controllers Package

Galaxy reports controllers.

jobs Module
class galaxy.webapps.reports.controllers.jobs.Jobs(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.webapps.reports.controllers.query.ReportQueryBuilder

Class contains functions for querying data requested by user via the webapp. It exposes the functions and responds to requests with the filled .mako templates.

job_info(trans, **kwd)[source]
per_month_all(trans, **kwd)[source]

Queries the DB for all jobs. Avoids monitor jobs.

per_month_in_error(trans, **kwd)[source]

Queries the DB for user jobs in error. Filters out monitor jobs.

per_tool(trans, **kwd)[source]
per_user(trans, **kwd)[source]
specified_date_handler(trans, **kwd)[source]
specified_date_list_grid = <galaxy.webapps.reports.controllers.jobs.SpecifiedDateListGrid object>
specified_month_all(trans, **kwd)[source]

Queries the DB for all jobs in given month, defaults to current month.

specified_month_in_error(trans, **kwd)[source]

Queries the DB for the user jobs in error.

tool_per_month(trans, **kwd)[source]
user_per_month(trans, **kwd)[source]
class galaxy.webapps.reports.controllers.jobs.SpecifiedDateListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class CreateTimeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.DateTimeColumn

get_value(trans, grid, job)[source]
class SpecifiedDateListGrid.EmailColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

filter(trans, user, query, column_filter)[source]
class SpecifiedDateListGrid.JobIdColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.IntegerColumn

get_value(trans, grid, job)[source]
class SpecifiedDateListGrid.SpecifiedDateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

filter(trans, user, query, column_filter)[source]
class SpecifiedDateListGrid.StateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

filter(trans, user, query, column_filter)[source]
get_value(trans, grid, job)[source]
class SpecifiedDateListGrid.ToolColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, job)[source]
class SpecifiedDateListGrid.UserColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

get_value(trans, grid, job)[source]
SpecifiedDateListGrid.build_initial_query(trans, **kwd)[source]
SpecifiedDateListGrid.columns = [<galaxy.webapps.reports.controllers.jobs.JobIdColumn object at 0x7f2a9a7613d0>, <galaxy.webapps.reports.controllers.jobs.StateColumn object at 0x7f2a9ac087d0>, <galaxy.webapps.reports.controllers.jobs.ToolColumn object at 0x7f2a9a898e10>, <galaxy.webapps.reports.controllers.jobs.CreateTimeColumn object at 0x7f2a9a7f6290>, <galaxy.webapps.reports.controllers.jobs.UserColumn object at 0x7f2a9a887810>, <galaxy.webapps.reports.controllers.jobs.SpecifiedDateColumn object at 0x7f2a9a8872d0>, <galaxy.webapps.reports.controllers.jobs.EmailColumn object at 0x7f2a9a7ddf10>, <galaxy.web.framework.helpers.grids.StateColumn object at 0x7f2aabfca1d0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2aabfcae90>]
SpecifiedDateListGrid.default_filter = {'specified_date': 'All'}
SpecifiedDateListGrid.default_sort_key = 'id'
SpecifiedDateListGrid.model_class

alias of Job

SpecifiedDateListGrid.num_rows_per_page = 50
SpecifiedDateListGrid.preserve_state = False
SpecifiedDateListGrid.standard_filters = []
SpecifiedDateListGrid.template = '/webapps/reports/grid.mako'
SpecifiedDateListGrid.title = 'Jobs'
SpecifiedDateListGrid.use_async = False
SpecifiedDateListGrid.use_paging = True
galaxy.webapps.reports.controllers.jobs.get_job(trans, id)[source]
galaxy.webapps.reports.controllers.jobs.get_monitor_id(trans, monitor_email)[source]

A convenience method to obtain the monitor job id.

root Module
class galaxy.webapps.reports.controllers.root.Report(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

index(trans, **kwd)[source]
sample_tracking Module
class galaxy.webapps.reports.controllers.sample_tracking.SampleTracking(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.webapps.reports.controllers.query.ReportQueryBuilder

per_month_all(trans, **kwd)[source]
per_user(trans, **kwd)[source]
specified_date_handler(trans, **kwd)[source]
specified_date_list_grid = <galaxy.webapps.reports.controllers.sample_tracking.SpecifiedDateListGrid object>
user_per_month(trans, **kwd)[source]
class galaxy.webapps.reports.controllers.sample_tracking.SpecifiedDateListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class CreateTimeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.DateTimeColumn

get_value(trans, grid, request)[source]
class SpecifiedDateListGrid.EmailColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

filter(trans, user, query, column_filter)[source]
class SpecifiedDateListGrid.RequestNameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request)[source]
class SpecifiedDateListGrid.SpecifiedDateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

filter(trans, user, query, column_filter)[source]
class SpecifiedDateListGrid.UserColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, request)[source]
SpecifiedDateListGrid.build_initial_query(trans, **kwd)[source]
SpecifiedDateListGrid.columns = [<galaxy.webapps.reports.controllers.sample_tracking.RequestNameColumn object at 0x7f2a9a7f6610>, <galaxy.webapps.reports.controllers.sample_tracking.CreateTimeColumn object at 0x7f2a9a776050>, <galaxy.webapps.reports.controllers.sample_tracking.UserColumn object at 0x7f2a9a4b48d0>, <galaxy.webapps.reports.controllers.sample_tracking.SpecifiedDateColumn object at 0x7f2a9ae81f90>, <galaxy.webapps.reports.controllers.sample_tracking.EmailColumn object at 0x7f2a9a4a4c90>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9a519390>]
SpecifiedDateListGrid.default_filter = {'specified_date': 'All'}
SpecifiedDateListGrid.default_sort_key = 'name'
SpecifiedDateListGrid.model_class

alias of Request

SpecifiedDateListGrid.num_rows_per_page = 50
SpecifiedDateListGrid.preserve_state = False
SpecifiedDateListGrid.standard_filters = []
SpecifiedDateListGrid.template = '/webapps/reports/grid.mako'
SpecifiedDateListGrid.title = 'Sequencing Requests'
SpecifiedDateListGrid.use_async = False
SpecifiedDateListGrid.use_paging = True
galaxy.webapps.reports.controllers.sample_tracking.get_request(trans, id)[source]
system Module
class galaxy.webapps.reports.controllers.system.System(app)[source]

Bases: galaxy.web.base.controller.BaseUIController

dataset_info(trans, **kwd)[source]
deleted_datasets(trans, **kwd)[source]

The number of datasets that were deleted more than the specified number of days ago, but have not yet been purged.

deleted_histories(trans, **kwd)[source]

The number of histories that were deleted more than the specified number of days ago, but have not yet been purged. Also included is the number of datasets associated with the histories.

disk_usage(trans, **kwd)[source]
get_disk_usage(file_path)[source]
index(trans, **kwd)[source]
userless_histories(trans, **kwd)[source]

The number of userless histories and associated datasets that have not been updated for the specified number of days.

galaxy.webapps.reports.controllers.system.nice_size(size, include_bytes=False)[source]

Returns a readably formatted string with the size

users Module
class galaxy.webapps.reports.controllers.users.Users(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.webapps.reports.controllers.query.ReportQueryBuilder

last_access_date(trans, **kwd)[source]
registered_users(trans, **kwd)[source]
registered_users_per_month(trans, **kwd)[source]
specified_date(trans, **kwd)[source]
specified_month(trans, **kwd)[source]
user_disk_usage(trans, **kwd)[source]
workflows Module
class galaxy.webapps.reports.controllers.workflows.SpecifiedDateListGrid[source]

Bases: galaxy.web.framework.helpers.grids.Grid

class CreateTimeColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.DateTimeColumn

get_value(trans, grid, stored_workflow)[source]
class SpecifiedDateListGrid.EmailColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

filter(trans, user, query, column_filter)[source]
class SpecifiedDateListGrid.SpecifiedDateColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.GridColumn

filter(trans, user, query, column_filter)[source]
class SpecifiedDateListGrid.UserColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, stored_workflow)[source]
class SpecifiedDateListGrid.WorkflowNameColumn(label, key=None, model_class=None, method=None, format=None, link=None, attach_popup=False, visible=True, nowrap=False, filterable=None, sortable=True, label_id_prefix=None, inbound=False)[source]

Bases: galaxy.web.framework.helpers.grids.TextColumn

get_value(trans, grid, stored_workflow)[source]
SpecifiedDateListGrid.build_initial_query(trans, **kwd)[source]
SpecifiedDateListGrid.columns = [<galaxy.webapps.reports.controllers.workflows.WorkflowNameColumn object at 0x7f2a9a098490>, <galaxy.webapps.reports.controllers.workflows.CreateTimeColumn object at 0x7f2a9a098150>, <galaxy.webapps.reports.controllers.workflows.UserColumn object at 0x7f2a9a5e03d0>, <galaxy.webapps.reports.controllers.workflows.SpecifiedDateColumn object at 0x7f2a9a05f550>, <galaxy.webapps.reports.controllers.workflows.EmailColumn object at 0x7f2a9a05f4d0>, <galaxy.web.framework.helpers.grids.MulticolFilterColumn object at 0x7f2a9a05f590>]
SpecifiedDateListGrid.default_filter = {'specified_date': 'All'}
SpecifiedDateListGrid.default_sort_key = 'name'
SpecifiedDateListGrid.model_class

alias of StoredWorkflow

SpecifiedDateListGrid.num_rows_per_page = 50
SpecifiedDateListGrid.preserve_state = False
SpecifiedDateListGrid.standard_filters = []
SpecifiedDateListGrid.template = '/webapps/reports/grid.mako'
SpecifiedDateListGrid.title = 'Workflows'
SpecifiedDateListGrid.use_async = False
SpecifiedDateListGrid.use_paging = True
class galaxy.webapps.reports.controllers.workflows.Workflows(app)[source]

Bases: galaxy.web.base.controller.BaseUIController, galaxy.webapps.reports.controllers.query.ReportQueryBuilder

per_month_all(trans, **kwd)[source]
per_user(trans, **kwd)[source]
specified_date_handler(trans, **kwd)[source]
specified_date_list_grid = <galaxy.webapps.reports.controllers.workflows.SpecifiedDateListGrid object>
user_per_month(trans, **kwd)[source]
galaxy.webapps.reports.controllers.workflows.get_workflow(trans, id)[source]
workflow Package
modules Module

Modules used in building workflows

exception galaxy.workflow.modules.CancelWorkflowEvaluation[source]

Bases: exceptions.Exception

exception galaxy.workflow.modules.DelayedWorkflowEvaluation[source]

Bases: exceptions.Exception

class galaxy.workflow.modules.InputDataCollectionModule(trans)[source]

Bases: galaxy.workflow.modules.InputModule

collection_type = 'list'
default_collection_type = 'list'
default_name = 'Input Dataset Collection'
classmethod default_state(Class)[source]
get_data_outputs()[source]
get_runtime_inputs(filter_set=['data'])[source]
name = 'Input dataset collection'
state_fields = ['name', 'collection_type']
type = 'data_collection_input'
class galaxy.workflow.modules.InputDataModule(trans)[source]

Bases: galaxy.workflow.modules.InputModule

default_name = 'Input Dataset'
classmethod default_state(Class)[source]
get_data_outputs()[source]
get_runtime_inputs(filter_set=['data'])[source]
name = 'Input dataset'
state_fields = ['name']
type = 'data_input'
class galaxy.workflow.modules.InputModule(trans)[source]

Bases: galaxy.workflow.modules.SimpleWorkflowModule

execute(trans, progress, invocation, step)[source]
get_data_inputs()[source]
get_runtime_input_dicts(step_annotation)[source]
get_runtime_state()[source]
recover_mapping(step, step_invocations, progress)[source]
exception galaxy.workflow.modules.MissingToolException[source]

Bases: exceptions.Exception

WorkflowModuleInjector will raise this if the tool corresponding to the module is missing.

class galaxy.workflow.modules.PauseModule(trans)[source]

Bases: galaxy.workflow.modules.SimpleWorkflowModule

Initially this module will unconditionally pause a workflow - will aim to allow conditional pausing later on.

default_name = 'Pause for Dataset Review'
classmethod default_state(Class)[source]
do_invocation_step_action(step, action)[source]

Update or set the workflow invocation state action - generic extension point meant to allows users to interact with interactive workflow modules. The action object returned from this method will be attached to the WorkflowInvocationStep and be available the next time the workflow scheduler visits the workflow.

execute(trans, progress, invocation, step)[source]
get_data_inputs()[source]
get_data_outputs()[source]
get_runtime_input_dicts(step_annotation)[source]
get_runtime_inputs(**kwds)[source]
get_runtime_state()[source]
name = 'Pause for dataset review'
recover_mapping(step, step_invocations, progress)[source]
state_fields = ['name']
type = 'pause'
class galaxy.workflow.modules.SimpleWorkflowModule(trans)[source]

Bases: galaxy.workflow.modules.WorkflowModule

compute_runtime_state(trans, step_updates=None, source='html')[source]
decode_runtime_state(trans, string)[source]
classmethod default_state(Class)[source]

This method should return a dictionary describing each configuration property and its default value.

encode_runtime_state(trans, state)[source]
classmethod from_dict(Class, trans, d, secure=True)[source]
classmethod from_workflow_step(Class, trans, step)[source]
get_config_form()[source]
get_state(secure=True)[source]
classmethod new(Class, trans, tool_id=None)[source]
normalize_runtime_state(runtime_state)[source]
recover_runtime_state(runtime_state)[source]

Take secure runtime state from persisted invocation and convert it into a DefaultToolState object for use during workflow invocation.

recover_state(state, **kwds)[source]

Recover state dict from simple dictionary describing configuration state (potentially from persisted step state).

Sub-classes should supply default_state method and state_fields attribute which are used to build up the state dict.

save_to_step(step)[source]
update_runtime_state(trans, state, values)[source]
update_state(incoming)[source]
class galaxy.workflow.modules.ToolModule(trans, tool_id, tool_version=None)[source]

Bases: galaxy.workflow.modules.WorkflowModule

add_dummy_datasets(connections=None)[source]
check_and_update_state()[source]
compute_runtime_state(trans, step_updates=None, source='html')[source]
encode_runtime_state(trans, state)[source]
execute(trans, progress, invocation, step)[source]
classmethod from_dict(Class, trans, d, secure=True)[source]
classmethod from_workflow_step(Class, trans, step)[source]
get_config_form()[source]
get_data_inputs()[source]
get_data_outputs()[source]
get_errors()[source]
get_name()[source]
get_post_job_actions(incoming=None)[source]
get_runtime_input_dicts(step_annotation)[source]
get_state(secure=True)[source]
get_tool_id()[source]
get_tool_version()[source]
get_tooltip(static_path='')[source]
classmethod new(Class, trans, tool_id=None)[source]
normalize_runtime_state(runtime_state)[source]
recover_mapping(step, step_invocations, progress)[source]
recover_runtime_state(runtime_state)[source]

Take secure runtime state from persisted invocation and convert it into a DefaultToolState object for use during workflow invocation.

recover_state(state, **kwds)[source]

Recover module configuration state property (a DefaultToolState object) using the tool’s params_from_strings method.

save_to_step(step)[source]
type = 'tool'
update_state(incoming)[source]
class galaxy.workflow.modules.WorkflowModule(trans)[source]

Bases: object

add_dummy_datasets(connections=None)[source]
check_and_update_state()[source]

If the state is not in sync with the current implementation of the module, try to update. Returns a list of messages to be displayed

compute_runtime_state(trans, step_updates=None, source='html')[source]

Determine the runtime state (potentially different from self.state which describes configuration state). This (again unlike self.state) is currently always a DefaultToolState object.

If step_updates is None, this is likely for rendering the run form for instance and no runtime properties are available and state must be solely determined by the default runtime state described by the step.

If step_updates are available they describe the runtime properties supplied by the workflow runner (potentially including a tool_state parameter which is the serialized default encoding state created with encode_runtime_state above).

do_invocation_step_action(step, action)[source]

Update or set the workflow invocation state action - generic extension point meant to allows users to interact with interactive workflow modules. The action object returned from this method will be attached to the WorkflowInvocationStep and be available the next time the workflow scheduler visits the workflow.

encode_runtime_state(trans, state)[source]

Encode the default runtime state at return as a simple str for use in a hidden parameter on the workflow run submission form.

This default runtime state will be combined with user supplied parameters in compute_runtime_state below at workflow invocation time to actually describe how each step will be executed.

execute(trans, progress, invocation, step)[source]

Execute the given workflow step in the given workflow invocation. Use the supplied workflow progress object to track outputs, find inputs, etc...

classmethod from_dict(Class, trans, d)[source]

Create a new instance of the module initialized from values in the dictionary d.

classmethod from_workflow_step(Class, trans, step)[source]
get_config_form()[source]

Render form that is embedded in workflow editor for modifying the step state of a node.

get_data_inputs()[source]

Get configure time data input descriptions.

get_data_outputs()[source]
get_errors()[source]

It seems like this is effectively just used as boolean - some places in the tool shed self.errors is set to boolean, other places ‘unavailable’, likewise in Galaxy it stores a list containing a string with an unrecognized tool id error message.

get_name()[source]
get_runtime_input_dicts(step_annotation)[source]

Get runtime inputs (inputs and parameters) as simple dictionary.

get_runtime_inputs()[source]

Used internally by modules and when displaying inputs in workflow editor and run workflow templates.

Note: The ToolModule doesn’t implement this and these templates contain specialized logic for dealing with the tool and state directly in the case of ToolModules.

get_state()[source]

Return a serializable representation of the persistable state of the step - for tools it DefaultToolState.encode returns a string and for simpler module types a json description is dumped out.

get_tool_id()[source]
get_tooltip(static_path='')[source]
get_type()[source]
classmethod new(Class, trans, tool_id=None)[source]

Create a new instance of the module with default state

recover_mapping(step, step_invocations, progress)[source]

Re-populate progress object with information about connections from previously executed steps recorded via step_invocations.

save_to_step(step)[source]
update_state(incoming)[source]

Update the current state of the module against the user supplied parameters in the dict-like object incoming.

class galaxy.workflow.modules.WorkflowModuleFactory(module_types)[source]

Bases: object

from_dict(trans, d, **kwargs)[source]

Return module initialized from the data in dictionary d.

from_workflow_step(trans, step)[source]

Return module initializd from the WorkflowStep object step.

new(trans, type, tool_id=None)[source]

Return module for type and (optional) tool_id intialized with new / default state.

class galaxy.workflow.modules.WorkflowModuleInjector(trans)[source]

Bases: object

Injects workflow step objects from the ORM with appropriate module and module generated/influenced state.

inject(step, step_args=None, source='html')[source]

Pre-condition: step is an ORM object coming from the database, if supplied step_args is the representation of the inputs for that step supplied via web form.

Post-condition: The supplied step has new non-persistent attributes useful during workflow invocation. These include ‘upgrade_messages’, ‘state’, ‘input_connections_by_name’, and ‘module’.

If step_args is provided from a web form this is applied to generate ‘state’ else it is just obtained from the database.

galaxy.workflow.modules.is_tool_module_type(module_type)[source]
galaxy.workflow.modules.load_module_sections(trans)[source]

Get abstract description of the workflow modules this Galaxy instance is configured with.

galaxy.workflow.modules.populate_module_and_state(trans, workflow, param_map)[source]

Used by API but not web controller, walks through a workflow’s steps and populates transient module and state attributes on each.

galaxy_utils Package

Subpackages
sequence Package
fasta Module
class galaxy_utils.sequence.fasta.fastaNamedReader(fh)[source]

Bases: object

close()[source]
get(sequence_id)[source]
has_data()[source]
class galaxy_utils.sequence.fasta.fastaReader(fh)[source]

Bases: object

close()[source]
next()[source]
class galaxy_utils.sequence.fasta.fastaSequence[source]

Bases: object

class galaxy_utils.sequence.fasta.fastaWriter(fh)[source]

Bases: object

close()[source]
write(fastq_read)[source]
fastq Module
class galaxy_utils.sequence.fastq.ReadlineCountFile(f)[source]

Bases: object

readline(*args, **kwds)[source]
class galaxy_utils.sequence.fastq.fastqAggregator[source]

Bases: object

VALID_FORMATS = ['solexa', 'sanger', 'cssanger', 'illumina']
consume_read(fastq_read)[source]
get_ascii_range()[source]
get_base_counts_for_column(column)[source]
get_decimal_range()[source]
get_length_counts()[source]
get_max_read_length()[source]
get_read_count()[source]
get_read_count_for_column(column)[source]
get_score_at_position_for_column(column, position)[source]
get_score_list_for_column(column)[source]
get_score_max_for_column(column)[source]
get_score_min_for_column(column)[source]
get_score_sum_for_column(column)[source]
get_summary_statistics_for_column(i)[source]
get_valid_formats(check_list=None)[source]
class galaxy_utils.sequence.fastq.fastqCSSangerRead[source]

Bases: galaxy_utils.sequence.fastq.fastqSequencingRead

apply_galaxy_conventions()[source]
ascii_max = 126
ascii_min = 33
assert_sequence_quality_lengths()[source]
change_adapter(new_adapter, clone=True)[source]
complement(clone=True)[source]
format = 'cssanger'
get_sequence()[source]
has_adapter_base()[source]
insufficient_quality_length()[source]
quality_max = 93
quality_min = 0
reverse(clone=True)[source]
score_system = 'phred'
sequence_space = 'color'
valid_sequence_list = ['0', '1', '2', '3', '4', '5', '6', '.']
class galaxy_utils.sequence.fastq.fastqCombiner(format)[source]

Bases: object

combine(fasta_seq, quality_seq)[source]
class galaxy_utils.sequence.fastq.fastqFakeFastaScoreReader(format='sanger', quality_encoding=None)[source]

Bases: object

close()[source]
get(sequence)[source]
has_data()[source]
class galaxy_utils.sequence.fastq.fastqIlluminaRead[source]

Bases: galaxy_utils.sequence.fastq.fastqSequencingRead

ascii_max = 126
ascii_min = 64
format = 'illumina'
quality_max = 62
quality_min = 0
score_system = 'phred'
sequence_space = 'base'
class galaxy_utils.sequence.fastq.fastqJoiner(format, force_quality_encoding=None)[source]

Bases: object

get_paired_identifier(fastq_read)[source]
is_first_mate(sequence_id)[source]
join(read1, read2)[source]
class galaxy_utils.sequence.fastq.fastqNamedReader(fh, format='sanger', apply_galaxy_conventions=False)[source]

Bases: object

close()[source]
get(sequence_identifier)[source]
has_data()[source]
class galaxy_utils.sequence.fastq.fastqReader(fh, format='sanger', apply_galaxy_conventions=False)[source]

Bases: object

close()[source]
next()[source]
class galaxy_utils.sequence.fastq.fastqSangerRead[source]

Bases: galaxy_utils.sequence.fastq.fastqSequencingRead

ascii_max = 126
ascii_min = 33
format = 'sanger'
quality_max = 93
quality_min = 0
score_system = 'phred'
sequence_space = 'base'
class galaxy_utils.sequence.fastq.fastqSequencingRead[source]

Bases: galaxy_utils.sequence.sequence.SequencingRead

apply_galaxy_conventions()[source]
ascii_max = 126
ascii_min = 33
assert_sequence_quality_lengths()[source]
classmethod convert_base_to_color_space(sequence)[source]
classmethod convert_color_to_base_space(sequence)[source]
convert_read_to_format(format, force_quality_encoding=None)[source]
classmethod convert_score_phred_to_solexa(decimal_score_list)[source]
classmethod convert_score_solexa_to_phred(decimal_score_list)[source]
format = 'sanger'
get_ascii_quality_scores()[source]
get_ascii_quality_scores_len()[source]

Compute ascii quality score length, without generating relatively expensive qualty score array.

classmethod get_class_by_format(format)[source]
get_decimal_quality_scores()[source]
get_sequence()[source]
insufficient_quality_length()[source]
is_ascii_encoded()[source]
is_valid_format()[source]
is_valid_sequence()[source]
quality_max = 93
quality_min = 0
classmethod restrict_scores_to_valid_range(decimal_score_list)[source]
reverse(clone=True)[source]
score_system = 'phred'
sequence_space = 'base'
slice(left_column_offset, right_column_offset)[source]
classmethod transform_scores_to_valid_range(decimal_score_list)[source]
classmethod transform_scores_to_valid_range_ascii(decimal_score_list)[source]
class galaxy_utils.sequence.fastq.fastqSolexaRead[source]

Bases: galaxy_utils.sequence.fastq.fastqSequencingRead

ascii_max = 126
ascii_min = 59
format = 'solexa'
quality_max = 62
quality_min = -5
score_system = 'solexa'
sequence_space = 'base'
class galaxy_utils.sequence.fastq.fastqSplitter[source]

Bases: object

split(fastq_read)[source]
class galaxy_utils.sequence.fastq.fastqVerboseErrorReader(fh, **kwds)[source]

Bases: galaxy_utils.sequence.fastq.fastqReader

MAX_PRINT_ERROR_BYTES = 1024
next()[source]
class galaxy_utils.sequence.fastq.fastqWriter(fh, format=None, force_quality_encoding=None)[source]

Bases: object

close()[source]
write(fastq_read)[source]
galaxy_utils.sequence.fastq.format

alias of fastqCSSangerRead

sequence Module
class galaxy_utils.sequence.sequence.SequencingRead[source]

Bases: object

append_quality(quality)[source]
append_sequence(sequence)[source]
clone()[source]
color_space_converter = <galaxy_utils.sequence.transform.ColorSpaceConverter object>
complement(clone=True)[source]
is_DNA()[source]
reverse(clone=True)[source]
reverse_complement(clone=True)[source]
sequence_as_DNA(clone=True)[source]
sequence_as_RNA(clone=True)[source]
valid_sequence_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
transform Module
class galaxy_utils.sequence.transform.ColorSpaceConverter(fake_adapter_base='G')[source]

Bases: object

base = 'N'
base_to_color_dict = {'A': {'A': '0', 'C': '1', 'T': '3', 'G': '2', 'N': '4'}, 'C': {'A': '1', 'C': '0', 'T': '2', 'G': '3', 'N': '4'}, 'T': {'A': '3', 'C': '2', 'T': '0', 'G': '1', 'N': '4'}, 'G': {'A': '2', 'C': '3', 'T': '1', 'G': '0', 'N': '4'}, 'N': {'A': '5', 'C': '5', 'T': '5', 'G': '5', 'N': '6'}}
color_dict = {'1': 'N', '0': 'N', '3': 'N', '2': 'N', '5': 'N', '4': 'N', '6': 'N', '.': 'N'}
color_to_base_dict = {'A': {'1': 'C', '0': 'A', '3': 'T', '2': 'G', '5': 'N', '4': 'N', '6': 'N', '.': 'N'}, 'C': {'1': 'A', '0': 'C', '3': 'G', '2': 'T', '5': 'N', '4': 'N', '6': 'N', '.': 'N'}, 'T': {'1': 'G', '0': 'T', '3': 'A', '2': 'C', '5': 'N', '4': 'N', '6': 'N', '.': 'N'}, 'G': {'1': 'T', '0': 'G', '3': 'C', '2': 'A', '5': 'N', '4': 'N', '6': 'N', '.': 'N'}, 'N': {'1': 'N', '0': 'N', '3': 'N', '2': 'N', '5': 'N', '4': 'N', '6': 'N', '.': 'N'}}
key = '.'
to_base_space(sequence)[source]
to_color_space(sequence, adapter_base=None)[source]
unknown_base = 'N'
unknown_color = '.'
value = 'N'
galaxy_utils.sequence.transform.DNA_complement(sequence)[source]
galaxy_utils.sequence.transform.DNA_reverse_complement(sequence)[source]
galaxy_utils.sequence.transform.RNA_complement(sequence)[source]
galaxy_utils.sequence.transform.RNA_reverse_complement(sequence)[source]
galaxy_utils.sequence.transform.reverse(sequence)[source]
galaxy_utils.sequence.transform.to_DNA(sequence)[source]
galaxy_utils.sequence.transform.to_RNA(sequence)[source]
vcf Module
class galaxy_utils.sequence.vcf.Reader(fh)[source]

Bases: object

next()[source]
class galaxy_utils.sequence.vcf.VariantCall(vcf_line, metadata, sample_names)[source]

Bases: object

classmethod get_class_by_format(format)[source]
header_startswith = None
required_header_fields = None
required_header_length = None
version = None
class galaxy_utils.sequence.vcf.VariantCall33(vcf_line, metadata, sample_names)[source]

Bases: galaxy_utils.sequence.vcf.VariantCall

header_startswith = '#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO'
required_header_fields = ['#CHROM', 'POS', 'ID', 'REF', 'ALT', 'QUAL', 'FILTER', 'INFO']
required_header_length = 8
version = 'VCFv3.3'
class galaxy_utils.sequence.vcf.VariantCall40(vcf_line, metadata, sample_names)[source]

Bases: galaxy_utils.sequence.vcf.VariantCall33

version = 'VCFv4.0'
class galaxy_utils.sequence.vcf.VariantCall41(vcf_line, metadata, sample_names)[source]

Bases: galaxy_utils.sequence.vcf.VariantCall40

version = 'VCFv4.1'
galaxy_utils.sequence.vcf.format

alias of VariantCall41

log_tempfile Module

class log_tempfile.TempFile[source]

Bases: object

NamedTemporaryFile(*args, **kwargs)[source]
mkstemp(*args, **kwargs)[source]

mimeparse Module

MIME-Type Parser

This module provides basic functions for handling mime-types. It can handle matching mime-types against a list of media-ranges. See section 14.1 of the HTTP specification [RFC 2616] for a complete explanation.

Contents:
  • parse_mime_type(): Parses a mime-type into its component parts.
  • parse_media_range(): Media-ranges are mime-types with wild-cards and a ‘q’ quality parameter.
  • quality(): Determines the quality (‘q’) of a mime-type when compared against a list of media-ranges.
  • quality_parsed(): Just like quality() except the second parameter must be pre-parsed.
  • best_match(): Choose the mime-type with the highest quality (‘q’) from a list of candidates.
mimeparse.best_match(supported, header)[source]

Takes a list of supported mime-types and finds the best match for all the media-ranges listed in header. The value of header must be a string that conforms to the format of the HTTP Accept: header. The value of ‘supported’ is a list of mime-types.

>>> best_match(['application/xbel+xml', 'text/xml'], 'text/*;q=0.5,*/*; q=0.1')
'text/xml'
mimeparse.fitness_and_quality_parsed(mime_type, parsed_ranges)[source]

Find the best match for a given mime-type against a list of media_ranges that have already been parsed by parse_media_range(). Returns a tuple of the fitness value and the value of the ‘q’ quality parameter of the best match, or (-1, 0) if no match was found. Just as for quality_parsed(), ‘parsed_ranges’ must be a list of parsed media ranges.

mimeparse.parse_media_range(range)[source]

Carves up a media range and returns a tuple of the (type, subtype, params) where ‘params’ is a dictionary of all the parameters for the media range. For example, the media range ‘application/*;q=0.5’ would get parsed into:

In addition this function also guarantees that there is a value for ‘q’ in the params dictionary, filling it in with a proper default if necessary.

mimeparse.parse_mime_type(mime_type)[source]

Carves up a mime-type and returns a tuple of the (type, subtype, params) where ‘params’ is a dictionary of all the parameters for the media range. For example, the media range ‘application/xhtml;q=0.5’ would get parsed into:

(‘application’, ‘xhtml’, {‘q’, ‘0.5’})

mimeparse.quality(mime_type, ranges)[source]

Returns the quality ‘q’ of a mime-type when compared against the media-ranges in ranges. For example:

>>> quality('text/html','text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5')
0.7
mimeparse.quality_parsed(mime_type, parsed_ranges)[source]

Find the best match for a given mime-type against a list of media_ranges that have already been parsed by parse_media_range(). Returns the ‘q’ quality parameter of the best match, 0 if no match was found. This function bahaves the same as quality() except that ‘parsed_ranges’ must be a list of parsed media ranges.

pkg_resources Module

Package resource API

A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with /, not whatever the local path separator is. Do not use os.path operations to manipulate resource names being passed into the API.

The package resource API is designed to work with normal filesystem packages, .egg files, and unpacked .egg files. It can also work in a limited way with .zip files and with custom PEP 302 loaders that support the get_data() method.

pkg_resources.require(req_str)[source]
pkg_resources.get_provider(moduleOrReq)[source]

Return an IResourceProvider for the named module or requirement

pkg_resources.get_distribution(dist)[source]

Return a current distribution object for a Requirement or string

pkg_resources.load_entry_point(dist, group, name)[source]

Return name entry point of group for dist or raise ImportError

pkg_resources.get_entry_map(dist, group=None)[source]

Return the entry point map for group, or the full entry map

pkg_resources.get_entry_info(dist, group, name)[source]

Return the EntryPoint object for group`+`name, or None

pkg_resources.declare_namespace(packageName)[source]

Declare that package ‘packageName’ is a namespace package

pkg_resources.find_distributions(path_item, only=False)[source]

Yield distributions accessible via path_item

pkg_resources.get_default_cache()[source]

Determine the default cache location

This returns the PYTHON_EGG_CACHE environment variable, if set. Otherwise, on Windows, it returns a “Python-Eggs” subdirectory of the “Application Data” directory. On all other systems, it’s “~/.python-eggs”.

class pkg_resources.Environment(search_path=None, platform='linux-x86_64', python='2.7')[source]

Bases: object

Searchable snapshot of distributions on a search path

add(dist)[source]

Add dist if we can_add() it and it isn’t already added

best_match(req, working_set, installer=None)[source]

Find distribution best matching req and usable on working_set

This calls the find(req) method of the working_set to see if a suitable distribution is already active. (This may raise VersionConflict if an unsuitable version of the project is already active in the specified working_set.) If a suitable distribution isn’t active, this method returns the newest distribution in the environment that meets the Requirement in req. If no suitable distribution is found, and installer is supplied, then the result of calling the environment’s obtain(req, installer) method will be returned.

can_add(dist)[source]

Is distribution dist acceptable for this environment?

The distribution must match the platform and python version requirements specified when this environment was created, or False is returned.

obtain(requirement, installer=None)[source]

Obtain a distribution matching requirement (e.g. via download)

Obtain a distro that matches requirement (e.g. via download). In the base Environment class, this routine just returns installer(requirement), unless installer is None, in which case None is returned instead. This method is a hook that allows subclasses to attempt other ways of obtaining a distribution before falling back to the installer argument.

remove(dist)[source]

Remove dist from the environment

scan(search_path=None)[source]

Scan search_path for distributions usable in this environment

Any distributions found are added to the environment. search_path should be a sequence of sys.path items. If not supplied, sys.path is used. Only distributions conforming to the platform/python version defined at initialization are added.

class pkg_resources.WorkingSet(entries=None)[source]

Bases: object

A collection of active distributions on sys.path (or a similar list)

add(dist, entry=None, insert=True)[source]

Add dist to working set, associated with entry

If entry is unspecified, it defaults to the .location of dist. On exit from this routine, entry is added to the end of the working set’s .entries (if it wasn’t already present).

dist is only added to the working set if it’s for a project that doesn’t already have a distribution in the set. If it’s added, any callbacks registered with the subscribe() method will be called.

add_entry(entry)[source]

Add a path item to .entries, finding any distributions on it

find_distributions(entry, True) is used to find distributions corresponding to the path entry, and they are added. entry is always appended to .entries, even if it is already present. (This is because sys.path can contain the same value more than once, and the .entries of the sys.path WorkingSet should always equal sys.path.)

find(req)[source]

Find a distribution matching requirement req

If there is an active distribution for the requested project, this returns it as long as it meets the version requirement specified by req. But, if there is an active distribution for the project and it does not meet the req requirement, VersionConflict is raised. If there is no active distribution for the requested project, None is returned.

find_plugins(plugin_env, full_env=None, installer=None, fallback=True)[source]

Find all activatable distributions in plugin_env

Example usage:

distributions, errors = working_set.find_plugins(
    Environment(plugin_dirlist)
)
map(working_set.add, distributions)  # add plugins+libs to sys.path
print 'Could not load', errors        # display errors

The plugin_env should be an Environment instance that contains only distributions that are in the project’s “plugin directory” or directories. The full_env, if supplied, should be an Environment contains all currently-available distributions. If full_env is not supplied, one is created automatically from the WorkingSet this method is called on, which will typically mean that every directory on sys.path will be scanned for distributions.

installer is a standard installer callback as used by the resolve() method. The fallback flag indicates whether we should attempt to resolve older versions of a plugin if the newest version cannot be resolved.

This method returns a 2-tuple: (distributions, error_info), where distributions is a list of the distributions found in plugin_env that were loadable, along with any other distributions that are needed to resolve their dependencies. error_info is a dictionary mapping unloadable plugin distributions to an exception instance describing the error that occurred. Usually this will be a DistributionNotFound or VersionConflict instance.

iter_entry_points(group, name=None)[source]

Yield entry point objects from group matching name

If name is None, yields all entry points in group from all distributions in the working set, otherwise only ones matching both group and name are yielded (in distribution order).

require(*requirements)[source]

Ensure that distributions matching requirements are activated

requirements must be a string or a (possibly-nested) sequence thereof, specifying the distributions and versions required. The return value is a sequence of the distributions that needed to be activated to fulfill the requirements; all relevant distributions are included, even if they were already activated in this working set.

resolve(requirements, env=None, installer=None)[source]

List all distributions needed to (recursively) meet requirements

requirements must be a sequence of Requirement objects. env, if supplied, should be an Environment instance. If not supplied, it defaults to all distributions available within any entry or distribution in the working set. installer, if supplied, will be invoked with each requirement that cannot be met by an already-installed distribution; it should return a Distribution or None.

run_script(requires, script_name)[source]

Locate distribution for requires and run script_name script

subscribe(callback)[source]

Invoke callback for all distributions (including existing ones)

class pkg_resources.ResourceManager[source]

Manage resource extraction and packages

cleanup_resources(force=False)[source]

Delete all extracted resource files and directories, returning a list of the file and directory names that could not be successfully removed. This function does not have any concurrency protection, so it should generally only be called when the extraction path is a temporary directory exclusive to a single process. This method is not automatically called; you must call it explicitly or register it as an atexit function if you wish to ensure cleanup of a temporary directory used for extractions.

extraction_error()[source]

Give an error message for problems extracting file(s)

extraction_path = None
get_cache_path(archive_name, names=())[source]

Return absolute location in cache for archive_name and names

The parent directory of the resulting path will be created if it does not already exist. archive_name should be the base filename of the enclosing egg (which may not be the name of the enclosing zipfile!), including its ”.egg” extension. names, if provided, should be a sequence of path name parts “under” the egg’s extraction location.

This method should only be called by resource providers that need to obtain an extraction location, and only for names they intend to extract, as it tracks the generated names for possible cleanup later.

postprocess(tempname, filename)[source]

Perform any platform-specific postprocessing of tempname

This is where Mac header rewrites should be done; other platforms don’t have anything special they should do.

Resource providers should call this method ONLY after successfully extracting a compressed resource. They must NOT call it on resources that are already in the filesystem.

tempname is the current (temporary) name of the file, and filename is the name it will be renamed to by the caller after this routine returns.

resource_exists(package_or_requirement, resource_name)[source]

Does the named resource exist?

resource_filename(package_or_requirement, resource_name)[source]

Return a true filesystem path for specified resource

resource_isdir(package_or_requirement, resource_name)[source]

Is the named resource an existing directory?

resource_listdir(package_or_requirement, resource_name)[source]

List the contents of the named resource directory

resource_stream(package_or_requirement, resource_name)[source]

Return a readable file-like object for specified resource

resource_string(package_or_requirement, resource_name)[source]

Return specified resource as a string

set_extraction_path(path)[source]

Set the base path where resources will be extracted to, if needed.

If you do not call this routine before any extractions take place, the path defaults to the return value of get_default_cache(). (Which is based on the PYTHON_EGG_CACHE environment variable, with various platform-specific fallbacks. See that routine’s documentation for more details.)

Resources are extracted to subdirectories of this path based upon information given by the IResourceProvider. You may set this to a temporary directory, but then you must call cleanup_resources() to delete the extracted files when done. There is no guarantee that cleanup_resources() will be able to remove all extracted files.

(Note: you may not change the extraction path for a given resource manager once resources have been extracted, unless you first call cleanup_resources().)

class pkg_resources.Distribution(location=None, metadata=None, project_name=None, version=None, py_version='2.7', platform=None, precedence=3)[source]

Bases: object

Wrap an actual or potential sys.path entry w/metadata

PKG_INFO = 'PKG-INFO'
activate(path=None)[source]

Ensure distribution is importable on path (default=sys.path)

as_requirement()[source]

Return a Requirement that matches this distribution exactly

check_version_conflict()[source]
clone(**kw)[source]

Copy this distribution, substituting in any changed keyword args

egg_name()[source]

Return what this distribution’s standard .egg filename should be

extras
classmethod from_filename(filename, metadata=None, **kw)[source]
classmethod from_location(location, basename, metadata=None, **kw)[source]
get_entry_info(group, name)[source]

Return the EntryPoint object for group`+`name, or None

get_entry_map(group=None)[source]

Return the entry point map for group, or the full entry map

has_version()[source]
hashcmp
insert_on(path, loc=None)

Insert self.location in path before its nearest parent directory

key
load_entry_point(group, name)[source]

Return the name entry point of group or raise ImportError

parsed_version
requires(extras=())[source]

List of Requirements needed for this distro if extras are used

version
class pkg_resources.Requirement(project_name, specs, extras)[source]
static parse(s)[source]
class pkg_resources.EntryPoint(name, module_name, attrs=(), extras=(), dist=None)[source]

Bases: object

Object representing an advertised importable object

load(require=True, env=None, installer=None)[source]
classmethod parse(src, dist=None)[source]

Parse a single entry point from string src

Entry point syntax follows the form:

name = some.module:some.attr [extra1,extra2]

The entry name and module name are required, but the :attrs and [extras] parts are optional

classmethod parse_group(group, lines, dist=None)[source]

Parse an entry point group

classmethod parse_map(data, dist=None)[source]

Parse a map of entry point groups

require(env=None, installer=None)[source]
exception pkg_resources.ResolutionError[source]

Bases: exceptions.Exception

Abstract base for dependency resolution errors

exception pkg_resources.VersionConflict[source]

Bases: pkg_resources.ResolutionError

An already-installed version conflicts with the requested version

exception pkg_resources.DistributionNotFound[source]

Bases: pkg_resources.ResolutionError

A requested distribution was not found

exception pkg_resources.UnknownExtra[source]

Bases: pkg_resources.ResolutionError

Distribution doesn’t have an “extra feature” of the given name

exception pkg_resources.ExtractionError[source]

Bases: exceptions.RuntimeError

An error occurred extracting a resource

The following attributes are available from instances of this exception:

manager
The resource manager that raised this exception
cache_path
The base directory for resource extraction
original_error
The exception instance that caused extraction to fail
pkg_resources.parse_requirements(strs)[source]

Yield Requirement objects for each specification in strs

strs must be an instance of basestring, or a (possibly-nested) iterable thereof.

pkg_resources.parse_version(s)[source]

Convert a version string to a chronologically-sortable key

This is a rough cross between distutils’ StrictVersion and LooseVersion; if you give it versions that would work with StrictVersion, then it behaves the same; otherwise it acts like a slightly-smarter LooseVersion. It is possible to create pathological version coding schemes that will fool this parser, but they should be very rare in practice.

The returned value will be a tuple of strings. Numeric portions of the version are padded to 8 digits so they will compare numerically, but without relying on how numbers compare relative to strings. Dots are dropped, but dashes are retained. Trailing zeros between alpha segments or dashes are suppressed, so that e.g. “2.4.0” is considered the same as “2.4”. Alphanumeric parts are lower-cased.

The algorithm assumes that strings like “-” and any alpha string that alphabetically follows “final” represents a “patch level”. So, “2.4-1” is assumed to be a branch or patch of “2.4”, and therefore “2.4.1” is considered newer than “2.4-1”, which in turn is newer than “2.4”.

Strings like “a”, “b”, “c”, “alpha”, “beta”, “candidate” and so on (that come before “final” alphabetically) are assumed to be pre-release versions, so that the version “2.4” is considered newer than “2.4a1”.

Finally, to handle miscellaneous cases, the strings “pre”, “preview”, and “rc” are treated as if they were “c”, i.e. as though they were release candidates, and therefore are not as new as a version string that does not contain them, and “dev” is replaced with an ‘@’ so that it sorts lower than than any other pre-release tag.

pkg_resources.safe_name(name)[source]

Convert an arbitrary string to a standard distribution name

Any runs of non-alphanumeric/. characters are replaced with a single ‘-‘.

pkg_resources.safe_version(version)[source]

Convert an arbitrary string to a standard version string

Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash.

pkg_resources.get_platform()
pkg_resources.compatible_platforms(provided, required)[source]

Can code for the provided platform run on the required platform?

Returns true if either platform is None, or the platforms are equal.

XXX Needs compatibility checks for Linux and other unixy OSes.

pkg_resources.yield_lines(strs)[source]

Yield non-empty/non-comment lines of a basestring or sequence

pkg_resources.split_sections(s)[source]

Split a string or iterable thereof into (section,content) pairs

Each section is a stripped version of the section header (“[section]”) and each content is a list of stripped lines excluding blank lines and comment-only lines. If there are any such lines before the first section header, they’re returned in a first section of None.

pkg_resources.safe_extra(extra)[source]

Convert an arbitrary string to a standard ‘extra’ name

Any runs of non-alphanumeric characters are replaced with a single ‘_’, and the result is always lowercased.

pkg_resources.to_filename(name)[source]

Convert a project or version name to its filename-escaped form

Any ‘-‘ characters are currently replaced with ‘_’.

pkg_resources.invalid_marker(text)[source]

Validate text as a PEP 426 environment marker; return exception or False

pkg_resources.evaluate_marker(text, extra=None, _ops={'not in': <function <lambda> at 0x7f2aaea1fed8>, '==': <built-in function eq>, 304: <function test at 0x7f2aaea1fd70>, 305: <function test at 0x7f2aaea1fd70>, 306: <function and_test at 0x7f2aaea1f668>, 308: <function comparison at 0x7f2aaea1fe60>, 'in': <function <lambda> at 0x7f2aaea1ff50>, '!=': <built-in function ne>, 318: <function atom at 0x7f2aaea1fde8>})[source]

Evaluate a PEP 426 environment marker on CPython 2.4+. Return a boolean indicating the marker result in this environment. Raise SyntaxError if marker is invalid.

This implementation uses the ‘parser’ module, which is not implemented on Jython and has been superseded by the ‘ast’ module in Python 2.6 and later.

pkg_resources.ensure_directory(path)[source]

Ensure that the parent directory of path exists

pkg_resources.normalize_path(filename)[source]

Normalize a file/dir name for comparison purposes

class pkg_resources.IMetadataProvider[source]
get_metadata(name)[source]

The named metadata resource as a string

get_metadata_lines(name)[source]

Yield named metadata resource as list of non-blank non-comment lines

Leading and trailing whitespace is stripped from each line, and lines with # as the first non-blank character are omitted.

has_metadata(name)[source]

Does the package’s distribution contain the named metadata?

metadata_isdir(name)[source]

Is the named metadata a directory? (like os.path.isdir())

metadata_listdir(name)[source]

List of metadata names in the directory (like os.listdir())

run_script(script_name, namespace)[source]

Execute the named script in the supplied namespace dictionary

class pkg_resources.IResourceProvider[source]

Bases: pkg_resources.IMetadataProvider

An object that provides access to package resources

get_resource_filename(manager, resource_name)[source]

Return a true filesystem path for resource_name

manager must be an IResourceManager

get_resource_stream(manager, resource_name)[source]

Return a readable file-like object for resource_name

manager must be an IResourceManager

get_resource_string(manager, resource_name)[source]

Return a string containing the contents of resource_name

manager must be an IResourceManager

has_resource(resource_name)[source]

Does the package contain the named resource?

resource_isdir(resource_name)[source]

Is the named resource a directory? (like os.path.isdir())

resource_listdir(resource_name)[source]

List of resource names in the directory (like os.listdir())

class pkg_resources.FileMetadata(path)[source]

Bases: pkg_resources.EmptyProvider

Metadata handler for standalone PKG-INFO files

Usage:

metadata = FileMetadata("/path/to/PKG-INFO")

This provider rejects all data and metadata requests except for PKG-INFO, which is treated as existing, and will be the contents of the file at the provided location.

get_metadata(name)[source]
get_metadata_lines(name)[source]
has_metadata(name)[source]
class pkg_resources.PathMetadata(path, egg_info)[source]

Bases: pkg_resources.DefaultProvider

Metadata provider for egg directories

Usage:

# Development eggs:

egg_info = "/path/to/PackageName.egg-info"
base_dir = os.path.dirname(egg_info)
metadata = PathMetadata(base_dir, egg_info)
dist_name = os.path.splitext(os.path.basename(egg_info))[0]
dist = Distribution(basedir,project_name=dist_name,metadata=metadata)

# Unpacked egg directories:

egg_path = "/path/to/PackageName-ver-pyver-etc.egg"
metadata = PathMetadata(egg_path, os.path.join(egg_path,'EGG-INFO'))
dist = Distribution.from_filename(egg_path, metadata=metadata)
class pkg_resources.EggMetadata(importer)[source]

Bases: pkg_resources.ZipProvider

Metadata provider for .egg files

class pkg_resources.EmptyProvider[source]

Bases: pkg_resources.NullProvider

Provider that returns nothing for all requests

module_path = None
class pkg_resources.NullProvider(module)[source]

Try to implement resources and metadata for arbitrary PEP 302 loaders

egg_info = None
egg_name = None
get_metadata(name)[source]
get_metadata_lines(name)[source]
get_resource_filename(manager, resource_name)[source]
get_resource_stream(manager, resource_name)[source]
get_resource_string(manager, resource_name)[source]
has_metadata(name)[source]
has_resource(resource_name)[source]
loader = None
metadata_isdir(name)[source]
metadata_listdir(name)[source]
resource_isdir(resource_name)[source]
resource_listdir(resource_name)[source]
run_script(script_name, namespace)[source]
class pkg_resources.EggProvider(module)[source]

Bases: pkg_resources.NullProvider

Provider based on a virtual filesystem

class pkg_resources.DefaultProvider(module)[source]

Bases: pkg_resources.EggProvider

Provides access to package resources in the filesystem

get_resource_stream(manager, resource_name)[source]
class pkg_resources.ZipProvider(module)[source]

Bases: pkg_resources.EggProvider

Resource support for zips and eggs

eagers = None
get_resource_filename(manager, resource_name)[source]
pkg_resources.register_finder(importer_type, distribution_finder)[source]

Register distribution_finder to find distributions in sys.path items

importer_type is the type or class of a PEP 302 “Importer” (sys.path item handler), and distribution_finder is a callable that, passed a path item and the importer instance, yields Distribution instances found on that path item. See pkg_resources.find_on_path for an example.

pkg_resources.register_namespace_handler(importer_type, namespace_handler)[source]

Register namespace_handler to declare namespace packages

importer_type is the type or class of a PEP 302 “Importer” (sys.path item handler), and namespace_handler is a callable like this:

def namespace_handler(importer,path_entry,moduleName,module):
    # return a path_entry to use for child packages

Namespace handlers are only called if the importer object has already agreed that it can handle the relevant path item, and they should only return a subpath if the module __path__ does not already contain an equivalent subpath. For an example namespace handler, see pkg_resources.file_ns_handler.

pkg_resources.register_loader_type(loader_type, provider_factory)[source]

Register provider_factory to make providers for loader_type

loader_type is the type or class of a PEP 302 module.__loader__, and provider_factory is a function that, passed a module object, returns an IResourceProvider for that module.

pkg_resources.fixup_namespace_packages(path_item, parent=None)[source]

Ensure that previously-declared namespace packages include path_item

pkg_resources.get_importer(path_item)[source]

Retrieve a PEP 302 importer for the given path item

The returned importer is cached in sys.path_importer_cache if it was newly created by a path hook.

If there is no importer, a wrapper around the basic import machinery is returned. This wrapper is never inserted into the importer cache (None is inserted instead).

The cache (or part of it) can be cleared manually if a rescan of sys.path_hooks is necessary.

pkg_resources.AvailableDistributions

alias of Environment

psyco_full Module

Attempt to call psyco.full, but ignore any errors.

Releases

May 2015 Galaxy Release (v 15.05)

Get the Galaxy Release Your Way
Highlights
Authentication Plugins
Galaxy now has native support for LDAP and Active Directory via a new community developed authentication plugin system.
Tool Sections
Tool parameters may now be groupped into collapsable sections.
Collection Creators
New widgets have been added that allow much more flexibility when creating simple dataset pair and list collections.
Github
New
% git clone -b master https://github.com/galaxyproject/galaxy.git
Update to latest stable release
% git checkout master && pull --ff-only origin master
Update to exact version
% git checkout v15.05
BitBucket
Upgrade
% hg pull
% hg update latest_15.05

See our wiki for additional details regarding the source code locations.

Release Notes
Enhancements
Fixes
  • During the 15.05 development cycle dozens of fixes were pushed to the release_15.03 branch of Galaxy. These are all included in 15.05 and summarized here (with special thanks to Björn Grüning and Marius van den Beek).
  • Fix race condition that would occasionally prevent Galaxy from starting properly. Pull Request 198, Trello
  • Fix scatter plot API communications for certain proxied Galaxy instances - thanks to @yhoogstrate. Pull Request 89
  • Fix bug in collectl job metrics plugin - thanks to Carrie Ganote. Pull Request 231
  • Fix late validation of tool parameters. Pull Request 115
  • Fix fasta_to_tabular_converter.py (for implicit conversion) - thanks to Peter Cock. Pull Request 11
  • Fix to eliminate race condition by collecting extra files before declaring dataset’s OK. Pull Request 48
  • Fix setting current history for certain proxied Galaxy instances - thanks to @wezen. 6946e46.
  • Fix typo in tool failure testing example - thanks to Peter Cock. Pull Request 18.
  • Fix Galaxy to default to using SSL for communicating with Tool Sheds. 0b037a2
  • Fix data source tools to open in _top window. Pull Request 17
  • Fix to fallback to name for tool parameters without labels. Pull Request 189, Trello
  • Fix to remove redundant version ids in tool version selector. Pull Request 244
  • Fix for downloading metadata files. Pull Request 234
  • Fix for history failing to render if it contains more exotic dataset collection types. Pull Request 196
  • Fixes for BaseURLToolParameter. Pull Request 247
  • Fix to suppress pysam binary incompatibility warning when using datatypes in binary.py. Pull Request 252
  • Fix for library UI duplication bug. Pull Request 179
  • Fix for Backbone.js loading as AMD. 4e5218f
  • Other small Tool Shed fixes. 815f86f, 76e0915
  • Fix file closing in lped_to_pbed_converter. 182b67f
  • Fix undefined variables in Tool Shed add_repository_entry API script. 47e6f08
  • Fix user registration to respect use_panels when in the Galaxy app. 7ac8631, Trello
  • Fix bug in scramble exception, incorrect reference to source_path 79d50d8
  • Fix error handling in pbed_to_lped. 7aecd7a
  • Fix error handling in Tool Shed step handler for chmod action. 1454396
  • Fix __safe_string_wrapper in tool evaluation object_wrapper. ab6f13e
  • Fixes for data types and data providers. c1d2d1f, 8da70bb, 0b83b1e
  • Fixes for Tool Shed commit and mercurial handling modules. 6102edf, b639bc0, debea9d
  • Fix to clean working directory during job re-submission. Pull Request 236
  • Fix bug when task splitting jobs fail. Pull Request 214
  • Fix some minor typos in comment docs in config/galaxy.ini.sample. Pull Request 210
  • Fix admin disk usage message. Pull Request 205, Trello
  • Fix to sessionStorage Model to suppress QUOTA DOMExceptions when Safari users are in private browsing mode. 0c94f04

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

March 2015 Galaxy Release (v 15.03)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

January 2015 Galaxy Release (v 15.01)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

October 2014 Galaxy Release (v 14.10)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

August 2014 Galaxy Release (v 14.08)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

June 2014 Galaxy Release (v 14.06)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

April 2014 Galaxy Release (v 14.04)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

February 2014 Galaxy Release (v 14.02)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

November 2013 Galaxy Release (v 13.11)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

August 2013 Galaxy Release (v 13.08)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

June 2013 Galaxy Release (v 13.06)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

April 2013 Galaxy Release (v 13.04)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

February 2013 Galaxy Release (v 13.02)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

January 2013 Galaxy Release (v 13.01)

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

Galaxy Releases older than v 13.01

Get the Galaxy Release Your Way

Please see the Galaxy wiki for announcement and release notes.

To stay up to date with Galaxy’s progress watch our screencasts, read our wiki, and follow @galaxyproject on Twitter.

Thanks for using Galaxy!

The Galaxy Team

Indices and tables