.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BIOBLEND" "1" "Jan 06, 2024" "1.2.0" "BioBlend" .SH NAME bioblend \- BioBlend Documentation .SH ABOUT .sp \fI\%BioBlend\fP is a Python library for interacting with the \fI\%Galaxy\fP API. .sp BioBlend is supported and tested on: .INDENT 0.0 .IP \(bu 2 Python 3.7 \- 3.11 .IP \(bu 2 Galaxy release 19.05 and later. .UNINDENT .sp BioBlend\(aqs goal is to make it easier to script and automate the running of Galaxy analyses and administering of a Galaxy server. In practice, it makes it possible to do things like this: .INDENT 0.0 .IP \(bu 2 Interact with Galaxy via a straightforward API: .INDENT 2.0 .INDENT 3.5 .sp .EX from bioblend.galaxy import GalaxyInstance gi = GalaxyInstance(\(aq\(aq, key=\(aqyour API key\(aq) libs = gi.libraries.get_libraries() gi.workflows.show_workflow(\(aqworkflow ID\(aq) wf_invocation = gi.workflows.invoke_workflow(\(aqworkflow ID\(aq, inputs) .EE .UNINDENT .UNINDENT .IP \(bu 2 Interact with Galaxy via an object\-oriented API: .INDENT 2.0 .INDENT 3.5 .sp .EX from bioblend.galaxy.objects import GalaxyInstance gi = GalaxyInstance(\(dqURL\(dq, \(dqAPI_KEY\(dq) wf = gi.workflows.list()[0] hist = gi.histories.list()[0] inputs = hist.get_datasets()[:2] input_map = dict(zip(wf.input_labels, inputs)) params = {\(dqPaste1\(dq: {\(dqdelimiter\(dq: \(dqU\(dq}} wf_invocation = wf.invoke(input_map, params=params) .EE .UNINDENT .UNINDENT .UNINDENT .SS About the library name .sp The library was originally called just \fBBlend\fP but we \fI\%renamed it\fP to reflect more of its domain and a make it bit more unique so it can be easier to find. The name was intended to be short and easily pronounceable. In its original implementation, the goal was to provide a lot more support for \fI\%CloudMan\fP and other integration capabilities, allowing them to be \fIblended\fP together via code. \fBBioBlend\fP fitted the bill. .SH INSTALLATION .sp Stable releases of BioBlend are best installed via \fBpip\fP from PyPI: .INDENT 0.0 .INDENT 3.5 .sp .EX $ python3 \-m pip install bioblend .EE .UNINDENT .UNINDENT .sp Alternatively, the most current source code from our \fI\%Git repository\fP can be installed with: .INDENT 0.0 .INDENT 3.5 .sp .EX $ python3 \-m pip install git+https://github.com/galaxyproject/bioblend .EE .UNINDENT .UNINDENT .sp After installing the library, you will be able to simply import it into your Python environment with \fBimport bioblend\fP\&. For details on the available functionality, see the \fI\%API documentation\fP\&. .sp BioBlend requires a number of Python libraries. These libraries are installed automatically when BioBlend itself is installed, regardless whether it is installed via \fI\%PyPi\fP or by running \fBpython3 setup.py install\fP command. The current list of required libraries is always available from \fI\%setup.py\fP in the source code repository. .sp If you also want to run tests locally, some extra libraries are required. To install them, run: .INDENT 0.0 .INDENT 3.5 .sp .EX $ python3 setup.py test .EE .UNINDENT .UNINDENT .SH USAGE .sp To get started using BioBlend, install the library as described above. Once the library becomes available on the given system, it can be developed against. The developed scripts do not need to reside in any particular location on the system. .sp It is probably best to take a look at the example scripts in \fBdocs/examples\fP source directory and browse the \fI\%API documentation\fP\&. Beyond that, it\(aqs up to your creativity :). .SH DEVELOPMENT .sp Anyone interested in contributing or tweaking the library is more then welcome to do so. To start, simply fork the \fI\%Git repository\fP on Github and start playing with it. Then, issue pull requests. .SH API DOCUMENTATION .sp BioBlend\(aqs API focuses around and matches the services it wraps. Thus, there are two top\-level sets of APIs, each corresponding to a separate service and a corresponding step in the automation process. \fINote\fP that each of the service APIs can be used completely independently of one another. .sp Effort has been made to keep the structure and naming of those API\(aqs consistent across the library but because they do bridge different services, some discrepancies may exist. Feel free to point those out and/or provide fixes. .sp For Galaxy, an alternative \fI\%object\-oriented API\fP is also available. This API provides an explicit modeling of server\-side Galaxy instances and their relationships, providing higher\-level methods to perform operations such as retrieving all datasets for a given history, etc. Note that, at the moment, the oo API is still incomplete, providing access to a more restricted set of Galaxy modules with respect to the standard one. .SS Galaxy API .sp API used to manipulate genomic analyses within Galaxy, including data management and workflow execution. .SS API documentation for interacting with Galaxy .SS GalaxyInstance .sp .ce ---- .ce 0 .sp .SS Config .sp Contains possible interaction dealing with Galaxy configuration. .INDENT 0.0 .TP .B class bioblend.galaxy.config.ConfigClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B get_config() -> dict Get a list of attributes about the Galaxy instance. More attributes will be present if the user is an admin. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of attributes. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqallow_library_path_paste\(aq: False, \(aqallow_user_creation\(aq: True, \(aqallow_user_dataset_purge\(aq: True, \(aqallow_user_deletion\(aq: False, \(aqenable_unique_workflow_defaults\(aq: False, \(aqftp_upload_dir\(aq: \(aq/SOMEWHERE/galaxy/ftp_dir\(aq, \(aqftp_upload_site\(aq: \(aqgalaxy.com\(aq, \(aqlibrary_import_dir\(aq: \(aqNone\(aq, \(aqlogo_url\(aq: None, \(aqsupport_url\(aq: \(aqhttps://galaxyproject.org/support\(aq, \(aqterms_url\(aq: None, \(aquser_library_import_dir\(aq: None, \(aqwiki_url\(aq: \(aqhttps://galaxyproject.org/\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_version() -> dict Get the current version of the Galaxy instance. .INDENT 7.0 .TP .B Return type dict .TP .B Returns Version of the Galaxy instance For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqextra\(aq: {}, \(aqversion_major\(aq: \(aq17.01\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqconfiguration\(aq .UNINDENT .INDENT 7.0 .TP .B reload_toolbox() -> None Reload the Galaxy toolbox (but not individual tools) .INDENT 7.0 .TP .B Return type None .TP .B Returns None .UNINDENT .UNINDENT .INDENT 7.0 .TP .B whoami() -> dict Return information about the current authenticated user. .INDENT 7.0 .TP .B Return type dict .TP .B Returns Information about current authenticated user For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqactive\(aq: True, \(aqdeleted\(aq: False, \(aqemail\(aq: \(aquser@example.org\(aq, \(aqid\(aq: \(aq4aaaaa85aacc9caa\(aq, \(aqlast_password_change\(aq: \(aq2021\-07\-29T05:34:54.632345\(aq, \(aqmodel_class\(aq: \(aqUser\(aq, \(aqusername\(aq: \(aqjulia\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Datasets .sp Contains possible interactions with the Galaxy Datasets .INDENT 0.0 .TP .B class bioblend.galaxy.datasets.DatasetClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B download_dataset(dataset_id: str, file_path: None = None, use_default_filename: bool = True, require_ok_state: bool = True, maxwait: float = 12000) -> bytes .TP .B download_dataset(dataset_id: str, file_path: str, use_default_filename: bool = True, require_ok_state: bool = True, maxwait: float = 12000) -> str Download a dataset to file or in memory. If the dataset state is not \(aqok\(aq, a \fBDatasetStateException\fP will be thrown, unless \fBrequire_ok_state=False\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- If this argument is provided, the dataset will be streamed to disk at that path (should be a directory if \fBuse_default_filename=True\fP). If the file_path argument is not provided, the dataset content is loaded into memory and returned by the method (Memory consumption may be heavy as the entire file will be in memory). .IP \(bu 2 \fBuse_default_filename\fP (\fIbool\fP) \-\- If \fBTrue\fP, the exported file will be saved as \fBfile_path/%s\fP, where \fB%s\fP is the dataset name. If \fBFalse\fP, \fBfile_path\fP is assumed to contain the full file path including the filename. .IP \(bu 2 \fBrequire_ok_state\fP (\fIbool\fP) \-\- If \fBFalse\fP, datasets will be downloaded even if not in an \(aqok\(aq state, issuing a \fBDatasetStateWarning\fP rather than raising a \fBDatasetStateException\fP\&. .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the dataset state to become terminal. If the dataset state is not terminal within this time, a \fBDatasetTimeoutException\fP will be thrown. .UNINDENT .TP .B Return type bytes or str .TP .B Returns If a \fBfile_path\fP argument is not provided, returns the file content. Otherwise returns the local path of the downloaded file. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_datasets(limit: int = 500, offset: int = 0, name: str | None = None, extension: str | List[str] | None = None, state: str | List[str] | None = None, visible: bool | None = None, deleted: bool | None = None, purged: bool | None = None, tool_id: str | None = None, tag: str | None = None, history_id: str | None = None, create_time_min: str | None = None, create_time_max: str | None = None, update_time_min: str | None = None, update_time_max: str | None = None, order: str = \(aqcreate_time\-dsc\(aq) -> List[Dict[str, Any]] Get the latest datasets, or select another subset by specifying optional arguments for filtering (e.g. a history ID). .sp Since the number of datasets may be very large, \fBlimit\fP and \fBoffset\fP parameters are required to specify the desired range. .sp If the user is an admin, this will return datasets for all the users, otherwise only for the current user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlimit\fP (\fIint\fP) \-\- Maximum number of datasets to return. .IP \(bu 2 \fBoffset\fP (\fIint\fP) \-\- Return datasets starting from this specified position. For example, if \fBlimit\fP is set to 100 and \fBoffset\fP to 200, datasets 200\-299 will be returned. .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Dataset name to filter on. .IP \(bu 2 \fBextension\fP (\fIstr\fP\fI or \fP\fIlist\fP\fI of \fP\fIstr\fP) \-\- Dataset extension (or list of extensions) to filter on. .IP \(bu 2 \fBstate\fP (\fIstr\fP\fI or \fP\fIlist\fP\fI of \fP\fIstr\fP) \-\- Dataset state (or list of states) to filter on. .IP \(bu 2 \fBvisible\fP (\fIbool\fP) \-\- Optionally filter datasets by their \fBvisible\fP attribute. .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Optionally filter datasets by their \fBdeleted\fP attribute. .IP \(bu 2 \fBpurged\fP (\fIbool\fP) \-\- Optionally filter datasets by their \fBpurged\fP attribute. .IP \(bu 2 \fBtool_id\fP (\fIstr\fP) \-\- Tool ID to filter on. .IP \(bu 2 \fBtag\fP (\fIstr\fP) \-\- Dataset tag to filter on. .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID to filter on. .IP \(bu 2 \fBcreate_time_min\fP (\fIstr\fP) \-\- Show only datasets created after the provided time and date, which should be formatted as \fBYYYY\-MM\-DDTHH\-MM\-SS\fP\&. .IP \(bu 2 \fBcreate_time_max\fP (\fIstr\fP) \-\- Show only datasets created before the provided time and date, which should be formatted as \fBYYYY\-MM\-DDTHH\-MM\-SS\fP\&. .IP \(bu 2 \fBupdate_time_min\fP (\fIstr\fP) \-\- Show only datasets last updated after the provided time and date, which should be formatted as \fBYYYY\-MM\-DDTHH\-MM\-SS\fP\&. .IP \(bu 2 \fBupdate_time_max\fP (\fIstr\fP) \-\- Show only datasets last updated before the provided time and date, which should be formatted as \fBYYYY\-MM\-DDTHH\-MM\-SS\fP\&. .IP \(bu 2 \fBorder\fP (\fIstr\fP) \-\- One or more of the following attributes for ordering datasets: \fBcreate_time\fP (default), \fBextension\fP, \fBhid\fP, \fBhistory_id\fP, \fBname\fP, \fBupdate_time\fP\&. Optionally, \fB\-asc\fP or \fB\-dsc\fP (default) can be appended for ascending and descending order respectively. Multiple attributes can be stacked as a comma\-separated list of values, e.g. \fBcreate_time\-asc,hid\-dsc\fP\&. .UNINDENT .TP .B Return type list .TP .B Param A list of datasets .UNINDENT .UNINDENT .INDENT 7.0 .TP .B gi: GalaxyInstance .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqdatasets\(aq .UNINDENT .INDENT 7.0 .TP .B publish_dataset(dataset_id: str, published: bool = False) -> Dict[str, Any] Make a dataset publicly available or private. For more fine\-grained control (assigning different permissions to specific roles), use the \fBupdate_permissions()\fP method. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- dataset ID .IP \(bu 2 \fBpublished\fP (\fIbool\fP) \-\- Whether to make the dataset published (\fBTrue\fP) or private (\fBFalse\fP). .UNINDENT .TP .B Return type dict .TP .B Returns Details of the updated dataset .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 19.05 or later. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset(dataset_id: str, deleted: bool = False, hda_ldda: Literal[\(aqhda\(aq, \(aqldda\(aq] = \(aqhda\(aq) -> Dict[str, Any] Get details about a given dataset. This can be a history or a library dataset. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Whether to return results for a deleted dataset .IP \(bu 2 \fBhda_ldda\fP (\fIstr\fP) \-\- Whether to show a history dataset (\(aqhda\(aq \- the default) or library dataset (\(aqldda\(aq). .UNINDENT .TP .B Return type dict .TP .B Returns Information about the HDA or LDDA .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_permissions(dataset_id: str, access_ids: list | None = None, manage_ids: list | None = None, modify_ids: list | None = None) -> dict Set access, manage or modify permissions for a dataset to a list of roles. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- dataset ID .IP \(bu 2 \fBaccess_ids\fP (\fIlist\fP) \-\- role IDs which should have access permissions for the dataset. .IP \(bu 2 \fBmanage_ids\fP (\fIlist\fP) \-\- role IDs which should have manage permissions for the dataset. .IP \(bu 2 \fBmodify_ids\fP (\fIlist\fP) \-\- role IDs which should have modify permissions for the dataset. .UNINDENT .TP .B Return type dict .TP .B Returns Current roles for all available permission types. .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 19.05 or later. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B wait_for_dataset(dataset_id: str, maxwait: float = 12000, interval: float = 3, check: bool = True) -> Dict[str, Any] Wait until a dataset is in a terminal state. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- dataset ID .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the dataset state to become terminal. If the dataset state is not terminal within this time, a \fBDatasetTimeoutException\fP will be raised. .IP \(bu 2 \fBinterval\fP (\fIfloat\fP) \-\- Time (in seconds) to wait between 2 consecutive checks. .IP \(bu 2 \fBcheck\fP (\fIbool\fP) \-\- Whether to check if the dataset terminal state is \(aqok\(aq. .UNINDENT .TP .B Return type dict .TP .B Returns Details of the given dataset. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception bioblend.galaxy.datasets.DatasetStateException .UNINDENT .INDENT 0.0 .TP .B exception bioblend.galaxy.datasets.DatasetStateWarning .UNINDENT .INDENT 0.0 .TP .B exception bioblend.galaxy.datasets.DatasetTimeoutException .UNINDENT .sp .ce ---- .ce 0 .sp .SS Dataset collections .INDENT 0.0 .TP .B class bioblend.galaxy.dataset_collections.CollectionDescription(name: str, type: str = \(aqlist\(aq, elements: List[\fI\%CollectionElement\fP | SimpleElement] | Dict[str, Any] | None = None) .INDENT 7.0 .TP .B to_dict() -> Dict[str, str | List] .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.dataset_collections.CollectionElement(name: str, type: str = \(aqlist\(aq, elements: List[\fI\%CollectionElement\fP | SimpleElement] | Dict[str, Any] | None = None) .INDENT 7.0 .TP .B to_dict() -> Dict[str, str | List] .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.dataset_collections.DatasetCollectionClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B download_dataset_collection(dataset_collection_id: str, file_path: str) -> Dict[str, Any] Download a history dataset collection as an archive. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_collection_id\fP (\fIstr\fP) \-\- Encoded dataset collection ID .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- The path to which the archive will be downloaded .UNINDENT .TP .B Return type dict .TP .B Returns Information about the downloaded archive. .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method downloads a \fBzip\fP archive for Galaxy 21.01 and later. For earlier versions of Galaxy this method downloads a \fBtgz\fP archive. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B gi: GalaxyInstance .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqdataset_collections\(aq .UNINDENT .INDENT 7.0 .TP .B show_dataset_collection(dataset_collection_id: str, instance_type: str = \(aqhistory\(aq) -> Dict[str, Any] Get details of a given dataset collection of the current user .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_collection_id\fP (\fIstr\fP) \-\- dataset collection ID .IP \(bu 2 \fBinstance_type\fP (\fIstr\fP) \-\- instance type of the collection \- \(aqhistory\(aq or \(aqlibrary\(aq .UNINDENT .TP .B Return type dict .TP .B Returns element view of the dataset collection .UNINDENT .UNINDENT .INDENT 7.0 .TP .B wait_for_dataset_collection(dataset_collection_id: str, maxwait: float = 12000, interval: float = 3, proportion_complete: float = 1.0, check: bool = True) -> Dict[str, Any] Wait until all or a specified proportion of elements of a dataset collection are in a terminal state. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_collection_id\fP (\fIstr\fP) \-\- dataset collection ID .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the dataset states in the dataset collection to become terminal. If not all datasets are in a terminal state within this time, a \fBDatasetCollectionTimeoutException\fP will be raised. .IP \(bu 2 \fBinterval\fP (\fIfloat\fP) \-\- Time (in seconds) to wait between two consecutive checks. .IP \(bu 2 \fBproportion_complete\fP (\fIfloat\fP) \-\- Proportion of elements in this collection that have to be in a terminal state for this method to return. Must be a number between 0 and 1. For example: if the dataset collection contains 2 elements, and proportion_complete=0.5 is specified, then wait_for_dataset_collection will return as soon as 1 of the 2 datasets is in a terminal state. Default is 1, i.e. all elements must complete. .IP \(bu 2 \fBcheck\fP (\fIbool\fP) \-\- Whether to check if all the terminal states of datasets in the dataset collection are \(aqok\(aq. This will raise an Exception if a dataset is in a terminal state other than \(aqok\(aq. .UNINDENT .TP .B Return type dict .TP .B Returns Details of the given dataset collection. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.dataset_collections.HistoryDatasetCollectionElement(name: str, id: str) .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.dataset_collections.HistoryDatasetElement(name: str, id: str) .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.dataset_collections.LibraryDatasetElement(name: str, id: str) .UNINDENT .sp .ce ---- .ce 0 .sp .SS Datatypes .sp Contains possible interactions with the Galaxy Datatype .INDENT 0.0 .TP .B class bioblend.galaxy.datatypes.DatatypesClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B get_datatypes(extension_only: bool = False, upload_only: bool = False) -> List[str] Get the list of all installed datatypes. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBextension_only\fP (\fIbool\fP) \-\- Return only the extension rather than the datatype name .IP \(bu 2 \fBupload_only\fP (\fIbool\fP) \-\- Whether to return only datatypes which can be uploaded .UNINDENT .TP .B Return type list .TP .B Returns A list of datatype names. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [\(aqsnpmatrix\(aq, \(aqsnptest\(aq, \(aqtabular\(aq, \(aqtaxonomy\(aq, \(aqtwobit\(aq, \(aqtxt\(aq, \(aqvcf\(aq, \(aqwig\(aq, \(aqxgmml\(aq, \(aqxml\(aq] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_sniffers() -> List[str] Get the list of all installed sniffers. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of sniffer names. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [\(aqgalaxy.datatypes.tabular:Vcf\(aq, \(aqgalaxy.datatypes.binary:TwoBit\(aq, \(aqgalaxy.datatypes.binary:Bam\(aq, \(aqgalaxy.datatypes.binary:Sff\(aq, \(aqgalaxy.datatypes.xml:Phyloxml\(aq, \(aqgalaxy.datatypes.xml:GenericXml\(aq, \(aqgalaxy.datatypes.sequence:Maf\(aq, \(aqgalaxy.datatypes.sequence:Lav\(aq, \(aqgalaxy.datatypes.sequence:csFasta\(aq] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqdatatypes\(aq .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Folders .sp Contains possible interactions with the Galaxy library folders .INDENT 0.0 .TP .B class bioblend.galaxy.folders.FoldersClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B create_folder(parent_folder_id: str, name: str, description: str | None = None) -> Dict[str, Any] Create a folder. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBparent_folder_id\fP (\fIstr\fP) \-\- Folder\(aqs description .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- name of the new folder .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- folder\(aqs description .UNINDENT .TP .B Return type dict .TP .B Returns details of the updated folder .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_folder(folder_id: str, undelete: bool = False) -> Dict[str, Any] Marks the folder with the given \fBid\fP as \fIdeleted\fP (or removes the \fIdeleted\fP mark if the \fIundelete\fP param is True). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- the folder\(aqs encoded id, prefixed by \(aqF\(aq .IP \(bu 2 \fBundelete\fP (\fIbool\fP) \-\- If set to True, the folder will be undeleted (i.e. the \fIdeleted\fP mark will be removed) .UNINDENT .TP .B Returns detailed folder information .TP .B Return type dict .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_permissions(folder_id: str, scope: Literal[\(aqcurrent\(aq, \(aqavailable\(aq] = \(aqcurrent\(aq) -> Dict[str, Any] Get the permissions of a folder. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- the folder\(aqs encoded id, prefixed by \(aqF\(aq .IP \(bu 2 \fBscope\fP (\fIstr\fP) \-\- scope of permissions, either \(aqcurrent\(aq or \(aqavailable\(aq .UNINDENT .TP .B Return type dict .TP .B Returns dictionary including details of the folder permissions .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqfolders\(aq .UNINDENT .INDENT 7.0 .TP .B set_permissions(folder_id: str, action: Literal[\(aqset_permissions\(aq] = \(aqset_permissions\(aq, add_ids: List[str] | None = None, manage_ids: List[str] | None = None, modify_ids: List[str] | None = None) -> Dict[str, Any] Set the permissions of a folder. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- the folder\(aqs encoded id, prefixed by \(aqF\(aq .IP \(bu 2 \fBaction\fP (\fIstr\fP) \-\- action to execute, only \(dqset_permissions\(dq is supported. .IP \(bu 2 \fBadd_ids\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- list of role IDs which can add datasets to the folder .IP \(bu 2 \fBmanage_ids\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- list of role IDs which can manage datasets in the folder .IP \(bu 2 \fBmodify_ids\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- list of role IDs which can modify datasets in the folder .UNINDENT .TP .B Return type dict .TP .B Returns dictionary including details of the folder .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_folder(folder_id: str, contents: bool = False) -> Dict[str, Any] Display information about a folder. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- the folder\(aqs encoded id, prefixed by \(aqF\(aq .IP \(bu 2 \fBcontents\fP (\fIbool\fP) \-\- True to get the contents of the folder, rather than just the folder details. .UNINDENT .TP .B Return type dict .TP .B Returns dictionary including details of the folder .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_folder(folder_id: str, name: str, description: str | None = None) -> Dict[str, Any] Update folder information. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- the folder\(aqs encoded id, prefixed by \(aqF\(aq .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- name of the new folder .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- folder\(aqs description .UNINDENT .TP .B Return type dict .TP .B Returns details of the updated folder .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Forms .sp Contains possible interactions with the Galaxy Forms .INDENT 0.0 .TP .B class bioblend.galaxy.forms.FormsClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B create_form(form_xml_text: str) -> List[Dict[str, Any]] Create a new form. .INDENT 7.0 .TP .B Parameters \fBform_xml_text\fP (\fIstr\fP) \-\- Form xml to create a form on galaxy instance .TP .B Return type list of dicts .TP .B Returns List with a single dictionary describing the created form .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_forms() -> List[Dict[str, Any]] Get the list of all forms. .INDENT 7.0 .TP .B Return type list .TP .B Returns Displays a collection (list) of forms. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqid\(aq: \(aqf2db41e1fa331b3e\(aq, \(aqmodel_class\(aq: \(aqFormDefinition\(aq, \(aqname\(aq: \(aqFirst form\(aq, \(aqurl\(aq: \(aq/api/forms/f2db41e1fa331b3e\(aq}, {\(aqid\(aq: \(aqebfb8f50c6abde6d\(aq, \(aqmodel_class\(aq: \(aqFormDefinition\(aq, \(aqname\(aq: \(aqsecond form\(aq, \(aqurl\(aq: \(aq/api/forms/ebfb8f50c6abde6d\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqforms\(aq .UNINDENT .INDENT 7.0 .TP .B show_form(form_id: str) -> Dict[str, Any] Get details of a given form. .INDENT 7.0 .TP .B Parameters \fBform_id\fP (\fIstr\fP) \-\- Encoded form ID .TP .B Return type dict .TP .B Returns A description of the given form. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqdesc\(aq: \(aqhere it is \(aq, \(aqfields\(aq: [], \(aqform_definition_current_id\(aq: \(aqf2db41e1fa331b3e\(aq, \(aqid\(aq: \(aqf2db41e1fa331b3e\(aq, \(aqlayout\(aq: [], \(aqmodel_class\(aq: \(aqFormDefinition\(aq, \(aqname\(aq: \(aqFirst form\(aq, \(aqurl\(aq: \(aq/api/forms/f2db41e1fa331b3e\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS FTP files .sp Contains possible interactions with the Galaxy FTP Files .INDENT 0.0 .TP .B class bioblend.galaxy.ftpfiles.FTPFilesClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B get_ftp_files(deleted: bool = False) -> List[dict] Get a list of local files. .INDENT 7.0 .TP .B Parameters \fBdeleted\fP (\fIbool\fP) \-\- Whether to include deleted files .TP .B Return type list .TP .B Returns A list of dicts with details on individual files on FTP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqftp_files\(aq .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Genomes .sp Contains possible interactions with the Galaxy Histories .INDENT 0.0 .TP .B class bioblend.galaxy.genomes.GenomeClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B get_genomes() -> list Returns a list of installed genomes .INDENT 7.0 .TP .B Return type list .TP .B Returns List of installed genomes .UNINDENT .UNINDENT .INDENT 7.0 .TP .B install_genome(func: Literal[\(aqdownload\(aq, \(aqindex\(aq] = \(aqdownload\(aq, source: str | None = None, dbkey: str | None = None, ncbi_name: str | None = None, ensembl_dbkey: str | None = None, url_dbkey: str | None = None, indexers: list | None = None) -> Dict[str, Any] Download and/or index a genome. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfunc\fP (\fIstr\fP) \-\- Allowed values: \(aqdownload\(aq, Download and index; \(aqindex\(aq, Index only .IP \(bu 2 \fBsource\fP (\fIstr\fP) \-\- Data source for this build. Can be: UCSC, Ensembl, NCBI, URL .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- DB key of the build to download, ignored unless \(aqUCSC\(aq is specified as the source .IP \(bu 2 \fBncbi_name\fP (\fIstr\fP) \-\- NCBI\(aqs genome identifier, ignored unless NCBI is specified as the source .IP \(bu 2 \fBensembl_dbkey\fP (\fIstr\fP) \-\- Ensembl\(aqs genome identifier, ignored unless Ensembl is specified as the source .IP \(bu 2 \fBurl_dbkey\fP (\fIstr\fP) \-\- DB key to use for this build, ignored unless URL is specified as the source .IP \(bu 2 \fBindexers\fP (\fIlist\fP) \-\- POST array of indexers to run after downloading (indexers[] = first, indexers[] = second, ...) .UNINDENT .TP .B Return type dict .TP .B Returns dict( status: \(aqok\(aq, job: ) If error: dict( status: \(aqerror\(aq, error: ) .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqgenomes\(aq .UNINDENT .INDENT 7.0 .TP .B show_genome(id: str, num: str | None = None, chrom: str | None = None, low: str | None = None, high: str | None = None) -> Dict[str, Any] Returns information about build .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBid\fP (\fIstr\fP) \-\- Genome build ID to use .IP \(bu 2 \fBnum\fP (\fIstr\fP) \-\- num .IP \(bu 2 \fBchrom\fP (\fIstr\fP) \-\- chrom .IP \(bu 2 \fBlow\fP (\fIstr\fP) \-\- low .IP \(bu 2 \fBhigh\fP (\fIstr\fP) \-\- high .UNINDENT .TP .B Return type dict .TP .B Returns Information about the genome build .UNINDENT .UNINDENT .UNINDENT .SS Groups .sp Contains possible interactions with the Galaxy Groups .INDENT 0.0 .TP .B class bioblend.galaxy.groups.GroupsClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B add_group_role(group_id: str, role_id: str) -> Dict[str, Any] Add a role to the given group. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .IP \(bu 2 \fBrole_id\fP (\fIstr\fP) \-\- Encoded role ID to add to the group .UNINDENT .TP .B Return type dict .TP .B Returns Added group role\(aqs info .UNINDENT .UNINDENT .INDENT 7.0 .TP .B add_group_user(group_id: str, user_id: str) -> Dict[str, Any] Add a user to the given group. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .IP \(bu 2 \fBuser_id\fP (\fIstr\fP) \-\- Encoded user ID to add to the group .UNINDENT .TP .B Return type dict .TP .B Returns Added group user\(aqs info .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_group(group_name: str, user_ids: List[str] | None = None, role_ids: List[str] | None = None) -> List[Dict[str, Any]] Create a new group. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBgroup_name\fP (\fIstr\fP) \-\- A name for the new group .IP \(bu 2 \fBuser_ids\fP (\fIlist\fP) \-\- A list of encoded user IDs to add to the new group .IP \(bu 2 \fBrole_ids\fP (\fIlist\fP) \-\- A list of encoded role IDs to add to the new group .UNINDENT .TP .B Return type list .TP .B Returns A (size 1) list with newly created group details, like: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqid\(aq: \(aq7c9636938c3e83bf\(aq, \(aqmodel_class\(aq: \(aqGroup\(aq, \(aqname\(aq: \(aqMy Group Name\(aq, \(aqurl\(aq: \(aq/api/groups/7c9636938c3e83bf\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_group_role(group_id: str, role_id: str) -> Dict[str, Any] Remove a role from the given group. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .IP \(bu 2 \fBrole_id\fP (\fIstr\fP) \-\- Encoded role ID to remove from the group .UNINDENT .TP .B Return type dict .TP .B Returns The role which was removed .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_group_user(group_id: str, user_id: str) -> Dict[str, Any] Remove a user from the given group. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .IP \(bu 2 \fBuser_id\fP (\fIstr\fP) \-\- Encoded user ID to remove from the group .UNINDENT .TP .B Return type dict .TP .B Returns The user which was removed .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_group_roles(group_id: str) -> List[Dict[str, Any]] Get the list of roles associated to the given group. .INDENT 7.0 .TP .B Parameters \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .TP .B Return type list of dicts .TP .B Returns List of group roles\(aq info .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_group_users(group_id: str) -> List[Dict[str, Any]] Get the list of users associated to the given group. .INDENT 7.0 .TP .B Parameters \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .TP .B Return type list of dicts .TP .B Returns List of group users\(aq info .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_groups() -> List[Dict[str, Any]] Get all (not deleted) groups. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dicts with details on individual groups. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqid\(aq: \(aq33abac023ff186c2\(aq, \(aqmodel_class\(aq: \(aqGroup\(aq, \(aqname\(aq: \(aqListeria\(aq, \(aqurl\(aq: \(aq/api/groups/33abac023ff186c2\(aq}, {\(aqid\(aq: \(aq73187219cd372cf8\(aq, \(aqmodel_class\(aq: \(aqGroup\(aq, \(aqname\(aq: \(aqLPN\(aq, \(aqurl\(aq: \(aq/api/groups/73187219cd372cf8\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqgroups\(aq .UNINDENT .INDENT 7.0 .TP .B show_group(group_id: str) -> Dict[str, Any] Get details of a given group. .INDENT 7.0 .TP .B Parameters \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .TP .B Return type dict .TP .B Returns A description of group For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqid\(aq: \(aq33abac023ff186c2\(aq, \(aqmodel_class\(aq: \(aqGroup\(aq, \(aqname\(aq: \(aqListeria\(aq, \(aqroles_url\(aq: \(aq/api/groups/33abac023ff186c2/roles\(aq, \(aqurl\(aq: \(aq/api/groups/33abac023ff186c2\(aq, \(aqusers_url\(aq: \(aq/api/groups/33abac023ff186c2/users\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_group(group_id: str, group_name: str | None = None, user_ids: List[str] | None = None, role_ids: List[str] | None = None) -> None Update a group. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBgroup_id\fP (\fIstr\fP) \-\- Encoded group ID .IP \(bu 2 \fBgroup_name\fP (\fIstr\fP) \-\- A new name for the group. If None, the group name is not changed. .IP \(bu 2 \fBuser_ids\fP (\fIlist\fP) \-\- New list of encoded user IDs for the group. It will substitute the previous list of users (with [] if not specified) .IP \(bu 2 \fBrole_ids\fP (\fIlist\fP) \-\- New list of encoded role IDs for the group. It will substitute the previous list of roles (with [] if not specified) .UNINDENT .TP .B Return type None .TP .B Returns None .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Histories .sp Contains possible interactions with the Galaxy Histories .INDENT 0.0 .TP .B class bioblend.galaxy.histories.HistoryClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B copy_content(history_id: str, content_id: str, source: Literal[\(aqhda\(aq, \(aqhdca\(aq, \(aqlibrary\(aq, \(aqlibrary_folder\(aq] = \(aqhda\(aq) -> Dict[str, Any] Copy existing content (e.g. a dataset) to a history. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- ID of the history to which the content should be copied .IP \(bu 2 \fBcontent_id\fP (\fIstr\fP) \-\- ID of the content to copy .IP \(bu 2 \fBsource\fP (\fIstr\fP) \-\- Source of the content to be copied: \(aqhda\(aq (for a history dataset, the default), \(aqhdca\(aq (for a dataset collection), \(aqlibrary\(aq (for a library dataset) or \(aqlibrary_folder\(aq (for all datasets in a library folder). .UNINDENT .TP .B Return type dict .TP .B Returns Information about the copied content .UNINDENT .UNINDENT .INDENT 7.0 .TP .B copy_dataset(history_id: str, dataset_id: str, source: Literal[\(aqhda\(aq, \(aqlibrary\(aq, \(aqlibrary_folder\(aq] = \(aqhda\(aq) -> Dict[str, Any] Copy a dataset to a history. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- history ID to which the dataset should be copied .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- dataset ID .IP \(bu 2 \fBsource\fP (\fIstr\fP) \-\- Source of the dataset to be copied: \(aqhda\(aq (the default), \(aqlibrary\(aq or \(aqlibrary_folder\(aq .UNINDENT .TP .B Return type dict .TP .B Returns Information about the copied dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_dataset_collection(history_id: str, collection_description: \fI\%CollectionDescription\fP | Dict[str, Any]) -> Dict[str, Any] Create a new dataset collection .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBcollection_description\fP (\fI\%bioblend.galaxy.dataset_collections.CollectionDescription\fP) \-\- .sp a description of the dataset collection For example: .INDENT 2.0 .INDENT 3.5 .sp .EX {\(aqcollection_type\(aq: \(aqlist\(aq, \(aqelement_identifiers\(aq: [{\(aqid\(aq: \(aqf792763bee8d277a\(aq, \(aqname\(aq: \(aqelement 1\(aq, \(aqsrc\(aq: \(aqhda\(aq}, {\(aqid\(aq: \(aqf792763bee8d277a\(aq, \(aqname\(aq: \(aqelement 2\(aq, \(aqsrc\(aq: \(aqhda\(aq}], \(aqname\(aq: \(aqMy collection list\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .TP .B Return type dict .TP .B Returns Information about the new HDCA .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_history(name: str | None = None) -> Dict[str, Any] Create a new history, optionally setting the \fBname\fP\&. .INDENT 7.0 .TP .B Parameters \fBname\fP (\fIstr\fP) \-\- Optional name for new history .TP .B Return type dict .TP .B Returns Dictionary containing information about newly created history .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_history_tag(history_id: str, tag: str) -> Dict[str, Any] Create history tag .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBtag\fP (\fIstr\fP) \-\- Add tag to history .UNINDENT .TP .B Return type dict .TP .B Returns A dictionary with information regarding the tag. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqid\(aq: \(aqf792763bee8d277a\(aq, \(aqmodel_class\(aq: \(aqHistoryTagAssociation\(aq, \(aquser_tname\(aq: \(aqNGS_PE_RUN\(aq, \(aquser_value\(aq: None} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_dataset(history_id: str, dataset_id: str, purge: bool = False) -> None Mark corresponding dataset as deleted. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .IP \(bu 2 \fBpurge\fP (\fIbool\fP) \-\- if \fBTrue\fP, also purge (permanently delete) the dataset .UNINDENT .TP .B Return type None .TP .B Returns None .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 The \fBpurge\fP option works only if the Galaxy instance has the \fBallow_user_dataset_purge\fP option set to \fBtrue\fP in the \fBconfig/galaxy.yml\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_dataset_collection(history_id: str, dataset_collection_id: str) -> None Mark corresponding dataset collection as deleted. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_collection_id\fP (\fIstr\fP) \-\- Encoded dataset collection ID .UNINDENT .TP .B Return type None .TP .B Returns None .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_history(history_id: str, purge: bool = False) -> Dict[str, Any] Delete a history. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBpurge\fP (\fIbool\fP) \-\- if \fBTrue\fP, also purge (permanently delete) the history .UNINDENT .TP .B Return type dict .TP .B Returns An error object if an error occurred or a dictionary containing: \fBid\fP (the encoded id of the history), \fBdeleted\fP (if the history was marked as deleted), \fBpurged\fP (if the history was purged). .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 The \fBpurge\fP option works only if the Galaxy instance has the \fBallow_user_dataset_purge\fP option set to \fBtrue\fP in the \fBconfig/galaxy.yml\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B download_history(history_id: str, jeha_id: str, outf: IO[bytes], chunk_size: int = 4096) -> None Download a history export archive. Use \fI\%export_history()\fP to create an export. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- history ID .IP \(bu 2 \fBjeha_id\fP (\fIstr\fP) \-\- jeha ID (this should be obtained via \fI\%export_history()\fP) .IP \(bu 2 \fBoutf\fP (\fIfile\fP) \-\- output file object, open for writing in binary mode .IP \(bu 2 \fBchunk_size\fP (\fIint\fP) \-\- how many bytes at a time should be read into memory .UNINDENT .TP .B Return type None .TP .B Returns None .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export_history(history_id: str, gzip: bool = True, include_hidden: bool = False, include_deleted: bool = False, wait: bool = False, maxwait: float | None = None) -> str Start a job to create an export archive for the given history. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- history ID .IP \(bu 2 \fBgzip\fP (\fIbool\fP) \-\- create .tar.gz archive if \fBTrue\fP, else .tar .IP \(bu 2 \fBinclude_hidden\fP (\fIbool\fP) \-\- whether to include hidden datasets in the export .IP \(bu 2 \fBinclude_deleted\fP (\fIbool\fP) \-\- whether to include deleted datasets in the export .IP \(bu 2 \fBwait\fP (\fIbool\fP) \-\- if \fBTrue\fP, block until the export is ready; else, return immediately .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the export to become ready. When set, implies that \fBwait\fP is \fBTrue\fP\&. .UNINDENT .TP .B Return type str .TP .B Returns \fBjeha_id\fP of the export, or empty if \fBwait\fP is \fBFalse\fP and the export is not ready. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_extra_files(history_id: str, dataset_id: str) -> List[str] Get extra files associated with a composite dataset, or an empty list if there are none. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- history ID .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- dataset ID .UNINDENT .TP .B Return type list .TP .B Returns List of extra files .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_histories(history_id: str | None = None, name: str | None = None, deleted: bool = False, published: bool | None = None, slug: str | None = None, all: bool | None = False) -> List[Dict[str, Any]] Get all histories, or select a subset by specifying optional arguments for filtering (e.g. a history name). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- History name to filter on. .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- whether to filter for the deleted histories (\fBTrue\fP) or for the non\-deleted ones (\fBFalse\fP) .IP \(bu 2 \fBpublished\fP (\fIbool\fP\fI or \fP\fINone\fP) \-\- whether to filter for the published histories (\fBTrue\fP) or for the non\-published ones (\fBFalse\fP). If not set, no filtering is applied. Note the filtering is only applied to the user\(aqs own histories; to access all histories published by any user, use the \fBget_published_histories\fP method. .IP \(bu 2 \fBslug\fP (\fIstr\fP) \-\- History slug to filter on .IP \(bu 2 \fBall\fP (\fIbool\fP) \-\- Whether to include histories from other users. This parameter works only on Galaxy 20.01 or later and can be specified only if the user is a Galaxy admin. .UNINDENT .TP .B Return type list .TP .B Returns List of history dicts. .UNINDENT .sp Changed in version 0.17.0: Using the deprecated \fBhistory_id\fP parameter now raises a \fBValueError\fP exception. .UNINDENT .INDENT 7.0 .TP .B get_most_recently_used_history() -> Dict[str, Any] Returns the current user\(aqs most recently used history (not deleted). .INDENT 7.0 .TP .B Return type dict .TP .B Returns History representation .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_published_histories(name: str | None = None, deleted: bool = False, slug: str | None = None) -> List[Dict[str, Any]] Get all published histories (by any user), or select a subset by specifying optional arguments for filtering (e.g. a history name). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- History name to filter on. .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- whether to filter for the deleted histories (\fBTrue\fP) or for the non\-deleted ones (\fBFalse\fP) .IP \(bu 2 \fBslug\fP (\fIstr\fP) \-\- History slug to filter on .UNINDENT .TP .B Return type list .TP .B Returns List of history dicts. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_status(history_id: str) -> Dict[str, Any] Returns the state of this history .INDENT 7.0 .TP .B Parameters \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .TP .B Return type dict .TP .B Returns A dict documenting the current state of the history. Has the following keys: \(aqstate\(aq = This is the current state of the history, such as ok, error, new etc. \(aqstate_details\(aq = Contains individual statistics for various dataset states. \(aqpercent_complete\(aq = The overall number of datasets processed to completion. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B gi: GalaxyInstance .UNINDENT .INDENT 7.0 .TP .B import_history(file_path: str | None = None, url: str | None = None) -> Dict[str, Any] Import a history from an archive on disk or a URL. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- Path to exported history archive on disk. .IP \(bu 2 \fBurl\fP (\fIstr\fP) \-\- URL for an exported history archive .UNINDENT .TP .B Return type dict .TP .B Returns Dictionary containing information about the imported history .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqhistories\(aq .UNINDENT .INDENT 7.0 .TP .B open_history(history_id: str) -> None Open Galaxy in a new tab of the default web browser and switch to the specified history. .INDENT 7.0 .TP .B Parameters \fBhistory_id\fP (\fIstr\fP) \-\- ID of the history to switch to .TP .B Return type NoneType .TP .B Returns \fBNone\fP .UNINDENT .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 After opening the specified history, all previously opened Galaxy tabs in the browser session will have the current history changed to this one, even if the interface still shows another history. Refreshing any such tab is recommended. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset(history_id: str, dataset_id: str) -> Dict[str, Any] Get details about a given history dataset. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .UNINDENT .TP .B Return type dict .TP .B Returns Information about the dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset_collection(history_id: str, dataset_collection_id: str) -> Dict[str, Any] Get details about a given history dataset collection. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_collection_id\fP (\fIstr\fP) \-\- Encoded dataset collection ID .UNINDENT .TP .B Return type dict .TP .B Returns Information about the dataset collection .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset_provenance(history_id: str, dataset_id: str, follow: bool = False) -> Dict[str, Any] Get details related to how dataset was created (\fBid\fP, \fBjob_id\fP, \fBtool_id\fP, \fBstdout\fP, \fBstderr\fP, \fBparameters\fP, \fBinputs\fP, etc...). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .IP \(bu 2 \fBfollow\fP (\fIbool\fP) \-\- If \fBTrue\fP, recursively fetch dataset provenance information for all inputs and their inputs, etc. .UNINDENT .TP .B Return type dict .TP .B Returns Dataset provenance information For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqid\(aq: \(aq6fbd9b2274c62ebe\(aq, \(aqjob_id\(aq: \(aq5471ba76f274f929\(aq, \(aqparameters\(aq: {\(aqchromInfo\(aq: \(aq\(dq/usr/local/galaxy/galaxy\-dist/tool\-data/shared/ucsc/chrom/mm9.len\(dq\(aq, \(aqdbkey\(aq: \(aq\(dqmm9\(dq\(aq, \(aqexperiment_name\(aq: \(aq\(dqH3K4me3_TAC_MACS2\(dq\(aq, \(aqinput_chipseq_file1\(aq: {\(aqid\(aq: \(aq6f0a311a444290f2\(aq, \(aquuid\(aq: \(aqnull\(aq}, \(aqinput_control_file1\(aq: {\(aqid\(aq: \(aqc21816a91f5dc24e\(aq, \(aquuid\(aq: \(aq16f8ee5e\-228f\-41e2\-921e\-a07866edce06\(aq}, \(aqmajor_command\(aq: \(aq{\(dqgsize\(dq: \(dq2716965481.0\(dq, \(dqbdg\(dq: \(dqFalse\(dq, \(dq__current_case__\(dq: 0, \(dqadvanced_options\(dq: {\(dqadvanced_options_selector\(dq: \(dqoff\(dq, \(dq__current_case__\(dq: 1}, \(dqinput_chipseq_file1\(dq: 104715, \(dqxls_to_interval\(dq: \(dqFalse\(dq, \(dqmajor_command_selector\(dq: \(dqcallpeak\(dq, \(dqinput_control_file1\(dq: 104721, \(dqpq_options\(dq: {\(dqpq_options_selector\(dq: \(dqqvalue\(dq, \(dqqvalue\(dq: \(dq0.05\(dq, \(dq__current_case__\(dq: 1}, \(dqbw\(dq: \(dq300\(dq, \(dqnomodel_type\(dq: {\(dqnomodel_type_selector\(dq: \(dqcreate_model\(dq, \(dq__current_case__\(dq: 1}}\(aq}, \(aqstderr\(aq: \(aq\(aq, \(aqstdout\(aq: \(aq\(aq, \(aqtool_id\(aq: \(aqtoolshed.g2.bx.psu.edu/repos/ziru\-zhou/macs2/modencode_peakcalling_macs2/2.0.10.2\(aq, \(aquuid\(aq: \(aq5c0c43f5\-8d93\-44bd\-939d\-305e82f213c6\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_history(history_id: str, contents: Literal[False] = False) -> Dict[str, Any] .TP .B show_history(history_id: str, contents: Literal[True], deleted: bool | None = None, visible: bool | None = None, details: str | None = None, types: List[str] | None = None) -> List[Dict[str, Any]] .TP .B show_history(history_id: str, contents: bool = False, deleted: bool | None = None, visible: bool | None = None, details: str | None = None, types: List[str] | None = None) -> Dict[str, Any] | List[Dict[str, Any]] Get details of a given history. By default, just get the history meta information. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID to filter on .IP \(bu 2 \fBcontents\fP (\fIbool\fP) \-\- When \fBTrue\fP, instead of the history details, return a list with info for all datasets in the given history. Note that inside each dataset info dict, the id which should be used for further requests about this history dataset is given by the value of the \fIid\fP (not \fIdataset_id\fP) key. .IP \(bu 2 \fBdeleted\fP (\fIbool\fP\fI or \fP\fINone\fP) \-\- When \fBcontents=True\fP, whether to filter for the deleted datasets (\fBTrue\fP) or for the non\-deleted ones (\fBFalse\fP). If not set, no filtering is applied. .IP \(bu 2 \fBvisible\fP (\fIbool\fP\fI or \fP\fINone\fP) \-\- When \fBcontents=True\fP, whether to filter for the visible datasets (\fBTrue\fP) or for the hidden ones (\fBFalse\fP). If not set, no filtering is applied. .IP \(bu 2 \fBdetails\fP (\fIstr\fP) \-\- When \fBcontents=True\fP, include dataset details. Set to \(aqall\(aq for the most information. .IP \(bu 2 \fBtypes\fP (\fIlist\fP) \-\- When \fBcontents=True\fP, filter for history content types. If set to \fB[\(aqdataset\(aq]\fP, return only datasets. If set to \fB[\(aqdataset_collection\(aq]\fP, return only dataset collections. If not set, no filtering is applied. .UNINDENT .TP .B Return type dict or list of dicts .TP .B Returns details of the given history or list of dataset info .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 As an alternative to using the \fBcontents=True\fP parameter, consider using \fBgi.datasets.get_datasets(history_id=history_id)\fP which offers more extensive functionality for filtering and ordering the results. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_matching_datasets(history_id: str, name_filter: str | Pattern[str] | None = None) -> List[Dict[str, Any]] Get dataset details for matching datasets within a history. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBname_filter\fP (\fIstr\fP) \-\- Only datasets whose name matches the \fBname_filter\fP regular expression will be returned; use plain strings for exact matches and None to match all datasets in the history .UNINDENT .TP .B Return type list .TP .B Returns List of dictionaries .UNINDENT .UNINDENT .INDENT 7.0 .TP .B undelete_history(history_id: str) -> str Undelete a history .INDENT 7.0 .TP .B Parameters \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .TP .B Return type str .TP .B Returns \(aqOK\(aq if it was deleted .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_dataset(history_id: str, dataset_id: str, **kwargs: Any) -> Dict[str, Any] Update history dataset metadata. Some of the attributes that can be modified are documented below. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- ID of the dataset .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Replace history dataset name with the given string .IP \(bu 2 \fBdatatype\fP (\fIstr\fP) \-\- Replace the datatype of the history dataset with the given string. The string must be a valid Galaxy datatype, both the current and the target datatypes must allow datatype changes, and the dataset must not be in use as input or output of a running job (including uploads), otherwise an error will be raised. .IP \(bu 2 \fBgenome_build\fP (\fIstr\fP) \-\- Replace history dataset genome build (dbkey) .IP \(bu 2 \fBannotation\fP (\fIstr\fP) \-\- Replace history dataset annotation with given string .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Mark or unmark history dataset as deleted .IP \(bu 2 \fBvisible\fP (\fIbool\fP) \-\- Mark or unmark history dataset as visible .UNINDENT .TP .B Return type dict .TP .B Returns details of the updated dataset .UNINDENT .sp Changed in version 0.8.0: Changed the return value from the status code (type int) to a dict. .UNINDENT .INDENT 7.0 .TP .B update_dataset_collection(history_id: str, dataset_collection_id: str, **kwargs: Any) -> Dict[str, Any] Update history dataset collection metadata. Some of the attributes that can be modified are documented below. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBdataset_collection_id\fP (\fIstr\fP) \-\- Encoded dataset_collection ID .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Replace history dataset collection name with the given string .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Mark or unmark history dataset collection as deleted .IP \(bu 2 \fBvisible\fP (\fIbool\fP) \-\- Mark or unmark history dataset collection as visible .UNINDENT .TP .B Return type dict .TP .B Returns the updated dataset collection attributes .UNINDENT .sp Changed in version 0.8.0: Changed the return value from the status code (type int) to a dict. .UNINDENT .INDENT 7.0 .TP .B update_history(history_id: str, **kwargs: Any) -> Dict[str, Any] Update history metadata information. Some of the attributes that can be modified are documented below. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Replace history name with the given string .IP \(bu 2 \fBannotation\fP (\fIstr\fP) \-\- Replace history annotation with given string .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Mark or unmark history as deleted .IP \(bu 2 \fBpurged\fP (\fIbool\fP) \-\- If \fBTrue\fP, mark history as purged (permanently deleted). .IP \(bu 2 \fBpublished\fP (\fIbool\fP) \-\- Mark or unmark history as published .IP \(bu 2 \fBimportable\fP (\fIbool\fP) \-\- Mark or unmark history as importable .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- Replace history tags with the given list .UNINDENT .TP .B Return type dict .TP .B Returns details of the updated history .UNINDENT .sp Changed in version 0.8.0: Changed the return value from the status code (type int) to a dict. .UNINDENT .INDENT 7.0 .TP .B upload_dataset_from_library(history_id: str, lib_dataset_id: str) -> Dict[str, Any] Upload a dataset into the history from a library. Requires the library dataset ID, which can be obtained from the library contents. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBlib_dataset_id\fP (\fIstr\fP) \-\- Encoded library dataset ID .UNINDENT .TP .B Return type dict .TP .B Returns Information about the newly created HDA .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Invocations .sp Contains possible interactions with the Galaxy workflow invocations .INDENT 0.0 .TP .B class bioblend.galaxy.invocations.InvocationClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B cancel_invocation(invocation_id: str) -> Dict[str, Any] Cancel the scheduling of a workflow. .INDENT 7.0 .TP .B Parameters \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .TP .B Return type dict .TP .B Returns The workflow invocation being cancelled .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocation_biocompute_object(invocation_id: str) -> Dict[str, Any] Get a BioCompute object for an invocation. .INDENT 7.0 .TP .B Parameters \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .TP .B Return type dict .TP .B Returns The BioCompute object .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocation_report(invocation_id: str) -> Dict[str, Any] Get a Markdown report for an invocation. .INDENT 7.0 .TP .B Parameters \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .TP .B Return type dict .TP .B Returns The invocation report. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqmarkdown\(aq: \(aq\en# Workflow Execution Summary of Example workflow\en\en ## Workflow Inputs\en\en\en## Workflow Outputs\en\en\en ## Workflow\en\(ga\(ga\(gagalaxy\en workflow_display(workflow_id=f2db41e1fa331b3e)\en\(ga\(ga\(ga\en\(aq, \(aqrender_format\(aq: \(aqmarkdown\(aq, \(aqworkflows\(aq: {\(aqf2db41e1fa331b3e\(aq: {\(aqname\(aq: \(aqExample workflow\(aq}}} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocation_report_pdf(invocation_id: str, file_path: str, chunk_size: int = 4096) -> None Get a PDF report for an invocation. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .IP \(bu 2 \fBfile_path\fP (\fIstr\fP) \-\- Path to save the report .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocation_step_jobs_summary(invocation_id: str) -> List[Dict[str, Any]] Get a detailed summary of an invocation, listing all jobs with their job IDs and current states. .INDENT 7.0 .TP .B Parameters \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .TP .B Return type list of dicts .TP .B Returns The invocation step jobs summary. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqid\(aq: \(aqe85a3be143d5905b\(aq, \(aqmodel\(aq: \(aqJob\(aq, \(aqpopulated_state\(aq: \(aqok\(aq, \(aqstates\(aq: {\(aqok\(aq: 1}}, {\(aqid\(aq: \(aqc9468fdb6dc5c5f1\(aq, \(aqmodel\(aq: \(aqJob\(aq, \(aqpopulated_state\(aq: \(aqok\(aq, \(aqstates\(aq: {\(aqrunning\(aq: 1}}, {\(aqid\(aq: \(aq2a56795cad3c7db3\(aq, \(aqmodel\(aq: \(aqJob\(aq, \(aqpopulated_state\(aq: \(aqok\(aq, \(aqstates\(aq: {\(aqnew\(aq: 1}}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocation_summary(invocation_id: str) -> Dict[str, Any] Get a summary of an invocation, stating the number of jobs which succeed, which are paused and which have errored. .INDENT 7.0 .TP .B Parameters \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .TP .B Return type dict .TP .B Returns The invocation summary. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqstates\(aq: {\(aqpaused\(aq: 4, \(aqerror\(aq: 2, \(aqok\(aq: 2}, \(aqmodel\(aq: \(aqWorkflowInvocation\(aq, \(aqid\(aq: \(aqa799d38679e985db\(aq, \(aqpopulated_state\(aq: \(aqok\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocations(workflow_id: str | None = None, history_id: str | None = None, user_id: str | None = None, include_terminal: bool = True, limit: int | None = None, view: str = \(aqcollection\(aq, step_details: bool = False) -> List[Dict[str, Any]] Get all workflow invocations, or select a subset by specifying optional arguments for filtering (e.g. a workflow ID). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID to filter on .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID to filter on .IP \(bu 2 \fBuser_id\fP (\fIstr\fP) \-\- Encoded user ID to filter on. This must be your own user ID if your are not an admin user. .IP \(bu 2 \fBinclude_terminal\fP (\fIbool\fP) \-\- Whether to include terminal states. .IP \(bu 2 \fBlimit\fP (\fIint\fP) \-\- Maximum number of invocations to return \- if specified, the most recent invocations will be returned. .IP \(bu 2 \fBview\fP (\fIstr\fP) \-\- Level of detail to return per invocation, either \(aqelement\(aq or \(aqcollection\(aq. .IP \(bu 2 \fBstep_details\fP (\fIbool\fP) \-\- If \(aqview\(aq is \(aqelement\(aq, also include details on individual steps. .UNINDENT .TP .B Return type list .TP .B Returns A list of workflow invocations. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqhistory_id\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqid\(aq: \(aqdf7a1f0c02a5b08e\(aq, \(aqmodel_class\(aq: \(aqWorkflowInvocation\(aq, \(aqstate\(aq: \(aqnew\(aq, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:22\(aq, \(aquuid\(aq: \(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, \(aqworkflow_id\(aq: \(aq03501d7626bd192f\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B gi: GalaxyInstance .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqinvocations\(aq .UNINDENT .INDENT 7.0 .TP .B rerun_invocation(invocation_id: str, inputs_update: dict | None = None, params_update: dict | None = None, history_id: str | None = None, history_name: str | None = None, import_inputs_to_history: bool = False, replacement_params: dict | None = None, allow_tool_state_corrections: bool = False, inputs_by: Literal[\(aqstep_index|step_uuid\(aq, \(aqstep_index\(aq, \(aqstep_id\(aq, \(aqstep_uuid\(aq, \(aqname\(aq] | None = None, parameters_normalized: bool = False) -> Dict[str, Any] Rerun a workflow invocation. For more extensive documentation of all parameters, see the \fBgi.workflows.invoke_workflow()\fP method. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID to be rerun .IP \(bu 2 \fBinputs_update\fP (\fIdict\fP) \-\- If different datasets should be used to the original invocation, this should contain a mapping of workflow inputs to the new datasets and dataset collections. .IP \(bu 2 \fBparams_update\fP (\fIdict\fP) \-\- If different non\-dataset tool parameters should be used to the original invocation, this should contain a mapping of the new parameter values. .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- The encoded history ID where to store the workflow outputs. Alternatively, \fBhistory_name\fP may be specified to create a new history. .IP \(bu 2 \fBhistory_name\fP (\fIstr\fP) \-\- Create a new history with the given name to store the workflow outputs. If both \fBhistory_id\fP and \fBhistory_name\fP are provided, \fBhistory_name\fP is ignored. If neither is specified, a new \(aqUnnamed history\(aq is created. .IP \(bu 2 \fBimport_inputs_to_history\fP (\fIbool\fP) \-\- If \fBTrue\fP, used workflow inputs will be imported into the history. If \fBFalse\fP, only workflow outputs will be visible in the given history. .IP \(bu 2 \fBallow_tool_state_corrections\fP (\fIbool\fP) \-\- If True, allow Galaxy to fill in missing tool state when running workflows. This may be useful for workflows using tools that have changed over time or for workflows built outside of Galaxy with only a subset of inputs defined. .IP \(bu 2 \fBreplacement_params\fP (\fIdict\fP) \-\- pattern\-based replacements for post\-job actions .IP \(bu 2 \fBinputs_by\fP (\fIstr\fP) \-\- Determines how inputs are referenced. Can be \(dqstep_index|step_uuid\(dq (default), \(dqstep_index\(dq, \(dqstep_id\(dq, \(dqstep_uuid\(dq, or \(dqname\(dq. .IP \(bu 2 \fBparameters_normalized\fP (\fIbool\fP) \-\- Whether Galaxy should normalize the input parameters to ensure everything is referenced by a numeric step ID. Default is \fBFalse\fP, but when setting parameters for a subworkflow, \fBTrue\fP is required. .UNINDENT .TP .B Return type dict .TP .B Returns A dict describing the new workflow invocation. .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 21.01 or later. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B run_invocation_step_action(invocation_id: str, step_id: str, action: Any) -> Dict[str, Any] Execute an action for an active workflow invocation step. The nature of this action and what is expected will vary based on the the type of workflow step (the only currently valid action is True/False for pause steps). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .IP \(bu 2 \fBstep_id\fP (\fIstr\fP) \-\- Encoded workflow invocation step ID .IP \(bu 2 \fBaction\fP (\fIobject\fP) \-\- Action to use when updating state, semantics depends on step type. .UNINDENT .TP .B Return type dict .TP .B Returns Representation of the workflow invocation step .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_invocation(invocation_id: str) -> Dict[str, Any] Get a workflow invocation dictionary representing the scheduling of a workflow. This dictionary may be sparse at first (missing inputs and invocation steps) and will become more populated as the workflow is actually scheduled. .INDENT 7.0 .TP .B Parameters \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .TP .B Return type dict .TP .B Returns The workflow invocation. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqhistory_id\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqid\(aq: \(aqdf7a1f0c02a5b08e\(aq, \(aqinputs\(aq: {\(aq0\(aq: {\(aqid\(aq: \(aqa7db2fac67043c7e\(aq, \(aqsrc\(aq: \(aqhda\(aq, \(aquuid\(aq: \(aq7932ffe0\-2340\-4952\-8857\-dbaa50f1f46a\(aq}}, \(aqmodel_class\(aq: \(aqWorkflowInvocation\(aq, \(aqstate\(aq: \(aqready\(aq, \(aqsteps\(aq: [{\(aqaction\(aq: None, \(aqid\(aq: \(aqd413a19dec13d11e\(aq, \(aqjob_id\(aq: None, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 0, \(aqstate\(aq: None, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aqworkflow_step_id\(aq: \(aqcbbbf59e8f08c98c\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aqb81250fd\-3278\-4e6a\-b269\-56a1f01ef485\(aq}, {\(aqaction\(aq: None, \(aqid\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqjob_id\(aq: \(aqe89067bb68bee7a0\(aq, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 1, \(aqstate\(aq: \(aqnew\(aq, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aqworkflow_step_id\(aq: \(aq964b37715ec9bd22\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aqe62440b8\-e911\-408b\-b124\-e05435d3125e\(aq}], \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aquuid\(aq: \(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, \(aqworkflow_id\(aq: \(aq03501d7626bd192f\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_invocation_step(invocation_id: str, step_id: str) -> Dict[str, Any] See the details of a particular workflow invocation step. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .IP \(bu 2 \fBstep_id\fP (\fIstr\fP) \-\- Encoded workflow invocation step ID .UNINDENT .TP .B Return type dict .TP .B Returns The workflow invocation step. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqaction\(aq: None, \(aqid\(aq: \(aq63cd3858d057a6d1\(aq, \(aqjob_id\(aq: None, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 2, \(aqstate\(aq: None, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:11:14\(aq, \(aqworkflow_step_id\(aq: \(aq52e496b945151ee8\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aq4060554c\-1dd5\-4287\-9040\-8b4f281cf9dc\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B wait_for_invocation(invocation_id: str, maxwait: float = 12000, interval: float = 3, check: bool = True) -> Dict[str, Any] Wait until an invocation is in a terminal state. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Invocation ID to wait for. .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the invocation state to become terminal. If the invocation state is not terminal within this time, a \fBTimeoutException\fP will be raised. .IP \(bu 2 \fBinterval\fP (\fIfloat\fP) \-\- Time (in seconds) to wait between 2 consecutive checks. .IP \(bu 2 \fBcheck\fP (\fIbool\fP) \-\- Whether to check if the invocation terminal state is \(aqscheduled\(aq. .UNINDENT .TP .B Return type dict .TP .B Returns Details of the workflow invocation. .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Jobs .sp Contains possible interactions with the Galaxy Jobs .INDENT 0.0 .TP .B class bioblend.galaxy.jobs.JobsClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B cancel_job(job_id: str) -> bool Cancel a job, deleting output datasets. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type bool .TP .B Returns \fBTrue\fP if the job was successfully cancelled, \fBFalse\fP if it was already in a terminal state before the cancellation. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_common_problems(job_id: str) -> Dict[str, Any] Query inputs and jobs for common potential problems that might have resulted in job failure. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type dict .TP .B Returns dict containing potential problems .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 19.05 or later. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_destination_params(job_id: str) -> Dict[str, Any] Get destination parameters for a job, describing the environment and location where the job is run. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type dict .TP .B Returns Destination parameters for the given job .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 20.05 or later and if the user is a Galaxy admin. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_inputs(job_id: str) -> List[Dict[str, Any]] Get dataset inputs used by a job. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type list of dicts .TP .B Returns Inputs for the given job .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_jobs(state: str | None = None, history_id: str | None = None, invocation_id: str | None = None, tool_id: str | None = None, workflow_id: str | None = None, user_id: str | None = None, date_range_min: str | None = None, date_range_max: str | None = None, limit: int = 500, offset: int = 0, user_details: bool = False, order_by: Literal[\(aqcreate_time\(aq, \(aqupdate_time\(aq] = \(aqupdate_time\(aq) -> List[Dict[str, Any]] Get all jobs, or select a subset by specifying optional arguments for filtering (e.g. a state). .sp If the user is an admin, this will return jobs for all the users, otherwise only for the current user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBstate\fP (\fIstr\fP\fI or \fP\fIlist\fP\fI of \fP\fIstr\fP) \-\- Job states to filter on. .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID to filter on. .IP \(bu 2 \fBinvocation_id\fP (\fIstring\fP) \-\- Encoded workflow invocation ID to filter on. .IP \(bu 2 \fBtool_id\fP (\fIstr\fP\fI or \fP\fIlist\fP\fI of \fP\fIstr\fP) \-\- Tool IDs to filter on. .IP \(bu 2 \fBworkflow_id\fP (\fIstring\fP) \-\- Encoded workflow ID to filter on. .IP \(bu 2 \fBuser_id\fP (\fIstr\fP) \-\- Encoded user ID to filter on. Only admin users can access the jobs of other users. .IP \(bu 2 \fBdate_range_min\fP (\fIstr\fP) \-\- Mininum job update date (in YYYY\-MM\-DD format) to filter on. .IP \(bu 2 \fBdate_range_max\fP (\fIstr\fP) \-\- Maximum job update date (in YYYY\-MM\-DD format) to filter on. .IP \(bu 2 \fBlimit\fP (\fIint\fP) \-\- Maximum number of jobs to return. .IP \(bu 2 \fBoffset\fP (\fIint\fP) \-\- Return jobs starting from this specified position. For example, if \fBlimit\fP is set to 100 and \fBoffset\fP to 200, jobs 200\-299 will be returned. .IP \(bu 2 \fBuser_details\fP (\fIbool\fP) \-\- If \fBTrue\fP and the user is an admin, add the user email to each returned job dictionary. .IP \(bu 2 \fBorder_by\fP (\fIstr\fP) \-\- Whether to order jobs by \fBcreate_time\fP or \fBupdate_time\fP (the default). .UNINDENT .TP .B Return type list of dict .TP .B Returns Summary information for each selected job. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqcreate_time\(aq: \(aq2014\-03\-01T16:16:48.640550\(aq, \(aqexit_code\(aq: 0, \(aqid\(aq: \(aqebfb8f50c6abde6d\(aq, \(aqmodel_class\(aq: \(aqJob\(aq, \(aqstate\(aq: \(aqok\(aq, \(aqtool_id\(aq: \(aqfasta2tab\(aq, \(aqupdate_time\(aq: \(aq2014\-03\-01T16:16:50.657399\(aq}, {\(aqcreate_time\(aq: \(aq2014\-03\-01T16:05:34.851246\(aq, \(aqexit_code\(aq: 0, \(aqid\(aq: \(aq1cd8e2f6b131e891\(aq, \(aqmodel_class\(aq: \(aqJob\(aq, \(aqstate\(aq: \(aqok\(aq, \(aqtool_id\(aq: \(aqupload1\(aq, \(aqupdate_time\(aq: \(aq2014\-03\-01T16:05:39.558458\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 The following parameters work only on Galaxy 21.05 or later: \fBuser_id\fP, \fBlimit\fP, \fBoffset\fP, \fBworkflow_id\fP, \fBinvocation_id\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_metrics(job_id: str) -> List[Dict[str, Any]] Return job metrics for a given job. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type list .TP .B Returns list containing job metrics .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 Calling \fBshow_job()\fP with \fBfull_details=True\fP also returns the metrics for a job if the user is an admin. This method allows to fetch metrics even as a normal user as long as the Galaxy instance has the \fBexpose_potentially_sensitive_job_metrics\fP option set to \fBtrue\fP in the \fBconfig/galaxy.yml\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_outputs(job_id: str) -> List[Dict[str, Any]] Get dataset outputs produced by a job. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type list of dicts .TP .B Returns Outputs of the given job .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_state(job_id: str) -> str Display the current state for a given job of the current user. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type str .TP .B Returns state of the given job among the following values: \fInew\fP, \fIqueued\fP, \fIrunning\fP, \fIwaiting\fP, \fIok\fP\&. If the state cannot be retrieved, an empty string is returned. .UNINDENT .sp New in version 0.5.3. .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqjobs\(aq .UNINDENT .INDENT 7.0 .TP .B report_error(job_id: str, dataset_id: str, message: str, email: str | None = None) -> Dict[str, Any] Report an error for a given job and dataset to the server administrators. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBjob_id\fP (\fIstr\fP) \-\- job ID .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- Dataset ID .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- Error message .IP \(bu 2 \fBemail\fP (\fIstr\fP) \-\- Email for error report submission. If not specified, the email associated with the Galaxy user account is used by default. .UNINDENT .TP .B Return type dict .TP .B Returns dict containing job error reply .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 20.01 or later. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B rerun_job(job_id: str, remap: bool = False, tool_inputs_update: Dict[str, Any] | None = None, history_id: str | None = None) -> Dict[str, Any] Rerun a job. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBjob_id\fP (\fIstr\fP) \-\- job ID .IP \(bu 2 \fBremap\fP (\fIbool\fP) \-\- when \fBTrue\fP, the job output(s) will be remapped onto the dataset(s) created by the original job; if other jobs were waiting for this job to finish successfully, they will be resumed using the new outputs of this tool run. When \fBFalse\fP, new job output(s) will be created. Note that if Galaxy does not permit remapping for the job in question, specifying \fBTrue\fP will result in an error. .IP \(bu 2 \fBtool_inputs_update\fP (\fIdict\fP) \-\- dictionary specifying any changes which should be made to tool parameters for the rerun job. This dictionary should have the same structure as is required when submitting the \fBtool_inputs\fP dictionary to \fBgi.tools.run_tool()\fP, but only needs to include the inputs or parameters to be updated for the rerun job. .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- ID of the history in which the job should be executed; if not specified, the same history will be used as the original job run. .UNINDENT .TP .B Return type dict .TP .B Returns Information about outputs and the rerun job .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 21.01 or later. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B resume_job(job_id: str) -> List[Dict[str, Any]] Resume a job if it is paused. .INDENT 7.0 .TP .B Parameters \fBjob_id\fP (\fIstr\fP) \-\- job ID .TP .B Return type list of dicts .TP .B Returns list of dictionaries containing output dataset associations .UNINDENT .UNINDENT .INDENT 7.0 .TP .B search_jobs(tool_id: str, inputs: Dict[str, Any], state: str | None = None) -> List[Dict[str, Any]] Return jobs matching input parameters. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtool_id\fP (\fIstr\fP) \-\- only return jobs associated with this tool ID .IP \(bu 2 \fBinputs\fP (\fIdict\fP) \-\- return only jobs that have matching inputs .IP \(bu 2 \fBstate\fP (\fIstr\fP) \-\- only return jobs in this state .UNINDENT .TP .B Return type list of dicts .TP .B Returns Summary information for each matching job .UNINDENT .sp This method is designed to scan the list of previously run jobs and find records of jobs with identical input parameters and datasets. This can be used to minimize the amount of repeated work by simply recycling the old results. .sp Changed in version 0.16.0: Replaced the \fBjob_info\fP parameter with separate \fBtool_id\fP, \fBinputs\fP and \fBstate\fP\&. .UNINDENT .INDENT 7.0 .TP .B show_job(job_id: str, full_details: bool = False) -> Dict[str, Any] Get details of a given job of the current user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBjob_id\fP (\fIstr\fP) \-\- job ID .IP \(bu 2 \fBfull_details\fP (\fIbool\fP) \-\- when \fBTrue\fP, the complete list of details for the given job. .UNINDENT .TP .B Return type dict .TP .B Returns A description of the given job. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqcreate_time\(aq: \(aq2014\-03\-01T16:17:29.828624\(aq, \(aqexit_code\(aq: 0, \(aqid\(aq: \(aqa799d38679e985db\(aq, \(aqinputs\(aq: {\(aqinput\(aq: {\(aqid\(aq: \(aqebfb8f50c6abde6d\(aq, \(aqsrc\(aq: \(aqhda\(aq}}, \(aqmodel_class\(aq: \(aqJob\(aq, \(aqoutputs\(aq: {\(aqoutput\(aq: {\(aqid\(aq: \(aqa799d38679e985db\(aq, \(aqsrc\(aq: \(aqhda\(aq}}, \(aqparams\(aq: {\(aqchromInfo\(aq: \(aq\(dq/opt/galaxy\-central/tool\-data/shared/ucsc/chrom/?.len\(dq\(aq, \(aqdbkey\(aq: \(aq\(dq?\(dq\(aq, \(aqseq_col\(aq: \(aq\(dq2\(dq\(aq, \(aqtitle_col\(aq: \(aq[\(dq1\(dq]\(aq}, \(aqstate\(aq: \(aqok\(aq, \(aqtool_id\(aq: \(aqtab2fasta\(aq, \(aqupdate_time\(aq: \(aq2014\-03\-01T16:17:31.930728\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_job_lock() -> bool Show whether the job lock is active or not. If it is active, no jobs will dispatch on the Galaxy server. .INDENT 7.0 .TP .B Return type bool .TP .B Returns Status of the job lock .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 20.05 or later and if the user is a Galaxy admin. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_job_lock(active: bool = False) -> bool Update the job lock status by setting \fBactive\fP to either \fBTrue\fP or \fBFalse\fP\&. If \fBTrue\fP, all job dispatching will be blocked. .INDENT 7.0 .TP .B Return type bool .TP .B Returns Updated status of the job lock .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 20.05 or later and if the user is a Galaxy admin. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B wait_for_job(job_id: str, maxwait: float = 12000, interval: float = 3, check: bool = True) -> Dict[str, Any] Wait until a job is in a terminal state. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBjob_id\fP (\fIstr\fP) \-\- job ID .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the job state to become terminal. If the job state is not terminal within this time, a \fBTimeoutException\fP will be raised. .IP \(bu 2 \fBinterval\fP (\fIfloat\fP) \-\- Time (in seconds) to wait between 2 consecutive checks. .IP \(bu 2 \fBcheck\fP (\fIbool\fP) \-\- Whether to check if the job terminal state is \(aqok\(aq. .UNINDENT .TP .B Return type dict .TP .B Returns Details of the given job. .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Libraries .sp Contains possible interactions with the Galaxy Data Libraries .INDENT 0.0 .TP .B class bioblend.galaxy.libraries.LibraryClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B copy_from_dataset(library_id: str, dataset_id: str, folder_id: str | None = None, message: str = \(aq\(aq) -> Dict[str, Any] Copy a Galaxy dataset into a library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library where to place the uploaded file .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset to copy from .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder where to place the uploaded files. If not provided, the root folder will be used .IP \(bu 2 \fBmessage\fP (\fIstr\fP) \-\- message for copying action .UNINDENT .TP .B Return type dict .TP .B Returns LDDA information .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_folder(library_id: str, folder_name: str, description: str | None = None, base_folder_id: str | None = None) -> List[Dict[str, Any]] Create a folder in a library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- library id to use .IP \(bu 2 \fBfolder_name\fP (\fIstr\fP) \-\- name of the new folder in the data library .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- description of the new folder in the data library .IP \(bu 2 \fBbase_folder_id\fP (\fIstr\fP) \-\- id of the folder where to create the new folder. If not provided, the root folder will be used .UNINDENT .TP .B Return type list .TP .B Returns List with a single dictionary containing information about the new folder .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_library(name: str, description: str | None = None, synopsis: str | None = None) -> Dict[str, Any] Create a data library with the properties defined in the arguments. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Name of the new data library .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- Optional data library description .IP \(bu 2 \fBsynopsis\fP (\fIstr\fP) \-\- Optional data library synopsis .UNINDENT .TP .B Return type dict .TP .B Returns Details of the created library. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqid\(aq: \(aqf740ab636b360a70\(aq, \(aqname\(aq: \(aqLibrary from bioblend\(aq, \(aqurl\(aq: \(aq/api/libraries/f740ab636b360a70\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_library(library_id: str) -> Dict[str, Any] Delete a data library. .INDENT 7.0 .TP .B Parameters \fBlibrary_id\fP (\fIstr\fP) \-\- Encoded data library ID identifying the library to be deleted .TP .B Return type dict .TP .B Returns Information about the deleted library .UNINDENT .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Deleting a data library is irreversible \- all of the data from the library will be permanently deleted. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_library_dataset(library_id: str, dataset_id: str, purged: bool = False) -> Dict[str, Any] Delete a library dataset in a data library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- library id where dataset is found in .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset to be deleted .IP \(bu 2 \fBpurged\fP (\fIbool\fP) \-\- Indicate that the dataset should be purged (permanently deleted) .UNINDENT .TP .B Return type dict .TP .B Returns A dictionary containing the dataset id and whether the dataset has been deleted. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqdeleted\(aq: True, \(aqid\(aq: \(aq60e680a037f41974\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_dataset_permissions(dataset_id: str) -> Dict[str, Any] Get the permissions for a dataset. .INDENT 7.0 .TP .B Parameters \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset .TP .B Return type dict .TP .B Returns dictionary with all applicable permissions\(aq values .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_folders(library_id: str, folder_id: str | None = None, name: str | None = None) -> List[Dict[str, Any]] Get all the folders in a library, or select a subset by specifying a folder name for filtering. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- library id to use .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Folder name to filter on. For \fBname\fP specify the full path of the folder starting from the library\(aqs root folder, e.g. \fB/subfolder/subsubfolder\fP\&. .UNINDENT .TP .B Return type list .TP .B Returns list of dicts each containing basic information about a folder .UNINDENT .sp Changed in version 1.1.1: Using the deprecated \fBfolder_id\fP parameter now raises a \fBValueError\fP exception. .UNINDENT .INDENT 7.0 .TP .B get_libraries(library_id: str | None = None, name: str | None = None, deleted: bool | None = False) -> List[Dict[str, Any]] Get all libraries, or select a subset by specifying optional arguments for filtering (e.g. a library name). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Library name to filter on. .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- If \fBFalse\fP (the default), return only non\-deleted libraries. If \fBTrue\fP, return only deleted libraries. If \fBNone\fP, return both deleted and non\-deleted libraries. .UNINDENT .TP .B Return type list .TP .B Returns list of dicts each containing basic information about a library .UNINDENT .sp Changed in version 1.1.1: Using the deprecated \fBlibrary_id\fP parameter now raises a \fBValueError\fP exception. .UNINDENT .INDENT 7.0 .TP .B get_library_permissions(library_id: str) -> Dict[str, Any] Get the permissions for a library. .INDENT 7.0 .TP .B Parameters \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library .TP .B Return type dict .TP .B Returns dictionary with all applicable permissions\(aq values .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqlibraries\(aq .UNINDENT .INDENT 7.0 .TP .B set_dataset_permissions(dataset_id: str, access_in: List[str] | None = None, modify_in: List[str] | None = None, manage_in: List[str] | None = None) -> Dict[str, Any] Set the permissions for a dataset. Note: it will override all security for this dataset even if you leave out a permission type. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset .IP \(bu 2 \fBaccess_in\fP (\fIlist\fP) \-\- list of role ids .IP \(bu 2 \fBmodify_in\fP (\fIlist\fP) \-\- list of role ids .IP \(bu 2 \fBmanage_in\fP (\fIlist\fP) \-\- list of role ids .UNINDENT .TP .B Return type dict .TP .B Returns dictionary with all applicable permissions\(aq values .UNINDENT .UNINDENT .INDENT 7.0 .TP .B set_library_permissions(library_id: str, access_in: List[str] | None = None, modify_in: List[str] | None = None, add_in: List[str] | None = None, manage_in: List[str] | None = None) -> Dict[str, Any] Set the permissions for a library. Note: it will override all security for this library even if you leave out a permission type. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library .IP \(bu 2 \fBaccess_in\fP (\fIlist\fP) \-\- list of role ids .IP \(bu 2 \fBmodify_in\fP (\fIlist\fP) \-\- list of role ids .IP \(bu 2 \fBadd_in\fP (\fIlist\fP) \-\- list of role ids .IP \(bu 2 \fBmanage_in\fP (\fIlist\fP) \-\- list of role ids .UNINDENT .TP .B Return type dict .TP .B Returns General information about the library .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset(library_id: str, dataset_id: str) -> Dict[str, Any] Get details about a given library dataset. The required \fBlibrary_id\fP can be obtained from the datasets\(aqs library content details. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- library id where dataset is found in .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset to be inspected .UNINDENT .TP .B Return type dict .TP .B Returns A dictionary containing information about the dataset in the library .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_folder(library_id: str, folder_id: str) -> Dict[str, Any] Get details about a given folder. The required \fBfolder_id\fP can be obtained from the folder\(aqs library content details. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- library id to inspect folders in .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder to be inspected .UNINDENT .TP .B Return type dict .TP .B Returns Information about the folder .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_library(library_id: str, contents: bool = False) -> Dict[str, Any] Get information about a library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- filter for library by library id .IP \(bu 2 \fBcontents\fP (\fIbool\fP) \-\- whether to get contents of the library (rather than just the library details) .UNINDENT .TP .B Return type dict .TP .B Returns details of the given library .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_library_dataset(dataset_id: str, **kwargs: Any) -> Dict[str, Any] Update library dataset metadata. Some of the attributes that can be modified are documented below. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset to be updated .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Replace library dataset name with the given string .IP \(bu 2 \fBmisc_info\fP (\fIstr\fP) \-\- Replace library dataset misc_info with given string .IP \(bu 2 \fBfile_ext\fP (\fIstr\fP) \-\- Replace library dataset extension (must exist in the Galaxy registry) .IP \(bu 2 \fBgenome_build\fP (\fIstr\fP) \-\- Replace library dataset genome build (dbkey) .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- Replace library dataset tags with the given list .UNINDENT .TP .B Return type dict .TP .B Returns details of the updated dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_contents(library_id: str, pasted_content: str, folder_id: str | None = None, file_type: str = \(aqauto\(aq, dbkey: str = \(aq?\(aq, tags: List[str] | None = None) -> List[Dict[str, Any]] Upload pasted_content to a data library as a new file. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library where to place the uploaded file .IP \(bu 2 \fBpasted_content\fP (\fIstr\fP) \-\- Content to upload into the library .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder where to place the uploaded file. If not provided, the root folder will be used .IP \(bu 2 \fBfile_type\fP (\fIstr\fP) \-\- Galaxy file format name .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- Dbkey .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- A list of tags to add to the datasets .UNINDENT .TP .B Return type list .TP .B Returns List with a single dictionary containing information about the LDDA .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_from_local_path(library_id: str, file_local_path: str, folder_id: str | None = None, file_type: str = \(aqauto\(aq, dbkey: str = \(aq?\(aq, tags: List[str] | None = None) -> List[Dict[str, Any]] Read local file contents from file_local_path and upload data to a library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library where to place the uploaded file .IP \(bu 2 \fBfile_local_path\fP (\fIstr\fP) \-\- path of local file to upload .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder where to place the uploaded file. If not provided, the root folder will be used .IP \(bu 2 \fBfile_type\fP (\fIstr\fP) \-\- Galaxy file format name .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- Dbkey .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- A list of tags to add to the datasets .UNINDENT .TP .B Return type list .TP .B Returns List with a single dictionary containing information about the LDDA .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_from_server(library_id: str, server_dir: str, folder_id: str | None = None, file_type: str = \(aqauto\(aq, dbkey: str = \(aq?\(aq, link_data_only: Literal[\(aqcopy_files\(aq, \(aqlink_to_files\(aq] | None = None, roles: str = \(aq\(aq, preserve_dirs: bool = False, tag_using_filenames: bool = False, tags: List[str] | None = None) -> List[Dict[str, Any]] Upload all files in the specified subdirectory of the Galaxy library import directory to a library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library where to place the uploaded file .IP \(bu 2 \fBserver_dir\fP (\fIstr\fP) \-\- relative path of the subdirectory of \fBlibrary_import_dir\fP to upload. All and only the files (i.e. no subdirectories) contained in the specified directory will be uploaded .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder where to place the uploaded files. If not provided, the root folder will be used .IP \(bu 2 \fBfile_type\fP (\fIstr\fP) \-\- Galaxy file format name .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- Dbkey .IP \(bu 2 \fBlink_data_only\fP (\fIstr\fP) \-\- either \(aqcopy_files\(aq (default) or \(aqlink_to_files\(aq. Setting to \(aqlink_to_files\(aq symlinks instead of copying the files .IP \(bu 2 \fBroles\fP (\fIstr\fP) \-\- .sp ??? .IP \(bu 2 \fBpreserve_dirs\fP (\fIbool\fP) \-\- Indicate whether to preserve the directory structure when importing dir .IP \(bu 2 \fBtag_using_filenames\fP (\fIbool\fP) \-\- .sp Indicate whether to generate dataset tags from filenames. .sp Changed in version 0.14.0: Changed the default from \fBTrue\fP to \fBFalse\fP\&. .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- A list of tags to add to the datasets .UNINDENT .TP .B Return type list .TP .B Returns List with a single dictionary containing information about the LDDA .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only if the Galaxy instance has the \fBlibrary_import_dir\fP option configured in the \fBconfig/galaxy.yml\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_from_url(library_id: str, file_url: str, folder_id: str | None = None, file_type: str = \(aqauto\(aq, dbkey: str = \(aq?\(aq, tags: List[str] | None = None) -> List[Dict[str, Any]] Upload a file to a library from a URL. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library where to place the uploaded file .IP \(bu 2 \fBfile_url\fP (\fIstr\fP) \-\- URL of the file to upload .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder where to place the uploaded file. If not provided, the root folder will be used .IP \(bu 2 \fBfile_type\fP (\fIstr\fP) \-\- Galaxy file format name .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- Dbkey .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- A list of tags to add to the datasets .UNINDENT .TP .B Return type list .TP .B Returns List with a single dictionary containing information about the LDDA .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_from_galaxy_filesystem(library_id: str, filesystem_paths: str, folder_id: str | None = None, file_type: str = \(aqauto\(aq, dbkey: str = \(aq?\(aq, link_data_only: Literal[\(aqcopy_files\(aq, \(aqlink_to_files\(aq] | None = None, roles: str = \(aq\(aq, preserve_dirs: bool = False, tag_using_filenames: bool = False, tags: List[str] | None = None) -> List[Dict[str, Any]] Upload a set of files already present on the filesystem of the Galaxy server to a library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- id of the library where to place the uploaded file .IP \(bu 2 \fBfilesystem_paths\fP (\fIstr\fP) \-\- file paths on the Galaxy server to upload to the library, one file per line .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- id of the folder where to place the uploaded files. If not provided, the root folder will be used .IP \(bu 2 \fBfile_type\fP (\fIstr\fP) \-\- Galaxy file format name .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- Dbkey .IP \(bu 2 \fBlink_data_only\fP (\fIstr\fP) \-\- either \(aqcopy_files\(aq (default) or \(aqlink_to_files\(aq. Setting to \(aqlink_to_files\(aq symlinks instead of copying the files .IP \(bu 2 \fBroles\fP (\fIstr\fP) \-\- .sp ??? .IP \(bu 2 \fBpreserve_dirs\fP (\fIbool\fP) \-\- Indicate whether to preserve the directory structure when importing dir .IP \(bu 2 \fBtag_using_filenames\fP (\fIbool\fP) \-\- .sp Indicate whether to generate dataset tags from filenames. .sp Changed in version 0.14.0: Changed the default from \fBTrue\fP to \fBFalse\fP\&. .IP \(bu 2 \fBtags\fP (\fIlist\fP) \-\- A list of tags to add to the datasets .UNINDENT .TP .B Return type list .TP .B Returns List of dictionaries containing information about each uploaded LDDA. .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only if the Galaxy instance has the \fBallow_path_paste\fP option set to \fBtrue\fP in the \fBconfig/galaxy.yml\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B wait_for_dataset(library_id: str, dataset_id: str, maxwait: float = 12000, interval: float = 3) -> Dict[str, Any] Wait until the library dataset state is terminal (\(aqok\(aq, \(aqempty\(aq, \(aqerror\(aq, \(aqdiscarded\(aq or \(aqfailed_metadata\(aq). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBlibrary_id\fP (\fIstr\fP) \-\- library id where dataset is found in .IP \(bu 2 \fBdataset_id\fP (\fIstr\fP) \-\- id of the dataset to wait for .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Total time (in seconds) to wait for the dataset state to become terminal. If the dataset state is not terminal within this time, a \fBDatasetTimeoutException\fP will be thrown. .IP \(bu 2 \fBinterval\fP (\fIfloat\fP) \-\- Time (in seconds) to wait between 2 consecutive checks. .UNINDENT .TP .B Return type dict .TP .B Returns A dictionary containing information about the dataset in the library .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Quotas .sp Contains possible interactions with the Galaxy Quota .INDENT 0.0 .TP .B class bioblend.galaxy.quotas.QuotaClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B create_quota(name: str, description: str, amount: str, operation: Literal[\(aq+\(aq, \(aq\-\(aq, \(aq=\(aq], default: Literal[\(aqno\(aq, \(aqregistered\(aq, \(aqunregistered\(aq] | None = \(aqno\(aq, in_users: List[str] | None = None, in_groups: List[str] | None = None) -> Dict[str, Any] Create a new quota .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Name for the new quota. This must be unique within a Galaxy instance. .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- Quota description .IP \(bu 2 \fBamount\fP (\fIstr\fP) \-\- Quota size (E.g. \fB10000MB\fP, \fB99 gb\fP, \fB0.2T\fP, \fBunlimited\fP) .IP \(bu 2 \fBoperation\fP (\fIstr\fP) \-\- One of (\fB+\fP, \fB\-\fP, \fB=\fP) .IP \(bu 2 \fBdefault\fP (\fIstr\fP) \-\- Whether or not this is a default quota. Valid values are \fBno\fP, \fBunregistered\fP, \fBregistered\fP\&. None is equivalent to \fBno\fP\&. .IP \(bu 2 \fBin_users\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- A list of user IDs or user emails. .IP \(bu 2 \fBin_groups\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- A list of group IDs or names. .UNINDENT .TP .B Return type dict .TP .B Returns A description of quota. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqurl\(aq: \(aq/galaxy/api/quotas/386f14984287a0f7\(aq, \(aqmodel_class\(aq: \(aqQuota\(aq, \(aqmessage\(aq: \(dqQuota \(aqTesting\(aq has been created with 1 associated users and 0 associated groups.\(dq, \(aqid\(aq: \(aq386f14984287a0f7\(aq, \(aqname\(aq: \(aqTesting\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_quota(quota_id: str) -> str Delete a quota .sp Before a quota can be deleted, the quota must not be a default quota. .INDENT 7.0 .TP .B Parameters \fBquota_id\fP (\fIstr\fP) \-\- Encoded quota ID. .TP .B Return type str .TP .B Returns A description of the changes, mentioning the deleted quota. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \(dqDeleted 1 quotas: Testing\-B\(dq .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_quotas(deleted: bool = False) -> List[Dict[str, Any]] Get a list of quotas .INDENT 7.0 .TP .B Parameters \fBdeleted\fP (\fIbool\fP) \-\- Only return quota(s) that have been deleted .TP .B Return type list .TP .B Returns A list of dicts with details on individual quotas. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqid\(aq: \(aq0604c8a56abe9a50\(aq, \(aqmodel_class\(aq: \(aqQuota\(aq, \(aqname\(aq: \(aqtest \(aq, \(aqurl\(aq: \(aq/api/quotas/0604c8a56abe9a50\(aq}, {\(aqid\(aq: \(aq1ee267091d0190af\(aq, \(aqmodel_class\(aq: \(aqQuota\(aq, \(aqname\(aq: \(aqworkshop\(aq, \(aqurl\(aq: \(aq/api/quotas/1ee267091d0190af\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqquotas\(aq .UNINDENT .INDENT 7.0 .TP .B show_quota(quota_id: str, deleted: bool = False) -> Dict[str, Any] Display information on a quota .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBquota_id\fP (\fIstr\fP) \-\- Encoded quota ID .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Search for quota in list of ones already marked as deleted .UNINDENT .TP .B Return type dict .TP .B Returns A description of quota. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqbytes\(aq: 107374182400, \(aqdefault\(aq: [], \(aqdescription\(aq: \(aqjust testing\(aq, \(aqdisplay_amount\(aq: \(aq100.0 GB\(aq, \(aqgroups\(aq: [], \(aqid\(aq: \(aq0604c8a56abe9a50\(aq, \(aqmodel_class\(aq: \(aqQuota\(aq, \(aqname\(aq: \(aqtest \(aq, \(aqoperation\(aq: \(aq=\(aq, \(aqusers\(aq: []} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B undelete_quota(quota_id: str) -> str Undelete a quota .INDENT 7.0 .TP .B Parameters \fBquota_id\fP (\fIstr\fP) \-\- Encoded quota ID. .TP .B Return type str .TP .B Returns A description of the changes, mentioning the undeleted quota. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \(dqUndeleted 1 quotas: Testing\-B\(dq .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_quota(quota_id: str, name: str | None = None, description: str | None = None, amount: str | None = None, operation: Literal[\(aq+\(aq, \(aq\-\(aq, \(aq=\(aq] | None = None, default: str = \(aqno\(aq, in_users: List[str] | None = None, in_groups: List[str] | None = None) -> str Update an existing quota .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBquota_id\fP (\fIstr\fP) \-\- Encoded quota ID .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Name for the new quota. This must be unique within a Galaxy instance. .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- Quota description. If you supply this parameter, but not the name, an error will be thrown. .IP \(bu 2 \fBamount\fP (\fIstr\fP) \-\- Quota size (E.g. \fB10000MB\fP, \fB99 gb\fP, \fB0.2T\fP, \fBunlimited\fP) .IP \(bu 2 \fBoperation\fP (\fIstr\fP) \-\- One of (\fB+\fP, \fB\-\fP, \fB=\fP). If you wish to change this value, you must also provide the \fBamount\fP, otherwise it will not take effect. .IP \(bu 2 \fBdefault\fP (\fIstr\fP) \-\- Whether or not this is a default quota. Valid values are \fBno\fP, \fBunregistered\fP, \fBregistered\fP\&. Calling this method with \fBdefault=\(dqno\(dq\fP on a non\-default quota will throw an error. Not passing this parameter is equivalent to passing \fBno\fP\&. .IP \(bu 2 \fBin_users\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- A list of user IDs or user emails. .IP \(bu 2 \fBin_groups\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- A list of group IDs or names. .UNINDENT .TP .B Return type str .TP .B Returns A semicolon separated list of changes to the quota. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \(dqQuota \(aqTesting\-A\(aq has been renamed to \(aqTesting\-B\(aq; Quota \(aqTesting\-e\(aq is now \(aq\-100.0 GB\(aq; Quota \(aqTesting\-B\(aq is now the default for unregistered users\(dq .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Roles .sp Contains possible interactions with the Galaxy Roles .INDENT 0.0 .TP .B class bioblend.galaxy.roles.RolesClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B create_role(role_name: str, description: str, user_ids: List[str] | None = None, group_ids: List[str] | None = None) -> Dict[str, Any] Create a new role. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBrole_name\fP (\fIstr\fP) \-\- A name for the new role .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- Description for the new role .IP \(bu 2 \fBuser_ids\fP (\fIlist\fP) \-\- A list of encoded user IDs to add to the new role .IP \(bu 2 \fBgroup_ids\fP (\fIlist\fP) \-\- A list of encoded group IDs to add to the new role .UNINDENT .TP .B Return type dict .TP .B Returns Details of the newly created role. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqdescription\(aq: \(aqdesc\(aq, \(aqurl\(aq: \(aq/api/roles/ebfb8f50c6abde6d\(aq, \(aqmodel_class\(aq: \(aqRole\(aq, \(aqtype\(aq: \(aqadmin\(aq, \(aqid\(aq: \(aqebfb8f50c6abde6d\(aq, \(aqname\(aq: \(aqFoo\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .sp Changed in version 0.15.0: Changed the return value from a 1\-element list to a dict. .UNINDENT .INDENT 7.0 .TP .B get_roles() -> List[Dict[str, Any]] Displays a collection (list) of roles. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dicts with details on individual roles. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(dqid\(dq: \(dqf2db41e1fa331b3e\(dq, \(dqmodel_class\(dq: \(dqRole\(dq, \(dqname\(dq: \(dqFoo\(dq, \(dqurl\(dq: \(dq/api/roles/f2db41e1fa331b3e\(dq}, {\(dqid\(dq: \(dqf597429621d6eb2b\(dq, \(dqmodel_class\(dq: \(dqRole\(dq, \(dqname\(dq: \(dqBar\(dq, \(dqurl\(dq: \(dq/api/roles/f597429621d6eb2b\(dq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqroles\(aq .UNINDENT .INDENT 7.0 .TP .B show_role(role_id: str) -> Dict[str, Any] Display information on a single role .INDENT 7.0 .TP .B Parameters \fBrole_id\fP (\fIstr\fP) \-\- Encoded role ID .TP .B Return type dict .TP .B Returns Details of the given role. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(dqdescription\(dq: \(dqPrivate Role for Foo\(dq, \(dqid\(dq: \(dqf2db41e1fa331b3e\(dq, \(dqmodel_class\(dq: \(dqRole\(dq, \(dqname\(dq: \(dqFoo\(dq, \(dqtype\(dq: \(dqprivate\(dq, \(dqurl\(dq: \(dq/api/roles/f2db41e1fa331b3e\(dq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Tools .sp .ce ---- .ce 0 .sp .SS Tool data tables .sp Contains possible interactions with the Galaxy Tool data tables .INDENT 0.0 .TP .B class bioblend.galaxy.tool_data.ToolDataClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B delete_data_table(data_table_id: str, values: str) -> Dict[str, Any] Delete an item from a data table. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdata_table_id\fP (\fIstr\fP) \-\- ID of the data table .IP \(bu 2 \fBvalues\fP (\fIstr\fP) \-\- a \(dq|\(dq separated list of column contents, there must be a value for all the columns of the data table .UNINDENT .TP .B Return type dict .TP .B Returns Remaining contents of the given data table .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_data_tables() -> List[Dict[str, Any]] Get the list of all data tables. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dicts with details on individual data tables. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(dqmodel_class\(dq: \(dqTabularToolDataTable\(dq, \(dqname\(dq: \(dqfasta_indexes\(dq}, {\(dqmodel_class\(dq: \(dqTabularToolDataTable\(dq, \(dqname\(dq: \(dqbwa_indexes\(dq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqtool_data\(aq .UNINDENT .INDENT 7.0 .TP .B reload_data_table(data_table_id: str) -> Dict[str, Any] Reload a data table. .INDENT 7.0 .TP .B Parameters \fBdata_table_id\fP (\fIstr\fP) \-\- ID of the data table .TP .B Return type dict .TP .B Returns A description of the given data table and its content. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqcolumns\(aq: [\(aqvalue\(aq, \(aqdbkey\(aq, \(aqname\(aq, \(aqpath\(aq], \(aqfields\(aq: [[\(aqtest id\(aq, \(aqtest\(aq, \(aqtest name\(aq, \(aq/opt/galaxy\-dist/tool\-data/test/seq/test id.fa\(aq]], \(aqmodel_class\(aq: \(aqTabularToolDataTable\(aq, \(aqname\(aq: \(aqall_fasta\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_data_table(data_table_id: str) -> Dict[str, Any] Get details of a given data table. .INDENT 7.0 .TP .B Parameters \fBdata_table_id\fP (\fIstr\fP) \-\- ID of the data table .TP .B Return type dict .TP .B Returns A description of the given data table and its content. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqcolumns\(aq: [\(aqvalue\(aq, \(aqdbkey\(aq, \(aqname\(aq, \(aqpath\(aq], \(aqfields\(aq: [[\(aqtest id\(aq, \(aqtest\(aq, \(aqtest name\(aq, \(aq/opt/galaxy\-dist/tool\-data/test/seq/test id.fa\(aq]], \(aqmodel_class\(aq: \(aqTabularToolDataTable\(aq, \(aqname\(aq: \(aqall_fasta\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Tool dependencies .sp Contains interactions dealing with Galaxy dependency resolvers. .INDENT 0.0 .TP .B class bioblend.galaxy.tool_dependencies.ToolDependenciesClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B delete_unused_dependency_paths(paths: List[str]) -> None Delete unused paths .INDENT 7.0 .TP .B Parameters \fBpaths\fP (\fIlist\fP) \-\- paths to delete .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqdependency_resolvers\(aq .UNINDENT .INDENT 7.0 .TP .B summarize_toolbox(index: int | None = None, tool_ids: List[str] | None = None, resolver_type: str | None = None, include_containers: bool = False, container_type: str | None = None, index_by: Literal[\(aqrequirements\(aq, \(aqtools\(aq] = \(aqrequirements\(aq) -> list Summarize requirements across toolbox (for Tool Management grid). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBindex\fP (\fIint\fP) \-\- index of the dependency resolver with respect to the dependency resolvers config file .IP \(bu 2 \fBtool_ids\fP (\fIlist\fP) \-\- tool_ids to return when index_by=tools .IP \(bu 2 \fBresolver_type\fP (\fIstr\fP) \-\- restrict to specified resolver type .IP \(bu 2 \fBinclude_containers\fP (\fIbool\fP) \-\- include container resolvers in resolution .IP \(bu 2 \fBcontainer_type\fP (\fIstr\fP) \-\- restrict to specified container type .IP \(bu 2 \fBindex_by\fP (\fIstr\fP) \-\- By default results are grouped by requirements. Set to \(aqtools\(aq to return one entry per tool. .UNINDENT .TP .B Return type list of dicts .TP .B Returns dictified descriptions of the dependencies, with attribute \fIdependency_type: None\fP if no match was found. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqrequirements\(aq: [{\(aqname\(aq: \(aqgalaxy_sequence_utils\(aq, \(aqspecs\(aq: [], \(aqtype\(aq: \(aqpackage\(aq, \(aqversion\(aq: \(aq1.1.4\(aq}, {\(aqname\(aq: \(aqbx\-python\(aq, \(aqspecs\(aq: [], \(aqtype\(aq: \(aqpackage\(aq, \(aqversion\(aq: \(aq0.8.6\(aq}], \(aqstatus\(aq: [{\(aqcacheable\(aq: False, \(aqdependency_type\(aq: None, \(aqexact\(aq: True, \(aqmodel_class\(aq: \(aqNullDependency\(aq, \(aqname\(aq: \(aqgalaxy_sequence_utils\(aq, \(aqversion\(aq: \(aq1.1.4\(aq}, {\(aqcacheable\(aq: False, \(aqdependency_type\(aq: None, \(aqexact\(aq: True, \(aqmodel_class\(aq: \(aqNullDependency\(aq, \(aqname\(aq: \(aqbx\-python\(aq, \(aqversion\(aq: \(aq0.8.6\(aq}], \(aqtool_ids\(aq: [\(aqvcf_to_maf_customtrack1\(aq]}] .EE .UNINDENT .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 This method works only on Galaxy 20.01 or later and if the user is a Galaxy admin. It relies on an experimental API particularly tied to the GUI and therefore is subject to breaking changes. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B unused_dependency_paths() -> List[str] List unused dependencies .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS ToolShed .sp .ce ---- .ce 0 .sp .SS Users .sp .ce ---- .ce 0 .sp .SS Visual .sp .ce ---- .ce 0 .sp .SS Workflows .sp Contains possible interactions with the Galaxy Workflows .INDENT 0.0 .TP .B class bioblend.galaxy.workflows.WorkflowClient(galaxy_instance: GalaxyInstance) A generic Client interface defining the common fields. .sp All clients \fImust\fP define the following field (which will be used as part of the URL composition (e.g., \fBhttp:///api/libraries\fP): \fBself.module = \(aqworkflows\(aq | \(aqlibraries\(aq | \(aqhistories\(aq | ...\fP .INDENT 7.0 .TP .B cancel_invocation(workflow_id: str, invocation_id: str) -> Dict[str, Any] Cancel the scheduling of a workflow. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .UNINDENT .TP .B Return type dict .TP .B Returns The workflow invocation being cancelled .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_workflow(workflow_id: str) -> None Delete a workflow identified by \fIworkflow_id\fP\&. .INDENT 7.0 .TP .B Parameters \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .UNINDENT .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Deleting a workflow is irreversible in Galaxy versions < 23.01 \- all workflow data will be permanently deleted. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export_workflow_dict(workflow_id: str, version: int | None = None) -> Dict[str, Any] Exports a workflow. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBversion\fP (\fIint\fP) \-\- Workflow version to export .UNINDENT .TP .B Return type dict .TP .B Returns Dictionary representing the requested workflow .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export_workflow_to_local_path(workflow_id: str, file_local_path: str, use_default_filename: bool = True) -> None Exports a workflow in JSON format to a given local path. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBfile_local_path\fP (\fIstr\fP) \-\- Local path to which the exported file will be saved. (Should not contain filename if use_default_name=True) .IP \(bu 2 \fBuse_default_filename\fP (\fIbool\fP) \-\- If the use_default_name parameter is True, the exported file will be saved as file_local_path/Galaxy\-Workflow\-%s.ga, where %s is the workflow name. If use_default_name is False, file_local_path is assumed to contain the full file path including filename. .UNINDENT .TP .B Return type None .TP .B Returns None .UNINDENT .UNINDENT .INDENT 7.0 .TP .B extract_workflow_from_history(history_id: str, workflow_name: str, job_ids: List[str] | None = None, dataset_hids: List[str] | None = None, dataset_collection_hids: List[str] | None = None) -> Dict[str, Any] Extract a workflow from a history. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .IP \(bu 2 \fBworkflow_name\fP (\fIstr\fP) \-\- Name of the workflow to create .IP \(bu 2 \fBjob_ids\fP (\fIlist\fP) \-\- Optional list of job IDs to filter the jobs to extract from the history .IP \(bu 2 \fBdataset_hids\fP (\fIlist\fP) \-\- Optional list of dataset hids corresponding to workflow inputs when extracting a workflow from history .IP \(bu 2 \fBdataset_collection_hids\fP (\fIlist\fP) \-\- Optional list of dataset collection hids corresponding to workflow inputs when extracting a workflow from history .UNINDENT .TP .B Return type dict .TP .B Returns A description of the created workflow .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocations(workflow_id: str) -> List[Dict[str, Any]] Get a list containing all the workflow invocations corresponding to the specified workflow. .sp For more advanced filtering use InvocationClient.get_invocations(). .INDENT 7.0 .TP .B Parameters \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .TP .B Return type list .TP .B Returns A list of workflow invocations. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqhistory_id\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqid\(aq: \(aqdf7a1f0c02a5b08e\(aq, \(aqmodel_class\(aq: \(aqWorkflowInvocation\(aq, \(aqstate\(aq: \(aqnew\(aq, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:22\(aq, \(aquuid\(aq: \(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, \(aqworkflow_id\(aq: \(aq03501d7626bd192f\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_workflow_inputs(workflow_id: str, label: str) -> List[str] Get a list of workflow input IDs that match the given label. If no input matches the given label, an empty list is returned. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBlabel\fP (\fIstr\fP) \-\- label to filter workflow inputs on .UNINDENT .TP .B Return type list .TP .B Returns list of workflow inputs matching the label query .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_workflows(workflow_id: str | None = None, name: str | None = None, published: bool = False) -> List[Dict[str, Any]] Get all workflows, or select a subset by specifying optional arguments for filtering (e.g. a workflow name). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Workflow name to filter on. .IP \(bu 2 \fBpublished\fP (\fIbool\fP) \-\- if \fBTrue\fP, return also published workflows .UNINDENT .TP .B Return type list .TP .B Returns A list of workflow dicts. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX [{\(aqid\(aq: \(aq92c56938c2f9b315\(aq, \(aqname\(aq: \(aqSimple\(aq, \(aqurl\(aq: \(aq/api/workflows/92c56938c2f9b315\(aq}] .EE .UNINDENT .UNINDENT .UNINDENT .sp Changed in version 1.1.1: Using the deprecated \fBworkflow_id\fP parameter now raises a \fBValueError\fP exception. .UNINDENT .INDENT 7.0 .TP .B import_shared_workflow(workflow_id: str) -> Dict[str, Any] Imports a new workflow from the shared published workflows. .INDENT 7.0 .TP .B Parameters \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .TP .B Return type dict .TP .B Returns A description of the workflow. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqid\(aq: \(aqee0e2b4b696d9092\(aq, \(aqmodel_class\(aq: \(aqStoredWorkflow\(aq, \(aqname\(aq: \(aqSuper workflow that solves everything!\(aq, \(aqpublished\(aq: False, \(aqtags\(aq: [], \(aqurl\(aq: \(aq/api/workflows/ee0e2b4b696d9092\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B import_workflow_dict(workflow_dict: Dict[str, Any], publish: bool = False) -> Dict[str, Any] Imports a new workflow given a dictionary representing a previously exported workflow. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_dict\fP (\fIdict\fP) \-\- dictionary representing the workflow to be imported .IP \(bu 2 \fBpublish\fP (\fIbool\fP) \-\- if \fBTrue\fP the uploaded workflow will be published; otherwise it will be visible only by the user which uploads it (default) .UNINDENT .TP .B Return type dict .TP .B Returns Information about the imported workflow. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqname\(aq: \(aqTraining: 16S rRNA sequencing with mothur: main tutorial\(aq, \(aqtags\(aq: [], \(aqdeleted\(aq: false, \(aqlatest_workflow_uuid\(aq: \(aq368c6165\-ccbe\-4945\-8a3c\-d27982206d66\(aq, \(aqurl\(aq: \(aq/api/workflows/94bac0a90086bdcf\(aq, \(aqnumber_of_steps\(aq: 44, \(aqpublished\(aq: false, \(aqowner\(aq: \(aqjane\-doe\(aq, \(aqmodel_class\(aq: \(aqStoredWorkflow\(aq, \(aqid\(aq: \(aq94bac0a90086bdcf\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B import_workflow_from_local_path(file_local_path: str, publish: bool = False) -> Dict[str, Any] Imports a new workflow given the path to a file containing a previously exported workflow. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfile_local_path\fP (\fIstr\fP) \-\- File to upload to the server for new workflow .IP \(bu 2 \fBpublish\fP (\fIbool\fP) \-\- if \fBTrue\fP the uploaded workflow will be published; otherwise it will be visible only by the user which uploads it (default) .UNINDENT .TP .B Return type dict .TP .B Returns Information about the imported workflow. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqname\(aq: \(aqTraining: 16S rRNA sequencing with mothur: main tutorial\(aq, \(aqtags\(aq: [], \(aqdeleted\(aq: false, \(aqlatest_workflow_uuid\(aq: \(aq368c6165\-ccbe\-4945\-8a3c\-d27982206d66\(aq, \(aqurl\(aq: \(aq/api/workflows/94bac0a90086bdcf\(aq, \(aqnumber_of_steps\(aq: 44, \(aqpublished\(aq: false, \(aqowner\(aq: \(aqjane\-doe\(aq, \(aqmodel_class\(aq: \(aqStoredWorkflow\(aq, \(aqid\(aq: \(aq94bac0a90086bdcf\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B invoke_workflow(workflow_id: str, inputs: dict | None = None, params: dict | None = None, history_id: str | None = None, history_name: str | None = None, import_inputs_to_history: bool = False, replacement_params: dict | None = None, allow_tool_state_corrections: bool = False, inputs_by: Literal[\(aqstep_index|step_uuid\(aq, \(aqstep_index\(aq, \(aqstep_id\(aq, \(aqstep_uuid\(aq, \(aqname\(aq] | None = None, parameters_normalized: bool = False, require_exact_tool_versions: bool = True) -> Dict[str, Any] Invoke the workflow identified by \fBworkflow_id\fP\&. This will cause a workflow to be scheduled and return an object describing the workflow invocation. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBinputs\fP (\fIdict\fP) \-\- .sp A mapping of workflow inputs to datasets and dataset collections. The datasets source can be a LibraryDatasetDatasetAssociation (\fBldda\fP), LibraryDataset (\fBld\fP), HistoryDatasetAssociation (\fBhda\fP), or HistoryDatasetCollectionAssociation (\fBhdca\fP). .sp The map must be in the following format: \fB{\(aq\(aq: {\(aqid\(aq: , \(aqsrc\(aq: \(aq[ldda, ld, hda, hdca]\(aq}}\fP (e.g. \fB{\(aq2\(aq: {\(aqid\(aq: \(aq29beef4fadeed09f\(aq, \(aqsrc\(aq: \(aqhda\(aq}}\fP) .sp This map may also be indexed by the UUIDs of the workflow steps, as indicated by the \fBuuid\fP property of steps returned from the Galaxy API. Alternatively workflow steps may be addressed by the label that can be set in the workflow editor. If using uuid or label you need to also set the \fBinputs_by\fP parameter to \fBstep_uuid\fP or \fBname\fP\&. .IP \(bu 2 \fBparams\fP (\fIdict\fP) \-\- A mapping of non\-datasets tool parameters (see below) .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- The encoded history ID where to store the workflow output. Alternatively, \fBhistory_name\fP may be specified to create a new history. .IP \(bu 2 \fBhistory_name\fP (\fIstr\fP) \-\- Create a new history with the given name to store the workflow output. If both \fBhistory_id\fP and \fBhistory_name\fP are provided, \fBhistory_name\fP is ignored. If neither is specified, a new \(aqUnnamed history\(aq is created. .IP \(bu 2 \fBimport_inputs_to_history\fP (\fIbool\fP) \-\- If \fBTrue\fP, used workflow inputs will be imported into the history. If \fBFalse\fP, only workflow outputs will be visible in the given history. .IP \(bu 2 \fBallow_tool_state_corrections\fP (\fIbool\fP) \-\- If True, allow Galaxy to fill in missing tool state when running workflows. This may be useful for workflows using tools that have changed over time or for workflows built outside of Galaxy with only a subset of inputs defined. .IP \(bu 2 \fBreplacement_params\fP (\fIdict\fP) \-\- pattern\-based replacements for post\-job actions (see below) .IP \(bu 2 \fBinputs_by\fP (\fIstr\fP) \-\- Determines how inputs are referenced. Can be \(dqstep_index|step_uuid\(dq (default), \(dqstep_index\(dq, \(dqstep_id\(dq, \(dqstep_uuid\(dq, or \(dqname\(dq. .IP \(bu 2 \fBparameters_normalized\fP (\fIbool\fP) \-\- Whether Galaxy should normalize \fBparams\fP to ensure everything is referenced by a numeric step ID. Default is \fBFalse\fP, but when setting \fBparams\fP for a subworkflow, \fBTrue\fP is required. .IP \(bu 2 \fBrequire_exact_tool_versions\fP (\fIbool\fP) \-\- Whether invocation should fail if Galaxy does not have the exact tool versions. Default is \fBTrue\fP\&. Parameter does not any effect for Galaxy versions < 22.05. .UNINDENT .TP .B Return type dict .TP .B Returns A dict containing the workflow invocation describing the scheduling of the workflow. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqhistory_id\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqid\(aq: \(aqdf7a1f0c02a5b08e\(aq, \(aqinputs\(aq: {\(aq0\(aq: {\(aqid\(aq: \(aqa7db2fac67043c7e\(aq, \(aqsrc\(aq: \(aqhda\(aq, \(aquuid\(aq: \(aq7932ffe0\-2340\-4952\-8857\-dbaa50f1f46a\(aq}}, \(aqmodel_class\(aq: \(aqWorkflowInvocation\(aq, \(aqstate\(aq: \(aqready\(aq, \(aqsteps\(aq: [{\(aqaction\(aq: None, \(aqid\(aq: \(aqd413a19dec13d11e\(aq, \(aqjob_id\(aq: None, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 0, \(aqstate\(aq: None, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aqworkflow_step_id\(aq: \(aqcbbbf59e8f08c98c\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aqb81250fd\-3278\-4e6a\-b269\-56a1f01ef485\(aq}, {\(aqaction\(aq: None, \(aqid\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqjob_id\(aq: \(aqe89067bb68bee7a0\(aq, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 1, \(aqstate\(aq: \(aqnew\(aq, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aqworkflow_step_id\(aq: \(aq964b37715ec9bd22\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aqe62440b8\-e911\-408b\-b124\-e05435d3125e\(aq}], \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aquuid\(aq: \(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, \(aqworkflow_id\(aq: \(aq03501d7626bd192f\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .sp The \fBparams\fP dict should be specified as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX {STEP_ID: PARAM_DICT, ...} .EE .UNINDENT .UNINDENT .sp where PARAM_DICT is: .INDENT 7.0 .INDENT 3.5 .sp .EX {PARAM_NAME: VALUE, ...} .EE .UNINDENT .UNINDENT .sp For backwards compatibility, the following (deprecated) format is also supported for \fBparams\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX {TOOL_ID: PARAM_DICT, ...} .EE .UNINDENT .UNINDENT .sp in which case PARAM_DICT affects all steps with the given tool id. If both by\-tool\-id and by\-step\-id specifications are used, the latter takes precedence. .sp Finally (again, for backwards compatibility), PARAM_DICT can also be specified as: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqparam\(aq: PARAM_NAME, \(aqvalue\(aq: VALUE} .EE .UNINDENT .UNINDENT .sp Note that this format allows only one parameter to be set per step. .sp For a \fBrepeat\fP parameter, the names of the contained parameters needs to be specified as \fB_|\fP, with the repeat index starting at 0. For example, if the tool XML contains: .INDENT 7.0 .INDENT 3.5 .sp .EX .EE .UNINDENT .UNINDENT .sp then the PARAM_DICT should be something like: .INDENT 7.0 .INDENT 3.5 .sp .EX {... \(dqcutoff_0|name\(dq: \(dqn_genes\(dq, \(dqcutoff_0|min\(dq: \(dq2\(dq, \(dqcutoff_1|name\(dq: \(dqn_counts\(dq, \(dqcutoff_1|min\(dq: \(dq4\(dq, ...} .EE .UNINDENT .UNINDENT .sp At the time of this writing, it is not possible to change the number of times the contained parameters are repeated. Therefore, the parameter indexes can go from 0 to n\-1, where n is the number of times the repeated element was added when the workflow was saved in the Galaxy UI. .sp The \fBreplacement_params\fP dict should map parameter names in post\-job actions (PJAs) to their runtime values. For instance, if the final step has a PJA like the following: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqRenameDatasetActionout_file1\(aq: {\(aqaction_arguments\(aq: {\(aqnewname\(aq: \(aq${output}\(aq}, \(aqaction_type\(aq: \(aqRenameDatasetAction\(aq, \(aqoutput_name\(aq: \(aqout_file1\(aq}} .EE .UNINDENT .UNINDENT .sp then the following renames the output dataset to \(aqfoo\(aq: .INDENT 7.0 .INDENT 3.5 .sp .EX replacement_params = {\(aqoutput\(aq: \(aqfoo\(aq} .EE .UNINDENT .UNINDENT .sp see also \fI\%this email thread\fP\&. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Historically, workflow invocation consumed a \fBdataset_map\fP data structure that was indexed by unencoded workflow step IDs. These IDs would not be stable across Galaxy instances. The new \fBinputs\fP property is instead indexed by either the \fBorder_index\fP property (which is stable across workflow imports) or the step UUID which is also stable. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B module: str = \(aqworkflows\(aq .UNINDENT .INDENT 7.0 .TP .B refactor_workflow(workflow_id: str, actions: List[Dict[str, Any]], dry_run: bool = False) -> Dict[str, Any] Refactor workflow with given actions. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBactions\fP (\fIlist\fP\fI of \fP\fIdicts\fP) \-\- .INDENT 2.0 .TP .B Actions to use for refactoring the workflow. The following actions are supported: update_step_label, update_step_position, update_output_label, update_name, update_annotation, update_license, update_creator, update_report, add_step, add_input, disconnect, connect, fill_defaults, fill_step_defaults, extract_input, extract_legacy_parameter, remove_unlabeled_workflow_outputs, upgrade_all_steps, upgrade_subworkflow, upgrade_tool. .UNINDENT .sp An example value for the \fBactions\fP argument might be: .INDENT 2.0 .INDENT 3.5 .sp .EX actions = [ {\(dqaction_type\(dq: \(dqadd_input\(dq, \(dqtype\(dq: \(dqdata\(dq, \(dqlabel\(dq: \(dqfoo\(dq}, {\(dqaction_type\(dq: \(dqupdate_step_label\(dq, \(dqlabel\(dq: \(dqbar\(dq, \(dqstep\(dq: {\(dqlabel\(dq: \(dqfoo\(dq}}, ] .EE .UNINDENT .UNINDENT .IP \(bu 2 \fBdry_run\fP (\fIbool\fP) \-\- When true, perform a dry run where the existing workflow is preserved. The refactored workflow is returned in the output of the method, but not saved on the Galaxy server. .UNINDENT .TP .B Return type dict .TP .B Returns Dictionary containing logged messages for the executed actions and the refactored workflow. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B run_invocation_step_action(workflow_id: str, invocation_id: str, step_id: str, action: Any) -> Dict[str, Any] Execute an action for an active workflow invocation step. The nature of this action and what is expected will vary based on the the type of workflow step (the only currently valid action is True/False for pause steps). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .IP \(bu 2 \fBstep_id\fP (\fIstr\fP) \-\- Encoded workflow invocation step ID .IP \(bu 2 \fBaction\fP (\fIobject\fP) \-\- Action to use when updating state, semantics depends on step type. .UNINDENT .TP .B Return type dict .TP .B Returns Representation of the workflow invocation step .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_invocation(workflow_id: str, invocation_id: str) -> Dict[str, Any] Get a workflow invocation object representing the scheduling of a workflow. This object may be sparse at first (missing inputs and invocation steps) and will become more populated as the workflow is actually scheduled. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .UNINDENT .TP .B Return type dict .TP .B Returns The workflow invocation. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqhistory_id\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqid\(aq: \(aqdf7a1f0c02a5b08e\(aq, \(aqinputs\(aq: {\(aq0\(aq: {\(aqid\(aq: \(aqa7db2fac67043c7e\(aq, \(aqsrc\(aq: \(aqhda\(aq, \(aquuid\(aq: \(aq7932ffe0\-2340\-4952\-8857\-dbaa50f1f46a\(aq}}, \(aqmodel_class\(aq: \(aqWorkflowInvocation\(aq, \(aqstate\(aq: \(aqready\(aq, \(aqsteps\(aq: [{\(aqaction\(aq: None, \(aqid\(aq: \(aqd413a19dec13d11e\(aq, \(aqjob_id\(aq: None, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 0, \(aqstate\(aq: None, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aqworkflow_step_id\(aq: \(aqcbbbf59e8f08c98c\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aqb81250fd\-3278\-4e6a\-b269\-56a1f01ef485\(aq}, {\(aqaction\(aq: None, \(aqid\(aq: \(aq2f94e8ae9edff68a\(aq, \(aqjob_id\(aq: \(aqe89067bb68bee7a0\(aq, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 1, \(aqstate\(aq: \(aqnew\(aq, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aqworkflow_step_id\(aq: \(aq964b37715ec9bd22\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aqe62440b8\-e911\-408b\-b124\-e05435d3125e\(aq}], \(aqupdate_time\(aq: \(aq2015\-10\-31T22:00:26\(aq, \(aquuid\(aq: \(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, \(aqworkflow_id\(aq: \(aq03501d7626bd192f\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_invocation_step(workflow_id: str, invocation_id: str, step_id: str) -> Dict[str, Any] See the details of a particular workflow invocation step. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBinvocation_id\fP (\fIstr\fP) \-\- Encoded workflow invocation ID .IP \(bu 2 \fBstep_id\fP (\fIstr\fP) \-\- Encoded workflow invocation step ID .UNINDENT .TP .B Return type dict .TP .B Returns The workflow invocation step. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqaction\(aq: None, \(aqid\(aq: \(aq63cd3858d057a6d1\(aq, \(aqjob_id\(aq: None, \(aqmodel_class\(aq: \(aqWorkflowInvocationStep\(aq, \(aqorder_index\(aq: 2, \(aqstate\(aq: None, \(aqupdate_time\(aq: \(aq2015\-10\-31T22:11:14\(aq, \(aqworkflow_step_id\(aq: \(aq52e496b945151ee8\(aq, \(aqworkflow_step_label\(aq: None, \(aqworkflow_step_uuid\(aq: \(aq4060554c\-1dd5\-4287\-9040\-8b4f281cf9dc\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_versions(workflow_id: str) -> List[Dict[str, Any]] Get versions for a workflow. .INDENT 7.0 .TP .B Parameters \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .TP .B Return type list of dicts .TP .B Returns Ordered list of version descriptions for this workflow .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_workflow(workflow_id: str, version: int | None = None) -> Dict[str, Any] Display information needed to run a workflow. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBversion\fP (\fIint\fP) \-\- Workflow version to show .UNINDENT .TP .B Return type dict .TP .B Returns A description of the workflow and its inputs. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX {\(aqid\(aq: \(aq92c56938c2f9b315\(aq, \(aqinputs\(aq: {\(aq23\(aq: {\(aqlabel\(aq: \(aqInput Dataset\(aq, \(aqvalue\(aq: \(aq\(aq}}, \(aqname\(aq: \(aqSimple\(aq, \(aqurl\(aq: \(aq/api/workflows/92c56938c2f9b315\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_workflow(workflow_id: str, **kwargs: Any) -> Dict[str, Any] Update a given workflow. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBworkflow\fP (\fIdict\fP) \-\- dictionary representing the workflow to be updated .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- New name of the workflow .IP \(bu 2 \fBannotation\fP (\fIstr\fP) \-\- New annotation for the workflow .IP \(bu 2 \fBmenu_entry\fP (\fIbool\fP) \-\- Whether the workflow should appear in the user\(aqs menu .IP \(bu 2 \fBtags\fP (\fIlist\fP\fI of \fP\fIstr\fP) \-\- Replace workflow tags with the given list .IP \(bu 2 \fBpublished\fP (\fIbool\fP) \-\- Whether the workflow should be published or unpublished .UNINDENT .TP .B Return type dict .TP .B Returns Dictionary representing the updated workflow .UNINDENT .UNINDENT .UNINDENT .SS Object\-oriented Galaxy API .SS Client .SS Wrappers .SS Usage documentation .sp This page describes some sample use cases for the Galaxy API and provides examples for these API calls. In addition to this page, there are functional examples of complete scripts in the \fBdocs/examples\fP directory of the BioBlend source code repository. .SS Connect to a Galaxy server .sp To connect to a running Galaxy server, you will need an account on that Galaxy instance and an API key for the account. Instructions on getting an API key can be found at \fI\%https://galaxyproject.org/develop/api/\fP . .sp To open a connection call: .INDENT 0.0 .INDENT 3.5 .sp .EX from bioblend.galaxy import GalaxyInstance gi = GalaxyInstance(url=\(aqhttp://example.galaxy.url\(aq, key=\(aqyour\-API\-key\(aq) .EE .UNINDENT .UNINDENT .sp We now have a \fBGalaxyInstance\fP object which allows us to interact with the Galaxy server under our account, and access our data. If the account is a Galaxy admin account we also will be able to use this connection to carry out admin actions. .SS View Histories and Datasets .sp Methods for accessing histories and datasets are grouped under \fBGalaxyInstance.histories.*\fP and \fBGalaxyInstance.datasets.*\fP respectively. .sp To get information on the Histories currently in your account, call: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.histories.get_histories() [{\(aqid\(aq: \(aqf3c2b0f3ecac9f02\(aq, \(aqname\(aq: \(aqRNAseq_DGE_BASIC_Prep\(aq, \(aqurl\(aq: \(aq/api/histories/f3c2b0f3ecac9f02\(aq}, {\(aqid\(aq: \(aq8a91dcf1866a80c2\(aq, \(aqname\(aq: \(aqJune demo\(aq, \(aqurl\(aq: \(aq/api/histories/8a91dcf1866a80c2\(aq}] .EE .UNINDENT .UNINDENT .sp This returns a list of dictionaries containing basic metadata, including the id and name of each History. In this case, we have two existing Histories in our account, \(aqRNAseq_DGE_BASIC_Prep\(aq and \(aqJune demo\(aq. To get more detailed information about a History we can pass its id to the \fBshow_history\fP method: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.histories.show_history(\(aqf3c2b0f3ecac9f02\(aq, contents=False) {\(aqannotation\(aq: \(aq\(aq, \(aqcontents_url\(aq: \(aq/api/histories/f3c2b0f3ecac9f02/contents\(aq, \(aqid\(aq: \(aqf3c2b0f3ecac9f02\(aq, \(aqname\(aq: \(aqRNAseq_DGE_BASIC_Prep\(aq, \(aqnice_size\(aq: \(aq93.5 MB\(aq, \(aqstate\(aq: \(aqok\(aq, \(aqstate_details\(aq: {\(aqdiscarded\(aq: 0, \(aqempty\(aq: 0, \(aqerror\(aq: 0, \(aqfailed_metadata\(aq: 0, \(aqnew\(aq: 0, \(aqok\(aq: 7, \(aqpaused\(aq: 0, \(aqqueued\(aq: 0, \(aqrunning\(aq: 0, \(aqsetting_metadata\(aq: 0, \(aqupload\(aq: 0}, \(aqstate_ids\(aq: {\(aqdiscarded\(aq: [], \(aqempty\(aq: [], \(aqerror\(aq: [], \(aqfailed_metadata\(aq: [], \(aqnew\(aq: [], \(aqok\(aq: [\(aqd6842fb08a76e351\(aq, \(aq10a4b652da44e82a\(aq, \(aq81c601a2549966a0\(aq, \(aqa154f05e3bcee26b\(aq, \(aq1352fe19ddce0400\(aq, \(aq06d549c52d753e53\(aq, \(aq9ec54455d6279cc7\(aq], \(aqpaused\(aq: [], \(aqqueued\(aq: [], \(aqrunning\(aq: [], \(aqsetting_metadata\(aq: [], \(aqupload\(aq: []}} .EE .UNINDENT .UNINDENT .sp This gives us a dictionary containing the History\(aqs metadata. With \fBcontents=False\fP (the default), we only get a list of ids of the datasets contained within the History; with \fBcontents=True\fP we would get metadata on each dataset. We can also directly access more detailed information on a particular dataset by passing its id to the \fBshow_dataset\fP method: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.datasets.show_dataset(\(aq10a4b652da44e82a\(aq) {\(aqdata_type\(aq: \(aqfastqsanger\(aq, \(aqdeleted\(aq: False, \(aqfile_size\(aq: 16527060, \(aqgenome_build\(aq: \(aqdm3\(aq, \(aqid\(aq: 17499, \(aqmetadata_data_lines\(aq: None, \(aqmetadata_dbkey\(aq: \(aqdm3\(aq, \(aqmetadata_sequences\(aq: None, \(aqmisc_blurb\(aq: \(aq15.8 MB\(aq, \(aqmisc_info\(aq: \(aqNoneuploaded fastqsanger file\(aq, \(aqmodel_class\(aq: \(aqHistoryDatasetAssociation\(aq, \(aqname\(aq: \(aqC1_R2_1.chr4.fq\(aq, \(aqpurged\(aq: False, \(aqstate\(aq: \(aqok\(aq, \(aqvisible\(aq: True} .EE .UNINDENT .UNINDENT .SS Uploading Datasets to a History .sp To upload a local file to a Galaxy server, you can run the \fBupload_file\fP method, supplying the path to a local file: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.tools.upload_file(\(aqtest.txt\(aq, \(aqf3c2b0f3ecac9f02\(aq) {\(aqimplicit_collections\(aq: [], \(aqjobs\(aq: [{\(aqcreate_time\(aq: \(aq2015\-07\-28T17:52:39.756488\(aq, \(aqexit_code\(aq: None, \(aqid\(aq: \(aq9752b387803d3e1e\(aq, \(aqmodel_class\(aq: \(aqJob\(aq, \(aqstate\(aq: \(aqnew\(aq, \(aqtool_id\(aq: \(aqupload1\(aq, \(aqupdate_time\(aq: \(aq2015\-07\-28T17:52:39.987509\(aq}], \(aqoutput_collections\(aq: [], \(aqoutputs\(aq: [{\(aqcreate_time\(aq: \(aq2015\-07\-28T17:52:39.331176\(aq, \(aqdata_type\(aq: \(aqgalaxy.datatypes.data.Text\(aq, \(aqdeleted\(aq: False, \(aqfile_ext\(aq: \(aqauto\(aq, \(aqfile_size\(aq: 0, \(aqgenome_build\(aq: \(aq?\(aq, \(aqhda_ldda\(aq: \(aqhda\(aq, \(aqhid\(aq: 16, \(aqhistory_content_type\(aq: \(aqdataset\(aq, \(aqhistory_id\(aq: \(aqf3c2b0f3ecac9f02\(aq, \(aqid\(aq: \(aq59c76a119581e190\(aq, \(aqmetadata_data_lines\(aq: None, \(aqmetadata_dbkey\(aq: \(aq?\(aq, \(aqmisc_blurb\(aq: None, \(aqmisc_info\(aq: None, \(aqmodel_class\(aq: \(aqHistoryDatasetAssociation\(aq, \(aqname\(aq: \(aqtest.txt\(aq, \(aqoutput_name\(aq: \(aqoutput0\(aq, \(aqpeek\(aq: \(aq
\(aq, \(aqpurged\(aq: False, \(aqstate\(aq: \(aqqueued\(aq, \(aqtags\(aq: [], \(aqupdate_time\(aq: \(aq2015\-07\-28T17:52:39.611887\(aq, \(aquuid\(aq: \(aqff0ee99b\-7542\-4125\-802d\-7a193f388e7e\(aq, \(aqvisible\(aq: True}]} .EE .UNINDENT .UNINDENT .sp If files are greater than 2GB in size, they will need to be uploaded via FTP. Importing files from the user\(aqs FTP folder can be done via running the upload tool again: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.tools.upload_from_ftp(\(aqtest.txt\(aq, \(aqf3c2b0f3ecac9f02\(aq) {\(aqimplicit_collections\(aq: [], \(aqjobs\(aq: [{\(aqcreate_time\(aq: \(aq2015\-07\-28T17:57:43.704394\(aq, \(aqexit_code\(aq: None, \(aqid\(aq: \(aq82b264d8c3d11790\(aq, \(aqmodel_class\(aq: \(aqJob\(aq, \(aqstate\(aq: \(aqnew\(aq, \(aqtool_id\(aq: \(aqupload1\(aq, \(aqupdate_time\(aq: \(aq2015\-07\-28T17:57:43.910958\(aq}], \(aqoutput_collections\(aq: [], \(aqoutputs\(aq: [{\(aqcreate_time\(aq: \(aq2015\-07\-28T17:57:43.209041\(aq, \(aqdata_type\(aq: \(aqgalaxy.datatypes.data.Text\(aq, \(aqdeleted\(aq: False, \(aqfile_ext\(aq: \(aqauto\(aq, \(aqfile_size\(aq: 0, \(aqgenome_build\(aq: \(aq?\(aq, \(aqhda_ldda\(aq: \(aqhda\(aq, \(aqhid\(aq: 17, \(aqhistory_content_type\(aq: \(aqdataset\(aq, \(aqhistory_id\(aq: \(aqf3c2b0f3ecac9f02\(aq, \(aqid\(aq: \(aqa676e8f07209a3be\(aq, \(aqmetadata_data_lines\(aq: None, \(aqmetadata_dbkey\(aq: \(aq?\(aq, \(aqmisc_blurb\(aq: None, \(aqmisc_info\(aq: None, \(aqmodel_class\(aq: \(aqHistoryDatasetAssociation\(aq, \(aqname\(aq: \(aqtest.txt\(aq, \(aqoutput_name\(aq: \(aqoutput0\(aq, \(aqpeek\(aq: \(aq
\(aq, \(aqpurged\(aq: False, \(aqstate\(aq: \(aqqueued\(aq, \(aqtags\(aq: [], \(aqupdate_time\(aq: \(aq2015\-07\-28T17:57:43.544407\(aq, \(aquuid\(aq: \(aq2cbe8f0a\-4019\-47c4\-87e2\-005ce35b8449\(aq, \(aqvisible\(aq: True}]} .EE .UNINDENT .UNINDENT .SS View Data Libraries .sp Methods for accessing Data Libraries are grouped under \fBGalaxyInstance.libraries.*\fP\&. Most Data Library methods are available to all users, but as only administrators can create new Data Libraries within Galaxy, the \fBcreate_folder\fP and \fBcreate_library\fP methods can only be called using an API key belonging to an admin account. .sp We can view the Data Libraries available to our account using: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.libraries.get_libraries() [{\(aqid\(aq: \(aq8e6f930d00d123ea\(aq, \(aqname\(aq: \(aqRNA\-seq workshop data\(aq, \(aqurl\(aq: \(aq/api/libraries/8e6f930d00d123ea\(aq}, {\(aqid\(aq: \(aqf740ab636b360a70\(aq, \(aqname\(aq: \(aq1000 genomes\(aq, \(aqurl\(aq: \(aq/api/libraries/f740ab636b360a70\(aq}] .EE .UNINDENT .UNINDENT .sp This gives a list of metadata dictionaries with basic information on each library. We can get more information on a particular Data Library by passing its id to the \fBshow_library\fP method: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.libraries.show_library(\(aq8e6f930d00d123ea\(aq) {\(aqcontents_url\(aq: \(aq/api/libraries/8e6f930d00d123ea/contents\(aq, \(aqdescription\(aq: \(aqRNA\-Seq workshop data\(aq, \(aqname\(aq: \(aqRNA\-Seq\(aq, \(aqsynopsis\(aq: \(aqData for the RNA\-Seq tutorial\(aq} .EE .UNINDENT .UNINDENT .SS Upload files to a Data Library .sp We can get files into Data Libraries in several ways: by uploading from our local machine, by retrieving from a URL, by passing the new file content directly into the method, or by importing a file from the filesystem on the Galaxy server. .sp For instance, to upload a file from our machine we might call: .sp .EX >>> gi.libraries.upload_file_from_local_path(\(aq8e6f930d00d123ea\(aq, \(aq/local/path/to/mydata.fastq\(aq, file_type=\(aqfastqsanger\(aq) .EE .sp Note that we have provided the id of the destination Data Library, and in this case we have specified the type that Galaxy should assign to the new dataset. The default value for \fBfile_type\fP is \(aqauto\(aq, in which case Galaxy will attempt to guess the dataset type. .SS View Workflows .sp Methods for accessing workflows are grouped under \fBGalaxyInstance.workflows.*\fP\&. .sp To get information on the Workflows currently in your account, use: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.workflows.get_workflows() [{\(aqid\(aq: \(aqe8b85ad72aefca86\(aq, \(aqname\(aq: \(aqTopHat + cufflinks part 1\(aq, \(aqurl\(aq: \(aq/api/workflows/e8b85ad72aefca86\(aq}, {\(aqid\(aq: \(aqb0631c44aa74526d\(aq, \(aqname\(aq: \(aqCuffDiff\(aq, \(aqurl\(aq: \(aq/api/workflows/b0631c44aa74526d\(aq}] .EE .UNINDENT .UNINDENT .sp This returns a list of metadata dictionaries. We can get the details of a particular Workflow, including its steps, by passing its id to the \fBshow_workflow\fP method: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.workflows.show_workflow(\(aqe8b85ad72aefca86\(aq) {\(aqid\(aq: \(aqe8b85ad72aefca86\(aq, \(aqinputs\(aq: {\(aq252\(aq: {\(aqlabel\(aq: \(aqInput RNA\-seq fastq\(aq, \(aqvalue\(aq: \(aq\(aq}}, \(aqname\(aq: \(aqTopHat + cufflinks part 1\(aq, \(aqsteps\(aq: {\(aq250\(aq: {\(aqid\(aq: 250, \(aqinput_steps\(aq: {\(aqinput1\(aq: {\(aqsource_step\(aq: 252, \(aqstep_output\(aq: \(aqoutput\(aq}}, \(aqtool_id\(aq: \(aqtophat\(aq, \(aqtype\(aq: \(aqtool\(aq}, \(aq251\(aq: {\(aqid\(aq: 251, \(aqinput_steps\(aq: {\(aqinput\(aq: {\(aqsource_step\(aq: 250, \(aqstep_output\(aq: \(aqaccepted_hits\(aq}}, \(aqtool_id\(aq: \(aqcufflinks\(aq, \(aqtype\(aq: \(aqtool\(aq}, \(aq252\(aq: {\(aqid\(aq: 252, \(aqinput_steps\(aq: {}, \(aqtool_id\(aq: None, \(aqtype\(aq: \(aqdata_input\(aq}}, \(aqurl\(aq: \(aq/api/workflows/e8b85ad72aefca86\(aq} .EE .UNINDENT .UNINDENT .SS Export or import a workflow .sp Workflows can be exported from or imported into Galaxy. This makes it possible to archive workflows, or to move them between Galaxy instances. .sp To export a workflow, we can call: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> workflow_dict = gi.workflows.export_workflow_dict(\(aqe8b85ad72aefca86\(aq) .EE .UNINDENT .UNINDENT .sp This gives us a complex dictionary representing the workflow. We can import this dictionary as a new workflow with: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.workflows.import_workflow_dict(workflow_dict) {\(aqid\(aq: \(aqc0bacafdfe211f9a\(aq, \(aqname\(aq: \(aqTopHat + cufflinks part 1 (imported from API)\(aq, \(aqurl\(aq: \(aq/api/workflows/c0bacafdfe211f9a\(aq} .EE .UNINDENT .UNINDENT .sp This call returns a dictionary containing basic metadata on the new workflow. Since in this case we have imported the dictionary into the original Galaxy instance, we now have a duplicate of the original workflow in our account: .sp .EX >>> gi.workflows.get_workflows() [{\(aqid\(aq: \(aqc0bacafdfe211f9a\(aq, \(aqname\(aq: \(aqTopHat + cufflinks part 1 (imported from API)\(aq, \(aqurl\(aq: \(aq/api/workflows/c0bacafdfe211f9a\(aq}, {\(aqid\(aq: \(aqe8b85ad72aefca86\(aq, \(aqname\(aq: \(aqTopHat + cufflinks part 1\(aq, \(aqurl\(aq: \(aq/api/workflows/e8b85ad72aefca86\(aq}, {\(aqid\(aq: \(aqb0631c44aa74526d\(aq, \(aqname\(aq: \(aqCuffDiff\(aq, \(aqurl\(aq: \(aq/api/workflows/b0631c44aa74526d\(aq}] .EE .sp Instead of using dictionaries directly, workflows can be exported to or imported from files on the local disk using the \fBexport_workflow_to_local_path\fP and \fBimport_workflow_from_local_path\fP methods. See the \fI\%API reference\fP for details. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If we export a workflow from one Galaxy instance and import it into another, Galaxy will only run it without modification if it has the same versions of the tool wrappers installed. This is to ensure reproducibility. Otherwise, we will need to manually update the workflow to use the new tool versions. .UNINDENT .UNINDENT .SS Invoke a workflow .sp To invoke a workflow, we need to tell Galaxy which datasets to use for which workflow inputs. We can use datasets from histories or data libraries. .sp Examine the workflow above. We can see that it takes only one input file. That is: .sp .EX >>> wf = gi.workflows.show_workflow(\(aqe8b85ad72aefca86\(aq) >>> wf[\(aqinputs\(aq] {\(aq252\(aq: {\(aqlabel\(aq: \(aqInput RNA\-seq fastq\(aq, \(aqvalue\(aq: \(aq\(aq}} .EE .sp There is one input, labelled \(aqInput RNA\-seq fastq\(aq. This input is passed to the Tophat tool and should be a fastq file. We will use the dataset we examined above, under \fI\%View Histories and Datasets\fP, which had name \(aqC1_R2_1.chr4.fq\(aq and id \(aq10a4b652da44e82a\(aq. .sp To specify the inputs, we build a data map and pass this to the \fBinvoke_workflow\fP method. This data map is a nested dictionary object which maps inputs to datasets. We call: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> datamap = {\(aq252\(aq: {\(aqsrc\(aq:\(aqhda\(aq, \(aqid\(aq:\(aq10a4b652da44e82a\(aq}} >>> gi.workflows.invoke_workflow(\(aqe8b85ad72aefca86\(aq, inputs=datamap, history_name=\(aqNew output history\(aq) {\(aqhistory\(aq: \(aq0a7b7992a7cabaec\(aq, \(aqoutputs\(aq: [\(aq33be8ad9917d9207\(aq, \(aqfbee1c2dc793c114\(aq, \(aq85866441984f9e28\(aq, \(aq1c51aa78d3742386\(aq, \(aqa68e8770e52d03b4\(aq, \(aqc54baf809e3036ac\(aq, \(aqba0db8ce6cd1fe8f\(aq, \(aqc019e4cf08b2ac94\(aq]} .EE .UNINDENT .UNINDENT .sp In this case the only input id is \(aq252\(aq and the corresponding dataset id is \(aq10a4b652da44e82a\(aq. We have specified the dataset source to be \(aqhda\(aq (HistoryDatasetAssociation) since the dataset is stored in a History. See the \fI\%API reference\fP for allowed dataset specifications. We have also requested that a new History be created and used to store the results of the run, by setting \fBhistory_name=\(aqNew output history\(aq\fP\&. .sp The \fBinvoke_workflow\fP call submits all the jobs which need to be run to the Galaxy workflow engine, with the appropriate dependencies so that they will run in order. The call returns immediately, so we can continue to submit new jobs while waiting for this workflow to execute. \fBinvoke_workflow\fP returns the a dictionary describing the workflow invocation. .sp If we view the output History immediately after calling \fBinvoke_workflow\fP, we will see something like: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> gi.histories.show_history(\(aq0a7b7992a7cabaec\(aq) {\(aqannotation\(aq: \(aq\(aq, \(aqcontents_url\(aq: \(aq/api/histories/0a7b7992a7cabaec/contents\(aq, \(aqid\(aq: \(aq0a7b7992a7cabaec\(aq, \(aqname\(aq: \(aqNew output history\(aq, \(aqnice_size\(aq: \(aq0 bytes\(aq, \(aqstate\(aq: \(aqqueued\(aq, \(aqstate_details\(aq: {\(aqdiscarded\(aq: 0, \(aqempty\(aq: 0, \(aqerror\(aq: 0, \(aqfailed_metadata\(aq: 0, \(aqnew\(aq: 0, \(aqok\(aq: 0, \(aqpaused\(aq: 0, \(aqqueued\(aq: 8, \(aqrunning\(aq: 0, \(aqsetting_metadata\(aq: 0, \(aqupload\(aq: 0}, \(aqstate_ids\(aq: {\(aqdiscarded\(aq: [], \(aqempty\(aq: [], \(aqerror\(aq: [], \(aqfailed_metadata\(aq: [], \(aqnew\(aq: [], \(aqok\(aq: [], \(aqpaused\(aq: [], \(aqqueued\(aq: [\(aq33be8ad9917d9207\(aq, \(aqfbee1c2dc793c114\(aq, \(aq85866441984f9e28\(aq, \(aq1c51aa78d3742386\(aq, \(aqa68e8770e52d03b4\(aq, \(aqc54baf809e3036ac\(aq, \(aqba0db8ce6cd1fe8f\(aq, \(aqc019e4cf08b2ac94\(aq], \(aqrunning\(aq: [], \(aqsetting_metadata\(aq: [], \(aqupload\(aq: []}} .EE .UNINDENT .UNINDENT .sp In this case, because the submitted jobs have not had time to run, the output History contains 8 datasets in the \(aqqueued\(aq state and has a total size of 0 bytes. If we make this call again later we should instead see completed output files. .SS View Users .sp Methods for managing users are grouped under \fBGalaxyInstance.users.*\fP\&. User management is only available to Galaxy administrators, that is, the API key used to connect to Galaxy must be that of an admin account. .sp To get a list of users, call: .sp .EX >>> gi.users.get_users() [{\(aqemail\(aq: \(aquserA@example.org\(aq, \(aqid\(aq: \(aq975a9ce09b49502a\(aq, \(aqquota_percent\(aq: None, \(aqurl\(aq: \(aq/api/users/975a9ce09b49502a\(aq}, {\(aqemail\(aq: \(aquserB@example.org\(aq, \(aqid\(aq: \(aq0193a95acf427d2c\(aq, \(aqquota_percent\(aq: None, \(aqurl\(aq: \(aq/api/users/0193a95acf427d2c\(aq}] .EE .SS Using BioBlend for raw API calls .sp BioBlend can be used to make HTTP requests to the Galaxy API in a more convenient way than using e.g. the \fBrequests\fP Python library. There are 5 available methods corresponding to the most common HTTP methods: \fBmake_get_request\fP, \fBmake_post_request\fP, \fBmake_put_request\fP, \fBmake_delete_request\fP and \fBmake_patch_request\fP\&. One advantage of using these methods is that the API keys stored in the \fBGalaxyInstance\fP object is automatically added to the request. .sp To make a GET request to the Galaxy API with BioBlend, call: .sp .EX >>> gi.make_get_request(gi.base_url + \(dq/api/version\(dq).json() {\(aqversion_major\(aq: \(aq19.05\(aq, \(aqextra\(aq: {}} .EE .sp To make a POST request to the Galaxy API with BioBlend, call: .sp .EX >>> gi.make_post_request(gi.base_url + \(dq/api/histories\(dq, payload={\(dqname\(dq: \(dqtest history\(dq}) {\(aqimportable\(aq: False, \(aqcreate_time\(aq: \(aq2019\-07\-05T20:10:04.823716\(aq, \(aqcontents_url\(aq: \(aq/api/histories/a77b3f95070d689a/contents\(aq, \(aqid\(aq: \(aqa77b3f95070d689a\(aq, \(aqsize\(aq: 0, \(aquser_id\(aq: \(aq5b732999121d4593\(aq, \(aqusername_and_slug\(aq: None, \(aqannotation\(aq: None, \(aqstate_details\(aq: {\(aqdiscarded\(aq: 0, \(aqok\(aq: 0, \(aqfailed_metadata\(aq: 0, \(aqupload\(aq: 0, \(aqpaused\(aq: 0, \(aqrunning\(aq: 0, \(aqsetting_metadata\(aq: 0, \(aqerror\(aq: 0, \(aqnew\(aq: 0, \(aqqueued\(aq: 0, \(aqempty\(aq: 0}, \(aqstate\(aq: \(aqnew\(aq, \(aqempty\(aq: True, \(aqupdate_time\(aq: \(aq2019\-07\-05T20:10:04.823742\(aq, \(aqtags\(aq: [], \(aqdeleted\(aq: False, \(aqgenome_build\(aq: None, \(aqslug\(aq: None, \(aqname\(aq: \(aqtest history\(aq, \(aqurl\(aq: \(aq/api/histories/a77b3f95070d689a\(aq, \(aqstate_ids\(aq: {\(aqdiscarded\(aq: [], \(aqok\(aq: [], \(aqfailed_metadata\(aq: [], \(aqupload\(aq: [], \(aqpaused\(aq: [], \(aqrunning\(aq: [], \(aqsetting_metadata\(aq: [], \(aqerror\(aq: [], \(aqnew\(aq: [], \(aqqueued\(aq: [], \(aqempty\(aq: []}, \(aqpublished\(aq: False, \(aqmodel_class\(aq: \(aqHistory\(aq, \(aqpurged\(aq: False} .EE .SS Toolshed API .sp API used to interact with the Galaxy Toolshed, including repository management. .SS API documentation for interacting with the Galaxy Toolshed .SS ToolShedInstance .SS Categories .SS Repositories .SS Tools .SH CONFIGURATION .sp BioBlend allows library\-wide configuration to be set in external files. These configuration files can be used to specify access keys, for example. .SS Configuration documents for BioBlend .SS BioBlend .INDENT 0.0 .TP .B exception bioblend.ConnectionError(message: str, body: bytes | str | None = None, status_code: int | None = None) An exception class that is raised when unexpected HTTP responses come back. .sp Should make it easier to debug when strange HTTP things happen such as a proxy server getting in the way of the request etc. @see: body attribute to see the content of the http response .UNINDENT .INDENT 0.0 .TP .B class bioblend.NullHandler(level=0) Initializes the instance \- basically setting the formatter to None and the filter list to empty. .INDENT 7.0 .TP .B emit(record: LogRecord) -> None Do whatever it takes to actually log the specified logging record. .sp This version is intended to be implemented by subclasses and so raises a NotImplementedError. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception bioblend.TimeoutException .UNINDENT .INDENT 0.0 .TP .B bioblend.get_version() -> str Returns a string with the current version of the library (e.g., \(dq0.2.0\(dq) .UNINDENT .INDENT 0.0 .TP .B bioblend.init_logging() -> None Initialize BioBlend\(aqs logging from a configuration file. .UNINDENT .INDENT 0.0 .TP .B bioblend.set_file_logger(name: str, filepath: str, level: int | str = 20, format_string: str | None = None) -> None .UNINDENT .INDENT 0.0 .TP .B bioblend.set_stream_logger(name: str, level: int | str = 10, format_string: str | None = None) -> None .UNINDENT .SS Config .INDENT 0.0 .TP .B class bioblend.config.Config(path: str | None = None, fp: IO[str] | None = None, do_load: bool = True) BioBlend allows library\-wide configuration to be set in external files. These configuration files can be used to specify access keys, for example. By default we use two locations for the BioBlend configurations: .INDENT 7.0 .IP \(bu 2 System wide: \fB/etc/bioblend.cfg\fP .IP \(bu 2 Individual user: \fB~/.bioblend\fP (which works on both Windows and Unix) .UNINDENT .UNINDENT .SH TESTING .sp If you would like to do more than just a mock test, you need to point BioBlend to an instance of Galaxy. Do so by exporting the following two variables: .INDENT 0.0 .INDENT 3.5 .sp .EX $ export BIOBLEND_GALAXY_URL=http://127.0.0.1:8080 $ export BIOBLEND_GALAXY_API_KEY= .EE .UNINDENT .UNINDENT .sp The unit tests, stored in the \fBtests\fP folder, can be run using \fI\%pytest\fP\&. From the project root: .INDENT 0.0 .INDENT 3.5 .sp .EX $ pytest .EE .UNINDENT .UNINDENT .SH GETTING HELP .sp If you have run into issues, found a bug, or can\(aqt seem to find an answer to your question regarding the use and functionality of BioBlend, please use the \fI\%Github Issues\fP page to ask your question. .SH RELATED DOCUMENTATION .sp Links to other documentation and libraries relevant to this library: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fI\%Galaxy API documentation\fP .IP \(bu 2 \fI\%Blend4j\fP: Galaxy API wrapper for Java .IP \(bu 2 \fI\%clj\-blend\fP: Galaxy API wrapper for Clojure .UNINDENT .UNINDENT .UNINDENT .SH INDICES AND TABLES .INDENT 0.0 .IP \(bu 2 \fI\%Index\fP .IP \(bu 2 \fI\%Module Index\fP .IP \(bu 2 \fI\%Search Page\fP .UNINDENT .SH AUTHOR Galaxy Project .SH COPYRIGHT 2012-2024, Galaxy Project .\" Generated by docutils manpage writer. .