.\" Man page generated from reStructuredText. . .TH "BIOBLEND" "1" "Jul 06, 2016" "0.7.0" "BioBlend" .SH NAME bioblend \- BioBlend Documentation . .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 .. .SH ABOUT .sp \fI\%BioBlend\fP is a Python library for interacting with \fI\%CloudMan\fP and \fI\%Galaxy\fP\(aqs API. .sp BioBlend is supported and tested on: .INDENT 0.0 .IP \(bu 2 Python 2.6, 2.7, 3.3 and 3.4 .IP \(bu 2 Galaxy release_14.02 and later. .UNINDENT .sp Conceptually, it makes it possible to script and automate the process of cloud infrastructure provisioning and scaling via CloudMan, and running of analyses via Galaxy. In reality, it makes it possible to do things like this: .INDENT 0.0 .IP \(bu 2 Create a CloudMan compute cluster, via an API and directly from your local machine: .INDENT 2.0 .INDENT 3.5 .sp .nf .ft C from bioblend.cloudman import CloudManConfig from bioblend.cloudman import CloudManInstance cfg = CloudManConfig(\(aq\(aq, \(aq\(aq, \(aqMy CloudMan\(aq, \(aqami\-\(aq, \(aqm1.small\(aq, \(aq\(aq) cmi = CloudManInstance.launch_instance(cfg) cmi.get_status() .ft P .fi .UNINDENT .UNINDENT .IP \(bu 2 Reconnect to an existing CloudMan instance and manipulate it: .INDENT 2.0 .INDENT 3.5 .sp .nf .ft C from bioblend.cloudman import CloudManInstance cmi = CloudManInstance("", "") cmi.add_nodes(3) cluster_status = cmi.get_status() cmi.remove_nodes(2) .ft P .fi .UNINDENT .UNINDENT .IP \(bu 2 Interact with Galaxy via a straightforward API: .INDENT 2.0 .INDENT 3.5 .sp .nf .ft C 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) gi.workflows.run_workflow(\(aqworkflow ID\(aq, input_dataset_map) .ft P .fi .UNINDENT .UNINDENT .IP \(bu 2 Interact with Galaxy via an object\-oriented API: .INDENT 2.0 .INDENT 3.5 .sp .nf .ft C from bioblend.galaxy.objects import GalaxyInstance gi = GalaxyInstance("URL", "API_KEY") wf = gi.workflows.list()[0] hist = gi.histories.list()[0] inputs = hist.get_datasets()[:2] input_map = dict(zip(wf.input_labels, inputs)) params = {"Paste1": {"delimiter": "U"}} wf.run(input_map, "wf_output", params=params) .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Although this library allows you to blend these two services into a cohesive unit, the library itself can be used with either service irrespective of the other. For example, you can use it to just manipulate CloudMan clusters or to script the interactions with an instance of Galaxy running on your laptop. .UNINDENT .UNINDENT .SH INSTALLATION .sp Stable releases of BioBlend are best installed via \fBpip\fP or \fBeasy_install\fP from PyPI using something like: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ pip install bioblend .ft P .fi .UNINDENT .UNINDENT .sp Alternatively, you may install the most current source code from our \fI\%Git repository\fP, or fork the project on Github. To install from source, do the following: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C # Clone the repository to a local directory $ git clone https://github.com/galaxyproject/bioblend.git # Install the library $ cd bioblend $ python setup.py install .ft P .fi .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 \fBpython 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 .nf .ft C $ python setup.py test .ft P .fi .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 object\-oriented API 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 CloudMan API .sp API used to manipulate the instantiated infrastructure. For example, scale the size of the compute cluster, get infrastructure status, get service status. .SS API documentation for interacting with CloudMan .SS CloudManLauncher .SS CloudManInstance .SS Usage documentation .sp This page describes some sample use cases for CloudMan API and provides examples for these API calls. In addition to this page, there are functional examples of complete scripts in \fBdocs/examples\fP directory of the BioBlend source code repository. .SS Setting up custom cloud properties .sp CloudMan supports Amazon, OpenStack, OpenNebula, and Eucalyptus based clouds and BioBlend can be used to programatically manipulate CloudMan on any of those clouds. Once launched, the API calls to CloudMan are the same irrespective of the cloud. In order to launch an instance on a given cloud, cloud properties need to be provided to \fBCloudManLauncher\fP\&. If cloud properties are not specified, \fBCloudManLauncher\fP will default to Amazon cloud properties. .sp If we want to use a different cloud provider, we need to specify additional cloud properties when creating an instance of the \fBCloudManLauncher\fP class. For example, if we wanted to create a connection to \fI\%NeCTAR\fP, Australia\(aqs national research cloud, we would use the following properties: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C from bioblend.util import Bunch nectar = Bunch( name=\(aqNeCTAR\(aq, cloud_type=\(aqopenstack\(aq, bucket_default=\(aqcloudman\-os\(aq, region_name=\(aqNeCTAR\(aq, region_endpoint=\(aqnova.rc.nectar.org.au\(aq, ec2_port=8773, ec2_conn_path=\(aq/services/Cloud\(aq, cidr_range=\(aq115.146.92.0/22\(aq, is_secure=True, s3_host=\(aqswift.rc.nectar.org.au\(aq, s3_port=8888, s3_conn_path=\(aq/\(aq) .ft P .fi .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 These properties are cloud\-specific and need to be obtained from a given cloud provider. .UNINDENT .UNINDENT .SS Launching a new cluster instance .sp In order to launch a CloudMan cluster on a chosen cloud, we do the following (continuing from the previous example): .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C from bioblend.cloudman import CloudManConfig from bioblend.cloudman import CloudManInstance cmc = CloudManConfig(\(aq\(aq, \(aqm1.medium\(aq, \(aqchoose_a_password_here\(aq, nectar) cmi = CloudManInstance.launch_instance(cmc) .ft P .fi .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If you already have an existing instance of CloudMan, just create an instance of the \fBCloudManInstance\fP object directly by calling its constructor and connecting to it (the password you provide must match the password you provided as part of user data when launching this instance). For example: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C cmi = CloudManInstance(\(aqhttp://115.146.92.174\(aq, \(aqyour_UD_password\(aq) .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp We now have a \fBCloudManInstance\fP object that allows us to manage created CloudMan instance via the API. Once launched, it will take a few minutes for the instance to boot and CloudMan start. To check on the status of the machine, (repeatedly) run the following command: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C >>> cmi.get_machine_status() {\(aqerror\(aq: \(aq\(aq, \(aqinstance_state\(aq: u\(aqpending\(aq, \(aqplacement\(aq: \(aq\(aq, \(aqpublic_ip\(aq: \(aq\(aq} >>> cmi.get_machine_status() {\(aqerror\(aq: \(aq\(aq, \(aqinstance_state\(aq: u\(aqrunning\(aq, \(aqplacement\(aq: u\(aqmelbourne\-qh2\(aq, \(aqpublic_ip\(aq: u\(aq115.146.86.29\(aq} .ft P .fi .UNINDENT .UNINDENT .sp Once the instance is ready, although it may still take a few moments for CloudMan to start, it is possible to start interacting with the application. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The \fBCloudManInstance\fP object (e.g., \fBcmi\fP) is a local representation of the actual CloudMan instance. As a result, the local object can get out of sync with the remote instance. To update the state of the local object, call the \fBupdate\fP method on the \fBcmi\fP object: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C >>> cmi.update() .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Manipulating an existing cluster .sp Having a reference to a \fBCloudManInstance\fP object, we can manage it via the available cloudman\-instance\-api API: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C >>> cmi.initialized False >>> cmi.initialize(\(aqSGE\(aq) >>> cmi.get_status() {u\(aqall_fs\(aq: [], u\(aqapp_status\(aq: u\(aqyellow\(aq, u\(aqautoscaling\(aq: {u\(aqas_max\(aq: u\(aqN/A\(aq, u\(aqas_min\(aq: u\(aqN/A\(aq, u\(aquse_autoscaling\(aq: False}, u\(aqcluster_status\(aq: u\(aqSTARTING\(aq, u\(aqdata_status\(aq: u\(aqgreen\(aq, u\(aqdisk_usage\(aq: {u\(aqpct\(aq: u\(aq0%\(aq, u\(aqtotal\(aq: u\(aq0\(aq, u\(aqused\(aq: u\(aq0\(aq}, u\(aqdns\(aq: u\(aq#\(aq, u\(aqinstance_status\(aq: {u\(aqavailable\(aq: u\(aq0\(aq, u\(aqidle\(aq: u\(aq0\(aq, u\(aqrequested\(aq: u\(aq0\(aq}, u\(aqsnapshot\(aq: {u\(aqprogress\(aq: u\(aqNone\(aq, u\(aqstatus\(aq: u\(aqNone\(aq}} >>> cmi.get_cluster_size() 1 >>> cmi.get_nodes() [{u\(aqid\(aq: u\(aqi\-00006016\(aq, u\(aqinstance_type\(aq: u\(aqm1.medium\(aq, u\(aqld\(aq: u\(aq0.0 0.025 0.065\(aq, u\(aqpublic_ip\(aq: u\(aq115.146.86.29\(aq, u\(aqtime_in_state\(aq: u\(aq2268\(aq}] >>> cmi.add_nodes(2) {u\(aqall_fs\(aq: [], u\(aqapp_status\(aq: u\(aqgreen\(aq, u\(aqautoscaling\(aq: {u\(aqas_max\(aq: u\(aqN/A\(aq, u\(aqas_min\(aq: u\(aqN/A\(aq, u\(aquse_autoscaling\(aq: False}, u\(aqcluster_status\(aq: u\(aqREADY\(aq, u\(aqdata_status\(aq: u\(aqgreen\(aq, u\(aqdisk_usage\(aq: {u\(aqpct\(aq: u\(aq0%\(aq, u\(aqtotal\(aq: u\(aq0\(aq, u\(aqused\(aq: u\(aq0\(aq}, u\(aqdns\(aq: u\(aq#\(aq, u\(aqinstance_status\(aq: {u\(aqavailable\(aq: u\(aq0\(aq, u\(aqidle\(aq: u\(aq0\(aq, u\(aqrequested\(aq: u\(aq2\(aq}, u\(aqsnapshot\(aq: {u\(aqprogress\(aq: u\(aqNone\(aq, u\(aqstatus\(aq: u\(aqNone\(aq}} >>> cmi.get_cluster_size() 3 .ft P .fi .UNINDENT .UNINDENT .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 .INDENT 0.0 .TP .B class bioblend.galaxy.GalaxyInstance(url, key=None, email=None, password=None) A base representation of an instance of Galaxy, identified by a URL and a user\(aqs API key. .sp After you have created an \fBGalaxyInstance\fP object, access various modules via the class fields (see the source for the most up\-to\-date list): \fBlibraries\fP, \fBhistories\fP, \fBworkflows\fP, \fBdatasets\fP, and \fBusers\fP are the minimum set supported. For example, to work with histories, and get a list of all the user\(aqs histories, the following should be done: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C from bioblend import galaxy gi = galaxy.GalaxyInstance(url=\(aqhttp://127.0.0.1:8000\(aq, key=\(aqyour_api_key\(aq) hl = gi.histories.get_histories() .ft P .fi .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBurl\fP (\fIstr\fP) \-\- A FQDN or IP for a given instance of Galaxy. For example: \fI\%http://127.0.0.1:8080\fP .IP \(bu 2 \fBkey\fP (\fIstr\fP) \-\- User\(aqs API key for the given instance of Galaxy, obtained from the user preferences. If a key is not supplied, an email address and password must be and key will automatically be created for the user. .IP \(bu 2 \fBemail\fP (\fIstr\fP) \-\- Galaxy e\-mail address corresponding to the user. Ignored if key is supplied directly. .IP \(bu 2 \fBpassword\fP (\fIstr\fP) \-\- Password of Galaxy account corresponding to the above e\-mail address. Ignored if key is supplied directly. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B __init__(url, key=None, email=None, password=None) A base representation of an instance of Galaxy, identified by a URL and a user\(aqs API key. .sp After you have created an \fBGalaxyInstance\fP object, access various modules via the class fields (see the source for the most up\-to\-date list): \fBlibraries\fP, \fBhistories\fP, \fBworkflows\fP, \fBdatasets\fP, and \fBusers\fP are the minimum set supported. For example, to work with histories, and get a list of all the user\(aqs histories, the following should be done: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C from bioblend import galaxy gi = galaxy.GalaxyInstance(url=\(aqhttp://127.0.0.1:8000\(aq, key=\(aqyour_api_key\(aq) hl = gi.histories.get_histories() .ft P .fi .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBurl\fP (\fIstr\fP) \-\- A FQDN or IP for a given instance of Galaxy. For example: \fI\%http://127.0.0.1:8080\fP .IP \(bu 2 \fBkey\fP (\fIstr\fP) \-\- User\(aqs API key for the given instance of Galaxy, obtained from the user preferences. If a key is not supplied, an email address and password must be and key will automatically be created for the user. .IP \(bu 2 \fBemail\fP (\fIstr\fP) \-\- Galaxy e\-mail address corresponding to the user. Ignored if key is supplied directly. .IP \(bu 2 \fBpassword\fP (\fIstr\fP) \-\- Password of Galaxy account corresponding to the above e\-mail address. Ignored if key is supplied directly. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_retry_delay .UNINDENT .INDENT 7.0 .TP .B max_get_attempts .UNINDENT .UNINDENT .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) .INDENT 7.0 .TP .B get_config() 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 .nf .ft C {u\(aqallow_library_path_paste\(aq: False, u\(aqallow_user_creation\(aq: True, u\(aqallow_user_dataset_purge\(aq: True, u\(aqallow_user_deletion\(aq: False, u\(aqenable_unique_workflow_defaults\(aq: False, u\(aqftp_upload_dir\(aq: u\(aq/SOMEWHERE/galaxy/ftp_dir\(aq, u\(aqftp_upload_site\(aq: u\(aqgalaxy.com\(aq, u\(aqlibrary_import_dir\(aq: u\(aqNone\(aq, u\(aqlogo_url\(aq: None, u\(aqsupport_url\(aq: u\(aqhttp://wiki.g2.bx.psu.edu/Support\(aq, u\(aqterms_url\(aq: None, u\(aquser_library_import_dir\(aq: None, u\(aqwiki_url\(aq: u\(aqhttp://g2.trac.bx.psu.edu/\(aq} .ft P .fi .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) .INDENT 7.0 .TP .B download_dataset(dataset_id, file_path=None, use_default_filename=True, wait_for_completion=False, maxwait=12000) Downloads the dataset identified by \(aqid\(aq. .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 the file_path argument is provided, the dataset will be streamed to disk at that path (Should not contain filename if use_default_name=True). 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 the use_default_name parameter is True, the exported file will be saved as file_path/%s, where %s is the dataset name. If use_default_name is False, file_path is assumed to contain the full file path including filename. .IP \(bu 2 \fBwait_for_completion\fP (\fIbool\fP) \-\- If wait_for_completion is True, this call will block until the dataset is ready. If the dataset state becomes invalid, a DatasetStateException will be thrown. .IP \(bu 2 \fBmaxwait\fP (\fIfloat\fP) \-\- Time (in seconds) to wait for dataset to complete. If the dataset state is not complete within this time, a DatasetTimeoutException will be thrown. .UNINDENT .TP .B Return type dict .TP .B Returns If a file_path argument is not provided, returns a dict containing the file_content. Otherwise returns nothing. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset(dataset_id, deleted=False, hda_ldda=\(aqhda\(aq) Display information about and/or content of a 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_stderr(dataset_id) Display stderr output of a dataset. .INDENT 7.0 .TP .B Parameters \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_stdout(dataset_id) Display stdout output of a dataset. .INDENT 7.0 .TP .B Parameters \fBdataset_id\fP (\fIstr\fP) \-\- Encoded dataset ID .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception bioblend.galaxy.datasets.DatasetStateException(value) .UNINDENT .INDENT 0.0 .TP .B exception bioblend.galaxy.datasets.DatasetTimeoutException(value) .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) .INDENT 7.0 .TP .B get_datatypes(extension_only=False, upload_only=False) Get the list of all installed datatypes. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of datatype names. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [u\(aqsnpmatrix\(aq, u\(aqsnptest\(aq, u\(aqtabular\(aq, u\(aqtaxonomy\(aq, u\(aqtwobit\(aq, u\(aqtxt\(aq, u\(aqvcf\(aq, u\(aqwig\(aq, u\(aqxgmml\(aq, u\(aqxml\(aq] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_sniffers() 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 .nf .ft C [u\(aqgalaxy.datatypes.tabular:Vcf\(aq, u\(aqgalaxy.datatypes.binary:TwoBit\(aq, u\(aqgalaxy.datatypes.binary:Bam\(aq, u\(aqgalaxy.datatypes.binary:Sff\(aq, u\(aqgalaxy.datatypes.xml:Phyloxml\(aq, u\(aqgalaxy.datatypes.xml:GenericXml\(aq, u\(aqgalaxy.datatypes.sequence:Maf\(aq, u\(aqgalaxy.datatypes.sequence:Lav\(aq, u\(aqgalaxy.datatypes.sequence:csFasta\(aq] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .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) .INDENT 7.0 .TP .B delete_folder(folder_id, undelete=False) 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 show_folder(folder_id) Display information about a folder. .INDENT 7.0 .TP .B Parameters \fBfolder_id\fP (\fIstr\fP) \-\- the folder\(aqs encoded id, prefixed by \(aqF\(aq .TP .B Return type dict .TP .B Returns dictionary including details of the 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) .INDENT 7.0 .TP .B create_form(form_xml_text) 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 str .TP .B Returns Unique url of newly created form with encoded id .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_forms() 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 .nf .ft C [{u\(aqid\(aq: u\(aqf2db41e1fa331b3e\(aq, u\(aqmodel_class\(aq: u\(aqFormDefinition\(aq, u\(aqname\(aq: u\(aqFirst form\(aq, u\(aqurl\(aq: u\(aq/api/forms/f2db41e1fa331b3e\(aq}, {u\(aqid\(aq: u\(aqebfb8f50c6abde6d\(aq, u\(aqmodel_class\(aq: u\(aqFormDefinition\(aq, u\(aqname\(aq: u\(aqsecond form\(aq, u\(aqurl\(aq: u\(aq/api/forms/ebfb8f50c6abde6d\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_form(form_id) 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 .nf .ft C {u\(aqdesc\(aq: u\(aqhere it is \(aq, u\(aqfields\(aq: [], u\(aqform_definition_current_id\(aq: u\(aqf2db41e1fa331b3e\(aq, u\(aqid\(aq: u\(aqf2db41e1fa331b3e\(aq, u\(aqlayout\(aq: [], u\(aqmodel_class\(aq: u\(aqFormDefinition\(aq, u\(aqname\(aq: u\(aqFirst form\(aq, u\(aqurl\(aq: u\(aq/api/forms/f2db41e1fa331b3e\(aq} .ft P .fi .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) .INDENT 7.0 .TP .B get_ftp_files(deleted=False) Get a list of local files. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dicts with details on individual files on FTP .UNINDENT .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) .INDENT 7.0 .TP .B get_genomes() Returns a list of installed genomes .UNINDENT .INDENT 7.0 .TP .B install_genome(func=\(aqdownload\(aq, source=None, dbkey=None, ncbi_name=None, ensembl_dbkey=None, url_dbkey=None, indexers=None) Download and/or index a genome. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .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 \fBsource\fP (\fIstr\fP) \-\- Data source for this build. Can be: UCSC, Ensembl, NCBI, URL .IP \(bu 2 \fBindexers\fP (\fIlist\fP) \-\- POST array of indexers to run after downloading (indexers[] = first, indexers[] = second, ...) .IP \(bu 2 \fBfunc\fP (\fIstr\fP) \-\- Allowed values: \(aqdownload\(aq, Download and index; \(aqindex\(aq, Index only .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 show_genome(id, num=None, chrom=None, low=None, high=None) 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 .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) .INDENT 7.0 .TP .B add_group_role(group_id, role_id) 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, user_id) 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, user_ids=[], role_ids=[]) 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 .nf .ft C [{u\(aqid\(aq: u\(aq7c9636938c3e83bf\(aq, u\(aqmodel_class\(aq: u\(aqGroup\(aq, u\(aqname\(aq: u\(aqMy Group Name\(aq, u\(aqurl\(aq: u\(aq/api/groups/7c9636938c3e83bf\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_group_role(group_id, role_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_group_user(group_id, user_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_group_roles(group_id) 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) 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() 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 .nf .ft C [ {"name": "Listeria", "url": "/api/groups/33abac023ff186c2", "model_class": "Group", "id": "33abac023ff186c2"}, {"name": "LPN", "url": "/api/groups/73187219cd372cf8", "model_class": "Group", "id": "73187219cd372cf8"} ] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_group(group_id) 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 .nf .ft C {"roles_url": "/api/groups/33abac023ff186c2/roles", "name": "Listeria", "url": "/api/groups/33abac023ff186c2", "users_url": "/api/groups/33abac023ff186c2/users", "model_class": "Group", "id": "33abac023ff186c2"} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_group(group_id, group_name=None, user_ids=[], role_ids=[]) 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 int .TP .B Returns status code .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) .INDENT 7.0 .TP .B create_dataset_collection(history_id, collection_description) 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 (\fIstr\fP) \-\- a description of the dataset collection .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_history(name=None) 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, tag) 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 .nf .ft C {\(aqmodel_class\(aq:\(aqHistoryTagAssociation\(aq, \(aquser_tname\(aq: \(aqNGS_PE_RUN\(aq, \(aqid\(aq: \(aqf792763bee8d277a\(aq, \(aquser_value\(aq: None} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_dataset(history_id, dataset_id) 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 .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_dataset_collection(history_id, dataset_collection_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_history(history_id, purge=False) 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 .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For the purge option to work, the Galaxy instance must have the \fBallow_user_dataset_purge\fP option set to \fBTrue\fP in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B download_dataset(history_id, dataset_id, file_path, use_default_filename=True) Download a \fBdataset_id\fP from history with \fBhistory_id\fP to a file on the local file system, saving it to \fBfile_path\fP\&. .sp Refer to \fBbioblend.galaxy.dataset.DatasetClient.download_dataset()\fP for the other available parameters. .UNINDENT .INDENT 7.0 .TP .B download_history(history_id, jeha_id, outf, chunk_size=4096) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export_history(history_id, gzip=True, include_hidden=False, include_deleted=False, wait=False) 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 .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_current_history() Deprecated method. .sp Just an alias for get_most_recently_used_history(). .UNINDENT .INDENT 7.0 .TP .B get_histories(history_id=None, name=None, deleted=False) Get all histories or filter the specific one(s) via the provided \fBname\fP or \fBhistory_id\fP\&. Provide only one argument, \fBname\fP or \fBhistory_id\fP, but not both. .sp If \fBdeleted\fP is set to \fBTrue\fP, return histories that have been deleted. .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 \fBname\fP (\fIstr\fP) \-\- Name of history to filter on .UNINDENT .TP .B Return type list .TP .B Returns Return a list of history element dicts. If more than one history matches the given \fBname\fP, return the list of all the histories with the given name .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_most_recently_used_history() Returns the current user\(aqs most recently used history (not deleted). .UNINDENT .INDENT 7.0 .TP .B get_status(history_id) 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 show_dataset(history_id, dataset_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset_collection(history_id, dataset_collection_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset_provenance(history_id, dataset_id, follow=False) 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 \fBfollow\fP is \fBTrue\fP, recursively fetch dataset provenance information for all inputs and their inputs, etc... .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_history(history_id, contents=False, deleted=None, visible=None, details=None, types=None) 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, the complete list of datasets in the given history. .IP \(bu 2 \fBdeleted\fP (\fIstr\fP) \-\- Used when contents=True, includes deleted datasets in history dataset list .IP \(bu 2 \fBvisible\fP (\fIstr\fP) \-\- Used when contents=True, includes only visible datasets in history dataset list .IP \(bu 2 \fBdetails\fP (\fIstr\fP) \-\- Used when contents=True, includes dataset details. Set to \(aqall\(aq for the most information .IP \(bu 2 \fBtypes\fP (\fIstr\fP) \-\- .sp ??? .UNINDENT .TP .B Return type dict .TP .B Returns details of the given history .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_matching_datasets(history_id, name_filter=None) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B undelete_history(history_id) Undelete a history .INDENT 7.0 .TP .B Parameters \fBhistory_id\fP (\fIstr\fP) \-\- Encoded history ID .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_dataset(history_id, dataset_id, **kwds) 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 \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 int .TP .B Returns status code .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_dataset_collection(history_id, dataset_collection_id, **kwds) 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 int .TP .B Returns status code .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_history(history_id, name=None, annotation=None, **kwds) 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 \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 int .TP .B Returns status code .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_dataset_from_library(history_id, lib_dataset_id) 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 .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) .INDENT 7.0 .TP .B get_jobs() Get the list of jobs of the current user. .INDENT 7.0 .TP .B Return type list .TP .B Returns list of dictionaries containing summary job information. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqcreate_time\(aq: u\(aq2014\-03\-01T16:16:48.640550\(aq, u\(aqexit_code\(aq: 0, u\(aqid\(aq: u\(aqebfb8f50c6abde6d\(aq, u\(aqmodel_class\(aq: u\(aqJob\(aq, u\(aqstate\(aq: u\(aqok\(aq, u\(aqtool_id\(aq: u\(aqfasta2tab\(aq, u\(aqupdate_time\(aq: u\(aq2014\-03\-01T16:16:50.657399\(aq}, {u\(aqcreate_time\(aq: u\(aq2014\-03\-01T16:05:34.851246\(aq, u\(aqexit_code\(aq: 0, u\(aqid\(aq: u\(aq1cd8e2f6b131e891\(aq, u\(aqmodel_class\(aq: u\(aqJob\(aq, u\(aqstate\(aq: u\(aqok\(aq, u\(aqtool_id\(aq: u\(aqupload1\(aq, u\(aqupdate_time\(aq: u\(aq2014\-03\-01T16:05:39.558458\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_state(job_id) 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 search_jobs(job_info) Return jobs for the current user based payload content. .INDENT 7.0 .TP .B Parameters \fBjob_info\fP (\fIdict\fP) \-\- dictionary containing description of the requested job. This is in the same format as a request to POST /api/tools would take to initiate a job .TP .B Return type list .TP .B Returns list of dictionaries containing summary job information of the jobs that match the requested job run .UNINDENT .sp This method is designed to scan the list of previously run jobs and find records of jobs that had the exact some input parameters and datasets. This can be used to minimize the amount of repeated work, and simply recycle the old results. .UNINDENT .INDENT 7.0 .TP .B show_job(job_id, full_details=False) 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 .nf .ft C {u\(aqcreate_time\(aq: u\(aq2014\-03\-01T16:17:29.828624\(aq, u\(aqexit_code\(aq: 0, u\(aqid\(aq: u\(aqa799d38679e985db\(aq, u\(aqinputs\(aq: {u\(aqinput\(aq: {u\(aqid\(aq: u\(aqebfb8f50c6abde6d\(aq, u\(aqsrc\(aq: u\(aqhda\(aq}}, u\(aqmodel_class\(aq: u\(aqJob\(aq, u\(aqoutputs\(aq: {u\(aqoutput\(aq: {u\(aqid\(aq: u\(aqa799d38679e985db\(aq, u\(aqsrc\(aq: u\(aqhda\(aq}}, u\(aqparams\(aq: {u\(aqchromInfo\(aq: u\(aq"/opt/galaxy\-central/tool\-data/shared/ucsc/chrom/?.len"\(aq, u\(aqdbkey\(aq: u\(aq"?"\(aq, u\(aqseq_col\(aq: u\(aq"2"\(aq, u\(aqtitle_col\(aq: u\(aq["1"]\(aq}, u\(aqstate\(aq: u\(aqok\(aq, u\(aqtool_id\(aq: u\(aqtab2fasta\(aq, u\(aqupdate_time\(aq: u\(aq2014\-03\-01T16:17:31.930728\(aq} .ft P .fi .UNINDENT .UNINDENT .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) .INDENT 7.0 .TP .B copy_from_dataset(library_id, dataset_id, folder_id=None, message=\(aq\(aq) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_folder(library_id, folder_name, description=None, base_folder_id=None) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_library(name, description=None, synopsis=None) Create a data library with the properties defined in the arguments. Return a list of JSON dicts, looking like so: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C :type name: str :param name: Name of the new data library .ft P .fi .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .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: .INDENT 7.0 .TP .B {"id": "f740ab636b360a70", "name": "Library from bioblend", "url": "/api/libraries/f740ab636b360a70"} .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_library(library_id) 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 .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, dataset_id, purged=False) 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 .nf .ft C {u\(aqdeleted\(aq: True, u\(aqid\(aq: u\(aq60e680a037f41974\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_folders(library_id, folder_id=None, name=None) Get all the folders or filter specific one(s) via the provided \fBname\fP or \fBfolder_id\fP in data library with id \fBlibrary_id\fP\&. Provide only one argument: \fBname\fP or \fBfolder_id\fP, but not both. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfolder_id\fP (\fIstr\fP) \-\- filter for folder by folder id .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- filter for folder by name. 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 .UNINDENT .INDENT 7.0 .TP .B get_libraries(library_id=None, name=None, deleted=False) Get all the libraries or filter for specific one(s) via the provided name or ID. Provide only one argument: \fBname\fP or \fBlibrary_id\fP, but not both. .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 \fBname\fP (\fIstr\fP) \-\- If \fBname\fP is set and multiple names match the given name, all the libraries matching the argument will be returned. .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- If set to \fBTrue\fP, return libraries that have been deleted. .UNINDENT .TP .B Return type list .TP .B Returns list of dicts each containing basic information about a library. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_library_permissions(library_id) Get the permessions 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 set_library_permissions(library_id, access_in=None, modify_in=None, add_in=None, manage_in=None) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_dataset(library_id, dataset_id) 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, folder_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_library(library_id, contents=False) 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) \-\- True if want 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 upload_file_contents(library_id, pasted_content, folder_id=None, file_type=\(aqauto\(aq, dbkey=\(aq?\(aq) 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 .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_from_local_path(library_id, file_local_path, folder_id=None, file_type=\(aqauto\(aq, dbkey=\(aq?\(aq) 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 .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_from_server(library_id, server_dir, folder_id=None, file_type=\(aqauto\(aq, dbkey=\(aq?\(aq, link_data_only=None, roles=\(aq\(aq) Upload all files in the specified subdirectory of the Galaxy library import directory to a library. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For this method to work, the Galaxy instance must have the \fBlibrary_import_dir\fP option configured in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .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 ??? .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file_from_url(library_id, file_url, folder_id=None, file_type=\(aqauto\(aq, dbkey=\(aq?\(aq) 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 .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_from_galaxy_filesystem(library_id, filesystem_paths, folder_id=None, file_type=\(aqauto\(aq, dbkey=\(aq?\(aq, link_data_only=None, roles=\(aq\(aq) Upload a set of files already present on the filesystem of the Galaxy server to a library. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For this method to work, the Galaxy instance must have the \fBallow_library_path_paste\fP option set to \fBTrue\fP in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .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 ??? .UNINDENT .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) .INDENT 7.0 .TP .B get_quotas(deleted=False) 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 .nf .ft C [{ u\(aqid\(aq: u\(aq0604c8a56abe9a50\(aq, u\(aqmodel_class\(aq: u\(aqQuota\(aq, u\(aqname\(aq: u\(aqtest \(aq, u\(aqurl\(aq: u\(aq/api/quotas/0604c8a56abe9a50\(aq}, { u\(aqid\(aq: u\(aq1ee267091d0190af\(aq, u\(aqmodel_class\(aq: u\(aqQuota\(aq, u\(aqname\(aq: u\(aqworkshop\(aq, u\(aqurl\(aq: u\(aq/api/quotas/1ee267091d0190af\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_quota(quota_id, deleted=False) 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 .nf .ft C { u\(aqbytes\(aq: 107374182400, u\(aqdefault\(aq: [], u\(aqdescription\(aq: u\(aqjust testing\(aq, u\(aqdisplay_amount\(aq: u\(aq100.0 GB\(aq, u\(aqgroups\(aq: [], u\(aqid\(aq: u\(aq0604c8a56abe9a50\(aq, u\(aqmodel_class\(aq: u\(aqQuota\(aq, u\(aqname\(aq: u\(aqtest \(aq, u\(aqoperation\(aq: u\(aq=\(aq, u\(aqusers\(aq: []} .ft P .fi .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) .INDENT 7.0 .TP .B get_roles() 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 .nf .ft C [ {"id": "f2db41e1fa331b3e", "model_class": "Role", "name": "Foo", "url": "/api/roles/f2db41e1fa331b3e"}, {"id": "f597429621d6eb2b", "model_class": "Role", "name": "Bar", "url": "/api/roles/f597429621d6eb2b"} ] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_role(role_id) 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 A description of role For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {"description": "Private Role for Foo", "id": "f2db41e1fa331b3e", "model_class": "Role", "name": "Foo", "type": "private", "url": "/api/roles/f2db41e1fa331b3e"} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Tools .sp Contains possible interaction dealing with Galaxy tools. .INDENT 0.0 .TP .B class bioblend.galaxy.tools.ToolClient(galaxy_instance) .INDENT 7.0 .TP .B get_tool_panel() Get a list of available tool elements in Galaxy\(aqs configured toolbox. .INDENT 7.0 .TP .B Return type list .TP .B Returns List containing tools (if not in sections) or tool sections with nested tool descriptions. .UNINDENT .sp \fBSEE ALSO:\fP .INDENT 7.0 .INDENT 3.5 bioblend.galaxy.toolshed.get_repositories() .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_tools(tool_id=None, name=None, trackster=None) Get all tools or filter the specific one(s) via the provided \fBname\fP or \fBtool_id\fP\&. Provide only one argument, \fBname\fP or \fBtool_id\fP, but not both. .sp If \fBname\fP is set and multiple names match the given name, all the tools matching the argument will be returned. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtool_id\fP (\fIstr\fP) \-\- id of the requested tool .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- name of the requested tool(s) .IP \(bu 2 \fBtrackster\fP (\fIbool\fP) \-\- if True, only tools that are compatible with Trackster are returned .UNINDENT .TP .B Return type list .TP .B Returns List of tool descriptions. .UNINDENT .sp \fBSEE ALSO:\fP .INDENT 7.0 .INDENT 3.5 bioblend.galaxy.toolshed.get_repositories() .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B paste_content(content, history_id, **kwds) Upload a string to a new dataset in the history specified by \fBhistory_id\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcontent\fP (\fIstr\fP) \-\- content of the new dataset to upload or a list of URLs (one per line) to upload .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- id of the history where to upload the content .UNINDENT .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters (except file_name). .UNINDENT .INDENT 7.0 .TP .B put_url(content, history_id, **kwds) Upload a string to a new dataset in the history specified by \fBhistory_id\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcontent\fP (\fIstr\fP) \-\- content of the new dataset to upload or a list of URLs (one per line) to upload .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- id of the history where to upload the content .UNINDENT .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters (except file_name). .UNINDENT .INDENT 7.0 .TP .B run_tool(history_id, tool_id, tool_inputs) Runs tool specified by \fBtool_id\fP in history indicated by \fBhistory_id\fP with inputs from \fBdict\fP \fBtool_inputs\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- encoded ID of the history in which to run the tool .IP \(bu 2 \fBtool_id\fP (\fIstr\fP) \-\- ID of the tool to be run .IP \(bu 2 \fBtool_inputs\fP (\fIdict\fP) \-\- dictionary of input datasets and parameters for the tool (see below) .UNINDENT .UNINDENT .sp The \fBtool_inputs\fP dict should contain input datasets and parameters in the (largely undocumented) format used by the Galaxy API. Some examples can be found in \fI\%https://bitbucket.org/galaxy/galaxy\-central/src/tip/test/api/test_tools.py\fP . .UNINDENT .INDENT 7.0 .TP .B show_tool(tool_id, io_details=False, link_details=False) Get details of a given tool. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtool_id\fP (\fIstr\fP) \-\- id of the requested tool .IP \(bu 2 \fBio_details\fP (\fIbool\fP) \-\- if True, get also input and output details .IP \(bu 2 \fBlink_details\fP (\fIbool\fP) \-\- if True, get also link details .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file(path, history_id, **keywords) Upload the file specified by \fBpath\fP to the history specified by \fBhistory_id\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- path of the file to upload .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- id of the history where to upload the file .IP \(bu 2 \fBfile_name\fP (\fIstr\fP) \-\- (optional) name of the new history dataset .IP \(bu 2 \fBfile_type\fP (\fIstr\fP) \-\- Galaxy datatype for the new dataset, default is auto .IP \(bu 2 \fBdbkey\fP (\fIstr\fP) \-\- (optional) genome dbkey .IP \(bu 2 \fBto_posix_lines\fP (\fIbool\fP) \-\- if True, convert universal line endings to POSIX line endings. Default is True. Set to False if you upload a gzip, bz2 or zip archive containing a binary file .IP \(bu 2 \fBspace_to_tab\fP (\fIbool\fP) \-\- whether to convert spaces to tabs. Default is False. Applicable only if to_posix_lines is True .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_from_ftp(path, history_id, **keywords) Upload the file specified by \fBpath\fP from the user\(aqs FTP directory to the history specified by \fBhistory_id\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpath\fP (\fIstr\fP) \-\- path of the file in the user\(aqs FTP directory .IP \(bu 2 \fBhistory_id\fP (\fIstr\fP) \-\- id of the history where to upload the file .UNINDENT .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters. .UNINDENT .UNINDENT .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) .INDENT 7.0 .TP .B delete_data_table(data_table_id, values) 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 "|" separated list of column contents, there must be a value for all the columns of the data table .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_data_tables() 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 .nf .ft C [{"model_class": "TabularToolDataTable", "name": "fasta_indexes"}, {"model_class": "TabularToolDataTable", "name": "bwa_indexes"}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_data_table(data_table_id) 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 .nf .ft C {"columns": ["value", "dbkey", "name", "path"], "fields": [["test id", "test", "test name", "/opt/galaxy\-dist/tool\-data/test/seq/test id.fa"]], "model_class": "TabularToolDataTable", "name": "all_fasta"} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS ToolShed .sp Interaction with a Galaxy Tool Shed .INDENT 0.0 .TP .B class bioblend.galaxy.toolshed.ToolShedClient(galaxy_instance) .INDENT 7.0 .TP .B get_repositories() Get the list of all installed Tool Shed repositories on this Galaxy instance. .INDENT 7.0 .TP .B Return type list .TP .B Returns a list of dictionaries containing information about repositories present in the Tool Shed. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqchangeset_revision\(aq: u\(aq4afe13ac23b6\(aq, u\(aqdeleted\(aq: False, u\(aqdist_to_shed\(aq: False, u\(aqerror_message\(aq: u\(aq\(aq, u\(aqname\(aq: u\(aqvelvet_toolsuite\(aq, u\(aqowner\(aq: u\(aqedward\-kirton\(aq, u\(aqstatus\(aq: u\(aqInstalled\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp Changed in version 0.4.1: Changed method name from \fBget_tools\fP to \fBget_repositories\fP to better align with the Tool Shed concepts .sp \fBSEE ALSO:\fP .INDENT 7.0 .INDENT 3.5 bioblend.galaxy.tools.get_tool_panel() .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B install_repository_revision(tool_shed_url, name, owner, changeset_revision, install_tool_dependencies=False, install_repository_dependencies=False, tool_panel_section_id=None, new_tool_panel_section_label=None) Install a specified repository revision from a specified Tool Shed into this Galaxy instance. This example demonstrates installation of a repository that contains valid tools, loading them into a section of the Galaxy tool panel or creating a new tool panel section. You can choose if tool dependencies or repository dependencies should be installed, use \fBinstall_tool_dependencies\fP or \fBinstall_repository_dependencies\fP\&. .sp Installing the repository into an existing tool panel section requires the tool panel config file (e.g., tool_conf.xml, shed_tool_conf.xml, etc) to contain the given tool panel section: .INDENT 7.0 .INDENT 3.5
.UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtool_shed_url\fP (\fIstr\fP) \-\- URL of the Tool Shed from which the repository should be installed from (e.g., \fBhttp://testtoolshed.g2.bx.psu.edu\fP) .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- The name of the repository that should be installed .IP \(bu 2 \fBowner\fP (\fIstr\fP) \-\- The name of the repository owner .IP \(bu 2 \fBchangeset_revision\fP (\fIstr\fP) \-\- The revision of the repository to be installed .IP \(bu 2 \fBinstall_tool_dependencies\fP (\fIbool\fP) \-\- Whether or not to automatically handle tool dependencies (see \fI\%http://wiki.galaxyproject.org/AToolOrASuitePerRepository\fP for more details) .IP \(bu 2 \fBinstall_repository_dependencies\fP (\fIbool\fP) \-\- Whether or not to automatically handle repository dependencies (see \fI\%http://wiki.galaxyproject.org/DefiningRepositoryDependencies\fP for more details) .IP \(bu 2 \fBtool_panel_section_id\fP (\fIstr\fP) \-\- The ID of the Galaxy tool panel section where the tool should be insterted under. Note that you should specify either this parameter or the \fBnew_tool_panel_section_label\fP\&. If both are specified, this one will take precedence. .IP \(bu 2 \fBnew_tool_panel_section_label\fP (\fIstr\fP) \-\- The name of a Galaxy tool panel section that should be created and the repository installed into. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_repository(toolShed_id) Get details of a given Tool Shed repository as it is installed on this Galaxy instance. .INDENT 7.0 .TP .B Parameters \fBtoolShed_id\fP (\fIstr\fP) \-\- Encoded toolShed ID .TP .B Return type dict .TP .B Returns Information about the tool For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {u\(aqchangeset_revision\(aq: u\(aqb17455fb6222\(aq, u\(aqctx_rev\(aq: u\(aq8\(aq, u\(aqowner\(aq: u\(aqaaron\(aq, u\(aqstatus\(aq: u\(aqInstalled\(aq, u\(aqurl\(aq: u\(aq/api/tool_shed_repositories/82de4a4c7135b20a\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp Changed in version 0.4.1: Changed method name from \fBshow_tool\fP to \fBshow_repository\fP to better align with the Tool Shed concepts .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Users .sp Contains possible interaction dealing with Galaxy users. .sp These methods must be executed by a registered Galaxy admin user. .INDENT 0.0 .TP .B class bioblend.galaxy.users.UserClient(galaxy_instance) .INDENT 7.0 .TP .B create_local_user(username, user_email, password) Create a new Galaxy user. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For this method to work, the Galaxy instance must have the \fBallow_user_creation\fP option set to \fBTrue\fP and \fBuse_remote_user\fP option set to \fBFalse\fP in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBusername\fP (\fIstr\fP) \-\- Username of user to be created .IP \(bu 2 \fBuser_email\fP (\fIstr\fP) \-\- Email of user to be created .IP \(bu 2 \fBpassword\fP (\fIstr\fP) \-\- password of user to be created .UNINDENT .TP .B Return type dict .TP .B Returns dictionary containing information about the created user .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_remote_user(user_email) Create a new Galaxy remote user. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For this method to work, the Galaxy instance must have the \fBallow_user_creation\fP and \fBuse_remote_user\fP options set to \fBTrue\fP in the \fBconfig/galaxy.ini\fP configuration file. Also note that setting \fBuse_remote_user\fP will require an upstream authentication proxy server; however, if you do not have one, access to Galaxy via a browser will not be possible. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters \fBuser_email\fP (\fIstr\fP) \-\- Email of user to be created .TP .B Return type dict .TP .B Returns dictionary containing information about the created user .UNINDENT .UNINDENT .INDENT 7.0 .TP .B create_user(user_email) Deprecated method. .sp Just an alias for create_remote_user(). .UNINDENT .INDENT 7.0 .TP .B create_user_apikey(user_id) Create a new api key for a user .INDENT 7.0 .TP .B Parameters \fBuser_id\fP (\fIstr\fP) \-\- Encoded user ID .TP .B Return type str .TP .B Returns The api key for the user .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_current_user() Returns the user id associated with this Galaxy connection .INDENT 7.0 .TP .B Return type dict .TP .B Returns dictionary containing information about the current user .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_users(deleted=False) Get a list of all registered users. If \fBdeleted\fP is set to \fBTrue\fP, get a list of deleted users. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dicts with user details. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqemail\(aq: u\(aqa_user@example.com\(aq, u\(aqid\(aq: u\(aqdda47097d9189f15\(aq, u\(aqurl\(aq: u\(aq/api/users/dda47097d9189f15\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_user(user_id, deleted=False) Display information about a user. If \fBdeleted\fP is set to \fBTrue\fP, display information about a deleted user. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBuser_id\fP (\fIstr\fP) \-\- User ID to inspect .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Whether to return results for a deleted user .UNINDENT .TP .B Return type dict .TP .B Returns dictionary containing information about the user .UNINDENT .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .SS Visual .sp Contains possible interactions with the Galaxy visualization .INDENT 0.0 .TP .B class bioblend.galaxy.visual.VisualClient(galaxy_instance) .INDENT 7.0 .TP .B get_visualizations() Get the list of all visualizations. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dicts with details on individual visualizations. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqdbkey\(aq: u\(aqeschColi_K12\(aq, u\(aqid\(aq: u\(aqdf1c7c96fc427c2d\(aq, u\(aqtitle\(aq: u\(aqAVTest1\(aq, u\(aqtype\(aq: u\(aqtrackster\(aq, u\(aqurl\(aq: u\(aq/api/visualizations/df1c7c96fc427c2d\(aq}, {u\(aqdbkey\(aq: u\(aqmm9\(aq, u\(aqid\(aq: u\(aqa669f50f8bf55b02\(aq, u\(aqtitle\(aq: u\(aqBam to Bigwig\(aq, u\(aqtype\(aq: u\(aqtrackster\(aq, u\(aqurl\(aq: u\(aq/api/visualizations/a669f50f8bf55b02\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_visualization(visual_id) Get details of a given visualization. .INDENT 7.0 .TP .B Parameters \fBvisual_id\fP (\fIstr\fP) \-\- Encoded visualization ID .TP .B Return type dict .TP .B Returns A description of the given visualization. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {u\(aqannotation\(aq: None, u\(aqdbkey\(aq: u\(aqmm9\(aq, u\(aqid\(aq: u\(aq18df9134ea75e49c\(aq, u\(aqlatest_revision\(aq: { ... }, u\(aqmodel_class\(aq: u\(aqVisualization\(aq, u\(aqrevisions\(aq: [u\(aqaa90649bb3ec7dcb\(aq, u\(aq20622bc6249c0c71\(aq], u\(aqslug\(aq: u\(aqvisualization\-for\-grant\-1\(aq, u\(aqtitle\(aq: u\(aqVisualization For Grant\(aq, u\(aqtype\(aq: u\(aqtrackster\(aq, u\(aqurl\(aq: u\(aq/u/azaron/v/visualization\-for\-grant\-1\(aq, u\(aquser_id\(aq: u\(aq21e4aed91386ca8b\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .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) .INDENT 7.0 .TP .B cancel_invocation(workflow_id, invocation_id) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete_workflow(workflow_id) 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 \- all workflow data will be permanently deleted. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export_workflow_json(workflow_id) Exports a workflow .INDENT 7.0 .TP .B Parameters \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .TP .B Return type dict .TP .B Returns Dict representing the workflow requested .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export_workflow_to_local_path(workflow_id, file_local_path, use_default_filename=True) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_invocations(workflow_id) Get a list containing all the workflow invocations corresponding to the specified workflow. .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 .nf .ft C [{u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:22\(aq, u\(aquuid\(aq: u\(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, u\(aqhistory_id\(aq: u\(aq2f94e8ae9edff68a\(aq, u\(aqworkflow_id\(aq: u\(aq03501d7626bd192f\(aq, u\(aqstate\(aq: u\(aqnew\(aq, u\(aqmodel_class\(aq: u\(aqWorkflowInvocation\(aq, u\(aqid\(aq: u\(aqdf7a1f0c02a5b08e\(aq} ] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_workflow_inputs(workflow_id, label) 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=None, name=None, published=False) Get all workflows or filter the specific one(s) via the provided \fBname\fP or \fBworkflow_id\fP\&. Provide only one argument, \fBname\fP or \fBworkflow_id\fP, but not both. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID (incompatible with \fBname\fP) .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Filter by name of workflow (incompatible with \fBworkflow_id\fP). If multiple names match the given name, all the workflows matching the argument will be returned. .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 .nf .ft C [{u\(aqid\(aq: u\(aq92c56938c2f9b315\(aq, u\(aqname\(aq: u\(aqSimple\(aq, u\(aqurl\(aq: u\(aq/api/workflows/92c56938c2f9b315\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B import_shared_workflow(workflow_id) 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 .nf .ft C {u\(aqid\(aq: u\(aqee0e2b4b696d9092\(aq, u\(aqmodel_class\(aq: u\(aqStoredWorkflow\(aq, u\(aqname\(aq: u\(aqSuper workflow that solves everything!\(aq, u\(aqpublished\(aq: False, u\(aqtags\(aq: [], u\(aqurl\(aq: u\(aq/api/workflows/ee0e2b4b696d9092\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B import_workflow_from_local_path(file_local_path) Imports a new workflow given the path to a file containing a previously exported workflow. .INDENT 7.0 .TP .B Parameters \fBfile_local_path\fP (\fIstr\fP) \-\- File to upload to the server for new workflow .UNINDENT .UNINDENT .INDENT 7.0 .TP .B import_workflow_json(workflow_json) Imports a new workflow given a json representation of a previously exported workflow. .INDENT 7.0 .TP .B Parameters \fBworkflow_json\fP (\fIstr\fP) \-\- JSON string representing the workflow to be imported .UNINDENT .UNINDENT .INDENT 7.0 .TP .B invoke_workflow(workflow_id, inputs=None, params=None, history_id=None, history_name=None, import_inputs_to_history=False, replacement_params=None, allow_tool_state_corrections=None) 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. .IP \(bu 2 \fBparams\fP (\fIstr or dict\fP) \-\- A mapping of tool parameters that are non\-datasets parameters. The map must be in the following format: \fB{\(aqblastn\(aq: {\(aqparam\(aq: \(aqevalue\(aq, \(aqvalue\(aq: \(aq1e\-06\(aq}}\fP .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) .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 .nf .ft C {u\(aqinputs\(aq: {u\(aq0\(aq: {u\(aqsrc\(aq: u\(aqhda\(aq, u\(aqid\(aq: u\(aqa7db2fac67043c7e\(aq, u\(aquuid\(aq: u\(aq7932ffe0\-2340\-4952\-8857\-dbaa50f1f46a\(aq}}, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:26\(aq, u\(aquuid\(aq: u\(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, u\(aqhistory_id\(aq: u\(aq2f94e8ae9edff68a\(aq, u\(aqworkflow_id\(aq: u\(aq03501d7626bd192f\(aq, u\(aqstate\(aq: u\(aqready\(aq, u\(aqsteps\(aq: [{u\(aqworkflow_step_uuid\(aq: u\(aqb81250fd\-3278\-4e6a\-b269\-56a1f01ef485\(aq, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:26\(aq, u\(aqjob_id\(aq: None, u\(aqstate\(aq: None, u\(aqworkflow_step_label\(aq: None, u\(aqorder_index\(aq: 0, u\(aqaction\(aq: None, u\(aqmodel_class\(aq: u\(aqWorkflowInvocationStep\(aq, u\(aqworkflow_step_id\(aq: u\(aqcbbbf59e8f08c98c\(aq, u\(aqid\(aq: u\(aqd413a19dec13d11e\(aq}, {u\(aqworkflow_step_uuid\(aq: u\(aqe62440b8\-e911\-408b\-b124\-e05435d3125e\(aq, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:26\(aq, u\(aqjob_id\(aq: u\(aqe89067bb68bee7a0\(aq, u\(aqstate\(aq: u\(aqnew\(aq, u\(aqworkflow_step_label\(aq:None, u\(aqorder_index\(aq: 1, u\(aqaction\(aq: None, u\(aqmodel_class\(aq: u\(aqWorkflowInvocationStep\(aq, u\(aqworkflow_step_id\(aq: u\(aq964b37715ec9bd22\(aq, u\(aqid\(aq: u\(aq2f94e8ae9edff68a\(aq}, ], u\(aqmodel_class\(aq: u\(aqWorkflowInvocation\(aq, u\(aqid\(aq: u\(aqdf7a1f0c02a5b08e\(aq } .ft P .fi .UNINDENT .UNINDENT .UNINDENT .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 .nf .ft C {u\(aqRenameDatasetActionout_file1\(aq: { u\(aqaction_arguments\(aq: {u\(aqnewname\(aq: u\(aq${output}\(aq}, u\(aqaction_type\(aq: u\(aqRenameDatasetAction\(aq, u\(aqoutput_name\(aq: u\(aqout_file1\(aq}} .ft P .fi .UNINDENT .UNINDENT .sp then the following renames the output dataset to \(aqfoo\(aq: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C replacement_params = {\(aqoutput\(aq: \(aqfoo\(aq} .ft P .fi .UNINDENT .UNINDENT .sp see also \fI\%this email thread\fP\&. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Historically, the \fBrun_workflow\fP method 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 run_invocation_step_action(workflow_id, invocation_id, step_id, action) 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B run_workflow(workflow_id, dataset_map=None, params=None, history_id=None, history_name=None, import_inputs_to_history=False, replacement_params=None) Run the workflow identified by \fBworkflow_id\fP\&. This method is deprecated please use \fBinvoke_workflow\fP instead. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBworkflow_id\fP (\fIstr\fP) \-\- Encoded workflow ID .IP \(bu 2 \fBdataset_map\fP (\fIstr or dict\fP) \-\- A mapping of workflow inputs to datasets. The datasets source can be a LibraryDatasetDatasetAssociation (\fBldda\fP), LibraryDataset (\fBld\fP), or HistoryDatasetAssociation (\fBhda\fP). The map must be in the following format: \fB{\(aq\(aq: {\(aqid\(aq: , \(aqsrc\(aq: \(aq[ldda, ld, hda]\(aq}}\fP (e.g. \fB{\(aq23\(aq: {\(aqid\(aq: \(aq29beef4fadeed09f\(aq, \(aqsrc\(aq: \(aqld\(aq}}\fP) .IP \(bu 2 \fBparams\fP (\fIstr or dict\fP) \-\- A mapping of tool parameters that are non\-datasets parameters. The map must be in the following format: \fB{\(aqblastn\(aq: {\(aqparam\(aq: \(aqevalue\(aq, \(aqvalue\(aq: \(aq1e\-06\(aq}}\fP .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 \fBreplacement_params\fP (\fIdict\fP) \-\- pattern\-based replacements for post\-job actions (see below) .UNINDENT .TP .B Return type dict .TP .B Returns A dict containing the history ID where the outputs are placed as well as output dataset IDs. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {u\(aqhistory\(aq: u\(aq64177123325c9cfd\(aq, u\(aqoutputs\(aq: [u\(aqaa4d3084af404259\(aq]} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .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 .nf .ft C {u\(aqRenameDatasetActionout_file1\(aq: { u\(aqaction_arguments\(aq: {u\(aqnewname\(aq: u\(aq${output}\(aq}, u\(aqaction_type\(aq: u\(aqRenameDatasetAction\(aq, u\(aqoutput_name\(aq: u\(aqout_file1\(aq}} .ft P .fi .UNINDENT .UNINDENT .sp then the following renames the output dataset to \(aqfoo\(aq: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C replacement_params = {\(aqoutput\(aq: \(aqfoo\(aq} .ft P .fi .UNINDENT .UNINDENT .sp see also \fI\%this email thread\fP\&. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 This method is deprecated, please use \fBinvoke_workflow\fP instead. \fBrun_workflow\fP will wait for the whole workflow to be scheduled before returning and will not scale to large workflows as a result. \fBinvoke_workflow\fP also features improved default behavior for dataset input handling. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_invocation(workflow_id, invocation_id) 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 .nf .ft C {u\(aqinputs\(aq: {u\(aq0\(aq: {u\(aqsrc\(aq: u\(aqhda\(aq, u\(aqid\(aq: u\(aqa7db2fac67043c7e\(aq, u\(aquuid\(aq: u\(aq7932ffe0\-2340\-4952\-8857\-dbaa50f1f46a\(aq}}, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:26\(aq, u\(aquuid\(aq: u\(aqc8aa2b1c\-801a\-11e5\-a9e5\-8ca98228593c\(aq, u\(aqhistory_id\(aq: u\(aq2f94e8ae9edff68a\(aq, u\(aqworkflow_id\(aq: u\(aq03501d7626bd192f\(aq, u\(aqstate\(aq: u\(aqready\(aq, u\(aqsteps\(aq: [{u\(aqworkflow_step_uuid\(aq: u\(aqb81250fd\-3278\-4e6a\-b269\-56a1f01ef485\(aq, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:26\(aq, u\(aqjob_id\(aq: None, u\(aqstate\(aq: None, u\(aqworkflow_step_label\(aq: None, u\(aqorder_index\(aq: 0, u\(aqaction\(aq: None, u\(aqmodel_class\(aq: u\(aqWorkflowInvocationStep\(aq, u\(aqworkflow_step_id\(aq: u\(aqcbbbf59e8f08c98c\(aq, u\(aqid\(aq: u\(aqd413a19dec13d11e\(aq}, {u\(aqworkflow_step_uuid\(aq: u\(aqe62440b8\-e911\-408b\-b124\-e05435d3125e\(aq, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:00:26\(aq, u\(aqjob_id\(aq: u\(aqe89067bb68bee7a0\(aq, u\(aqstate\(aq: u\(aqnew\(aq, u\(aqworkflow_step_label\(aq:None, u\(aqorder_index\(aq: 1, u\(aqaction\(aq: None, u\(aqmodel_class\(aq: u\(aqWorkflowInvocationStep\(aq, u\(aqworkflow_step_id\(aq: u\(aq964b37715ec9bd22\(aq, u\(aqid\(aq: u\(aq2f94e8ae9edff68a\(aq}, ], u\(aqmodel_class\(aq: u\(aqWorkflowInvocation\(aq, u\(aqid\(aq: u\(aqdf7a1f0c02a5b08e\(aq } .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_invocation_step(workflow_id, invocation_id, step_id) 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 .nf .ft C {u\(aqworkflow_step_uuid\(aq: u\(aq4060554c\-1dd5\-4287\-9040\-8b4f281cf9dc\(aq, u\(aqupdate_time\(aq: u\(aq2015\-10\-31T22:11:14\(aq, u\(aqjob_id\(aq: None, u\(aqstate\(aq: None, u\(aqworkflow_step_label\(aq: None, u\(aqorder_index\(aq: 2, u\(aqaction\(aq: None, u\(aqmodel_class\(aq: u\(aqWorkflowInvocationStep\(aq, u\(aqworkflow_step_id\(aq: u\(aq52e496b945151ee8\(aq, u\(aqid\(aq: u\(aq63cd3858d057a6d1\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_workflow(workflow_id) Display information needed to run a workflow .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 and its inputs as a JSON object. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {u\(aqid\(aq: u\(aq92c56938c2f9b315\(aq, u\(aqinputs\(aq: {u\(aq23\(aq: {u\(aqlabel\(aq: u\(aqInput Dataset\(aq, u\(aqvalue\(aq: u\(aq\(aq}}, u\(aqname\(aq: u\(aqSimple\(aq, u\(aqurl\(aq: u\(aq/api/workflows/92c56938c2f9b315\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Object\-oriented Galaxy API .INDENT 0.0 .TP .B class bioblend.galaxy.objects.galaxy_instance.GalaxyInstance(url, api_key=None, email=None, password=None) A representation of an instance of Galaxy, identified by a URL and a user\(aqs API key. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBurl\fP (\fIstr\fP) \-\- a FQDN or IP for a given instance of Galaxy. For example: \fBhttp://127.0.0.1:8080\fP .IP \(bu 2 \fBapi_key\fP (\fIstr\fP) \-\- user\(aqs API key for the given instance of Galaxy, obtained from the Galaxy web UI. .UNINDENT .UNINDENT .sp This is actually a factory class which instantiates the entity\-specific clients. .sp Example: get a list of all histories for a user with API key \(aqfoo\(aq: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C from bioblend.galaxy.objects import * gi = GalaxyInstance(\(aqhttp://127.0.0.1:8080\(aq, \(aqfoo\(aq) histories = gi.histories.list() .ft P .fi .UNINDENT .UNINDENT .INDENT 7.0 .TP .B histories Client module for Galaxy histories. .UNINDENT .INDENT 7.0 .TP .B jobs Client module for Galaxy jobs. .UNINDENT .INDENT 7.0 .TP .B libraries Client module for Galaxy libraries. .UNINDENT .INDENT 7.0 .TP .B tools Client module for Galaxy tools. .UNINDENT .INDENT 7.0 .TP .B workflows Client module for Galaxy workflows. .UNINDENT .UNINDENT .SS Client .sp Clients for interacting with specific Galaxy entity types. .sp Classes in this module should not be instantiated directly, but used via their handles in \fI\%GalaxyInstance\fP\&. .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjClient(obj_gi) .INDENT 7.0 .TP .B get_previews(**kwargs) Get a list of object previews. .sp Previews entity summaries provided by REST collection URIs, e.g. \fBhttp://host:port/api/libraries\fP\&. Being the most lightweight objects associated to the various entities, these are the ones that should be used to retrieve their basic info. .INDENT 7.0 .TP .B Return type list .TP .B Returns a list of object previews .UNINDENT .UNINDENT .INDENT 7.0 .TP .B list(**kwargs) Get a list of objects. .sp This method first gets the entity summaries, then gets the complete description for each entity with an additional GET call, so may be slow. .INDENT 7.0 .TP .B Return type list .TP .B Returns a list of objects .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjDatasetContainerClient(obj_gi) .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjHistoryClient(obj_gi) Interacts with Galaxy histories. .INDENT 7.0 .TP .B create(name=None) Create a new Galaxy history, optionally setting its name. .INDENT 7.0 .TP .B Return type \fI\%History\fP .TP .B Returns the history just created .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete(id_=None, name=None, purge=False) Delete the history with the given id or name. .sp Note that the same name can map to multiple histories. .INDENT 7.0 .TP .B Parameters \fBpurge\fP (\fIbool\fP) \-\- if \fBTrue\fP, also purge (permanently delete) the history .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For the purge option to work, the Galaxy instance must have the \fBallow_user_dataset_purge\fP option set to \fBTrue\fP in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get(id_) Retrieve the history corresponding to the given id. .INDENT 7.0 .TP .B Return type \fI\%History\fP .TP .B Returns the history corresponding to \fBid_\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_previews(name=None, deleted=False) .UNINDENT .INDENT 7.0 .TP .B list(name=None, deleted=False) Get histories owned by the user of this Galaxy instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- return only histories with this name .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- if \fBTrue\fP, return histories that have been deleted .UNINDENT .TP .B Return type list of \fI\%History\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjJobClient(obj_gi) Interacts with Galaxy jobs. .INDENT 7.0 .TP .B get(id_, full_details=False) Retrieve the job corresponding to the given id. .INDENT 7.0 .TP .B Parameters \fBfull_details\fP (\fIbool\fP) \-\- if \fBTrue\fP, return the complete list of details for the given job. .TP .B Return type \fI\%Job\fP .TP .B Returns the job corresponding to \fBid_\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_previews() .UNINDENT .INDENT 7.0 .TP .B list() Get the list of jobs of the current user. .INDENT 7.0 .TP .B Return type list of \fI\%Job\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjLibraryClient(obj_gi) Interacts with Galaxy libraries. .INDENT 7.0 .TP .B create(name, description=None, synopsis=None) Create a data library with the properties defined in the arguments. .INDENT 7.0 .TP .B Return type \fI\%Library\fP .TP .B Returns the library just created .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete(id_=None, name=None) Delete the library with the given id or name. .sp Note that the same name can map to multiple libraries. .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 get(id_) Retrieve the data library corresponding to the given id. .INDENT 7.0 .TP .B Return type \fI\%Library\fP .TP .B Returns the library corresponding to \fBid_\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_previews(name=None, deleted=False) .UNINDENT .INDENT 7.0 .TP .B list(name=None, deleted=False) Get libraries owned by the user of this Galaxy instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- return only libraries with this name .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- if \fBTrue\fP, return libraries that have been deleted .UNINDENT .TP .B Return type list of \fI\%Library\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjToolClient(obj_gi) Interacts with Galaxy tools. .INDENT 7.0 .TP .B get(id_, io_details=False, link_details=False) Retrieve the tool corresponding to the given id. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBio_details\fP (\fIbool\fP) \-\- if True, get also input and output details .IP \(bu 2 \fBlink_details\fP (\fIbool\fP) \-\- if True, get also link details .UNINDENT .TP .B Return type \fI\%Tool\fP .TP .B Returns the tool corresponding to \fBid_\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_previews(name=None, trackster=None) Get the list of tools installed on the Galaxy instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- return only tools with this name .IP \(bu 2 \fBtrackster\fP (\fIbool\fP) \-\- if True, only tools that are compatible with Trackster are returned .UNINDENT .TP .B Return type list of \fI\%Tool\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B list(name=None, trackster=None) Get the list of tools installed on the Galaxy instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- return only tools with this name .IP \(bu 2 \fBtrackster\fP (\fIbool\fP) \-\- if True, only tools that are compatible with Trackster are returned .UNINDENT .TP .B Return type list of \fI\%Tool\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.client.ObjWorkflowClient(obj_gi) Interacts with Galaxy workflows. .INDENT 7.0 .TP .B delete(id_=None, name=None) Delete the workflow with the given id or name. .sp Note that the same name can map to multiple workflows. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Deleting a workflow is irreversible \- all of the data from the workflow will be permanently deleted. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get(id_) Retrieve the workflow corresponding to the given id. .INDENT 7.0 .TP .B Return type \fI\%Workflow\fP .TP .B Returns the workflow corresponding to \fBid_\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_previews(name=None, published=False) .UNINDENT .INDENT 7.0 .TP .B import_new(src) Imports a new workflow into Galaxy. .INDENT 7.0 .TP .B Parameters \fBsrc\fP (\fIdict or str\fP) \-\- deserialized (dictionary) or serialized (str) JSON dump of the workflow (this is normally obtained by exporting a workflow from Galaxy). .TP .B Return type \fI\%Workflow\fP .TP .B Returns the workflow just imported .UNINDENT .UNINDENT .INDENT 7.0 .TP .B import_shared(id_) Imports a shared workflow to the user\(aqs space. .INDENT 7.0 .TP .B Parameters \fBid\fP (\fIstr\fP) \-\- workflow id .TP .B Return type \fI\%Workflow\fP .TP .B Returns the workflow just imported .UNINDENT .UNINDENT .INDENT 7.0 .TP .B list(name=None, published=False) Get workflows owned by the user of this Galaxy instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- return only workflows with this name .IP \(bu 2 \fBpublished\fP (\fIbool\fP) \-\- if \fBTrue\fP, return also published workflows .UNINDENT .TP .B Return type list of \fI\%Workflow\fP .UNINDENT .UNINDENT .UNINDENT .SS Wrappers .sp A basic object\-oriented interface for Galaxy entities. .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Wrapper(wrapped, parent=None, gi=None) Abstract base class for Galaxy entity wrappers. .sp Wrapper instances wrap deserialized JSON dictionaries such as the ones obtained by the Galaxy web API, converting key\-based access to attribute\-based access (e.g., \fBlibrary[\(aqname\(aq] \-> library.name\fP). .sp Dict keys that are converted to attributes are listed in the \fBBASE_ATTRS\fP class variable: this is the \(aqstable\(aq interface. Note that the wrapped dictionary is accessible via the \fBwrapped\fP attribute. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBwrapped\fP (\fIdict\fP) \-\- JSON\-serializable dictionary .IP \(bu 2 \fBparent\fP (\fI\%Wrapper\fP) \-\- the parent of this wrapper .IP \(bu 2 \fBgi\fP (\fBGalaxyInstance\fP) \-\- the GalaxyInstance through which we can access this wrapper .UNINDENT .UNINDENT .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq) .UNINDENT .INDENT 7.0 .TP .B clone() Return an independent copy of this wrapper. .UNINDENT .INDENT 7.0 .TP .B classmethod from_json(jdef) Build a new wrapper from a JSON dump. .UNINDENT .INDENT 7.0 .TP .B gi_module The GalaxyInstance module that deals with objects of this type. .UNINDENT .INDENT 7.0 .TP .B is_mapped \fBTrue\fP if this wrapper is mapped to an actual Galaxy entity. .UNINDENT .INDENT 7.0 .TP .B parent The parent of this wrapper. .UNINDENT .INDENT 7.0 .TP .B to_json() Return a JSON dump of this wrapper. .UNINDENT .INDENT 7.0 .TP .B touch() Mark this wrapper as having been modified since its creation. .UNINDENT .INDENT 7.0 .TP .B unmap() Disconnect this wrapper from Galaxy. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Step(step_dict, parent) Abstract base class for workflow steps. .sp Steps are the main building blocks of a Galaxy workflow. A step can be: an input (type \(aqdata_collection_input\(ga or \(aqdata_input\(ga), a computational tool (type \(aqtool\(ga) or a pause (type \(aqpause\(ga). .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqinput_steps\(aq, \(aqtool_id\(aq, \(aqtool_inputs\(aq, \(aqtool_version\(aq, \(aqtype\(aq) .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Workflow(wf_dict, gi=None) Workflows represent ordered sequences of computations on Galaxy. .sp A workflow defines a sequence of steps that produce one or more results from an input dataset. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq, \(aqinputs\(aq, \(aqpublished\(aq, \(aqsteps\(aq, \(aqtags\(aq) .UNINDENT .INDENT 7.0 .TP .B POLLING_INTERVAL = 10 .UNINDENT .INDENT 7.0 .TP .B convert_input_map(input_map) Convert \fBinput_map\fP to the format required by the Galaxy web API. .INDENT 7.0 .TP .B Parameters \fBinput_map\fP (\fIdict\fP) \-\- a mapping from input labels to datasets .TP .B Return type dict .TP .B Returns a mapping from input slot ids to dataset ids in the format required by the Galaxy web API. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B data_collection_input_ids Return the list of data collection input steps for this workflow. .UNINDENT .INDENT 7.0 .TP .B data_input_ids Return the list of data input steps for this workflow. .UNINDENT .INDENT 7.0 .TP .B delete() Delete this workflow. .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Deleting a workflow is irreversible \- all of the data from the workflow will be permanently deleted. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B export() Export a re\-importable representation of the workflow. .INDENT 7.0 .TP .B Return type dict .TP .B Returns a JSON\-serializable dump of the workflow .UNINDENT .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .INDENT 7.0 .TP .B input_labels Return the labels of this workflow\(aqs input steps. .UNINDENT .INDENT 7.0 .TP .B is_runnable Return True if the workflow can be run on Galaxy. .sp A workflow is considered runnable on a Galaxy instance if all of the tools it uses are installed in that instance. .UNINDENT .INDENT 7.0 .TP .B preview() .UNINDENT .INDENT 7.0 .TP .B run(input_map=None, history=\(aq\(aq, params=None, import_inputs=False, replacement_params=None, wait=False, polling_interval=10, break_on_error=True) Run the workflow in the current Galaxy instance. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinput_map\fP (\fIdict\fP) \-\- a mapping from workflow input labels to datasets, e.g.: \fBdict(zip(workflow.input_labels, library.get_datasets()))\fP .IP \(bu 2 \fBhistory\fP (\fI\%History\fP or str) \-\- either a valid history object (results will be stored there) or a string (a new history will be created with the given name). .IP \(bu 2 \fBparams\fP (\fBMapping\fP) \-\- parameter settings for workflow steps (see below) .IP \(bu 2 \fBimport_inputs\fP (\fIbool\fP) \-\- If \fBTrue\fP, workflow inputs will be imported into the history; if \fBFalse\fP, only workflow outputs will be visible in the history. .IP \(bu 2 \fBreplacement_params\fP (\fBMapping\fP) \-\- pattern\-based replacements for post\-job actions (see the docs for \fI\%run_workflow()\fP) .IP \(bu 2 \fBwait\fP (\fIbool\fP) \-\- whether to wait while the returned datasets are in a pending state .IP \(bu 2 \fBpolling_interval\fP (\fIfloat\fP) \-\- polling interval in seconds .IP \(bu 2 \fBbreak_on_error\fP (\fIbool\fP) \-\- whether to break as soon as at least one of the returned datasets is in the \(aqerror\(aq state .UNINDENT .TP .B Return type tuple .TP .B Returns list of output datasets, output history .UNINDENT .sp The \fBparams\fP dict should be structured as follows: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C PARAMS = {STEP_ID: PARAM_DICT, ...} PARAM_DICT = {NAME: VALUE, ...} .ft P .fi .UNINDENT .UNINDENT .sp For backwards compatibility, the following (deprecated) format is also supported: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C PARAMS = {TOOL_ID: PARAM_DICT, ...} .ft P .fi .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 .nf .ft C PARAM_DICT = {\(aqparam\(aq: NAME, \(aqvalue\(aq: VALUE} .ft P .fi .UNINDENT .UNINDENT .sp Note that this format allows only one parameter to be set per step. .sp Example: set \(aqa\(aq to 1 for the third workflow step: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C params = {workflow.steps[2].id: {\(aqa\(aq: 1}} .ft P .fi .UNINDENT .UNINDENT .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 This is a blocking operation that can take a very long time. If \fBwait\fP is set to \fBFalse\fP, the method will return as soon as the workflow has been \fIscheduled\fP, otherwise it will wait until the workflow has been \fIrun\fP\&. With a large number of steps, however, the delay may not be negligible even in the former case (e.g. minutes for 100 steps). .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B sorted_step_ids() Return a topological sort of the workflow\(aqs DAG. .UNINDENT .INDENT 7.0 .TP .B tool_ids Return the list of tool steps for this workflow. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.ContentInfo(info_dict, gi=None) Instances of this class wrap dictionaries obtained by getting \fB/api/{histories,libraries}//contents\fP from Galaxy. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqtype\(aq) .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.LibraryContentInfo(info_dict, gi=None) Instances of this class wrap dictionaries obtained by getting \fB/api/libraries//contents\fP from Galaxy. .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.HistoryContentInfo(info_dict, gi=None) Instances of this class wrap dictionaries obtained by getting \fB/api/histories//contents\fP from Galaxy. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqtype\(aq, \(aqdeleted\(aq, \(aqstate\(aq, \(aqvisible\(aq) .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.DatasetContainer(c_dict, content_infos=None, gi=None) Abstract base class for dataset containers (histories and libraries). .INDENT 7.0 .TP .B Parameters \fBcontent_infos\fP (list of \fI\%ContentInfo\fP) \-\- info objects for the container\(aqs contents .UNINDENT .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq) .UNINDENT .INDENT 7.0 .TP .B dataset_ids Return the ids of the contained datasets. .UNINDENT .INDENT 7.0 .TP .B get_dataset(ds_id) Retrieve the dataset corresponding to the given id. .INDENT 7.0 .TP .B Parameters \fBds_id\fP (\fIstr\fP) \-\- dataset id .TP .B Return type \fI\%HistoryDatasetAssociation\fP or \fI\%LibraryDataset\fP .TP .B Returns the dataset corresponding to \fBds_id\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_datasets(name=None) Get all datasets contained inside this dataset container. .INDENT 7.0 .TP .B Parameters \fBname\fP (\fIstr\fP) \-\- return only datasets with this name .TP .B Return type list of \fI\%HistoryDatasetAssociation\fP or list of \fI\%LibraryDataset\fP .TP .B Returns datasets with the given name contained inside this container .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 when filtering library datasets by name, specify their full paths starting from the library\(aqs root folder, e.g., \fB/seqdata/reads.fastq\fP\&. Full paths are available through the \fBcontent_infos\fP attribute of \fI\%Library\fP objects. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B preview() .UNINDENT .INDENT 7.0 .TP .B refresh() Re\-fetch the attributes pertaining to this object. .sp Returns: self .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.History(hist_dict, content_infos=None, gi=None) Maps to a Galaxy history. .INDENT 7.0 .TP .B API_MODULE = \(aqhistories\(aq .UNINDENT .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq, \(aqannotation\(aq, \(aqstate\(aq, \(aqstate_ids\(aq, \(aqstate_details\(aq, \(aqtags\(aq) .UNINDENT .INDENT 7.0 .TP .B CONTENT_INFO_TYPE alias of \fI\%HistoryContentInfo\fP .UNINDENT .INDENT 7.0 .TP .B DS_TYPE alias of \fI\%HistoryDatasetAssociation\fP .UNINDENT .INDENT 7.0 .TP .B delete(purge=False) Delete this history. .INDENT 7.0 .TP .B Parameters \fBpurge\fP (\fIbool\fP) \-\- if \fBTrue\fP, also purge (permanently delete) the history .UNINDENT .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For the purge option to work, the Galaxy instance must have the \fBallow_user_dataset_purge\fP option set to \fBTrue\fP in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B download(jeha_id, outf, chunk_size=4096) Download an export archive for this history. Use \fI\%export()\fP to create an export and get the required \fBjeha_id\fP\&. See \fI\%download_history()\fP for parameter and return value info. .UNINDENT .INDENT 7.0 .TP .B export(gzip=True, include_hidden=False, include_deleted=False, wait=False) Start a job to create an export archive for this history. See \fI\%export_history()\fP for parameter and return value info. .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .INDENT 7.0 .TP .B import_dataset(lds) Import a dataset into the history from a library. .INDENT 7.0 .TP .B Parameters \fBlds\fP (\fI\%LibraryDataset\fP) \-\- the library dataset to import .TP .B Return type \fI\%HistoryDatasetAssociation\fP .TP .B Returns the imported history dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B paste_content(content, **kwargs) Upload a string to a new dataset in this history. .INDENT 7.0 .TP .B Parameters \fBcontent\fP (\fIstr\fP) \-\- content of the new dataset to upload .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters (except file_name). .INDENT 7.0 .TP .B Return type \fI\%HistoryDatasetAssociation\fP .TP .B Returns the uploaded dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update(name=None, annotation=None, **kwds) 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 \fBname\fP (\fIstr\fP) \-\- Replace history name with the given string .IP \(bu 2 \fBannotation\fP (\fIstr\fP) \-\- Replace history annotation with the given string .IP \(bu 2 \fBdeleted\fP (\fIbool\fP) \-\- Mark or unmark history as 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 .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_dataset(path, **kwargs) Upload the file specified by \fBpath\fP to this history. .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- path of the file to upload .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters. .INDENT 7.0 .TP .B Return type \fI\%HistoryDatasetAssociation\fP .TP .B Returns the uploaded dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_file(path, **kwargs) Upload the file specified by \fBpath\fP to this history. .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- path of the file to upload .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters. .INDENT 7.0 .TP .B Return type \fI\%HistoryDatasetAssociation\fP .TP .B Returns the uploaded dataset .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_from_ftp(path, **kwargs) Upload the file specified by \fBpath\fP from the user\(aqs FTP directory to this history. .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- path of the file in the user\(aqs FTP directory .UNINDENT .sp See \fI\%upload_file()\fP for the optional parameters. .INDENT 7.0 .TP .B Return type \fI\%HistoryDatasetAssociation\fP .TP .B Returns the uploaded dataset .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Library(lib_dict, content_infos=None, gi=None) Maps to a Galaxy library. .INDENT 7.0 .TP .B API_MODULE = \(aqlibraries\(aq .UNINDENT .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq, \(aqdescription\(aq, \(aqsynopsis\(aq) .UNINDENT .INDENT 7.0 .TP .B CONTENT_INFO_TYPE alias of \fI\%LibraryContentInfo\fP .UNINDENT .INDENT 7.0 .TP .B DS_TYPE alias of \fI\%LibraryDataset\fP .UNINDENT .INDENT 7.0 .TP .B copy_from_dataset(hda, folder=None, message=\(aq\(aq) Copy a history dataset into this library. .INDENT 7.0 .TP .B Parameters \fBhda\fP (\fI\%HistoryDatasetAssociation\fP) \-\- history dataset to copy into the library .UNINDENT .sp See \fI\%upload_data()\fP for info on other params. .UNINDENT .INDENT 7.0 .TP .B create_folder(name, description=None, base_folder=None) Create a folder in this library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- folder name .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- optional folder description .IP \(bu 2 \fBbase_folder\fP (\fI\%Folder\fP) \-\- parent folder, or \fBNone\fP to create in the root folder .UNINDENT .TP .B Return type \fI\%Folder\fP .TP .B Returns the folder just created .UNINDENT .UNINDENT .INDENT 7.0 .TP .B delete() Delete this library. .UNINDENT .INDENT 7.0 .TP .B folder_ids Return the ids of the contained folders. .UNINDENT .INDENT 7.0 .TP .B get_folder(f_id) Retrieve the folder corresponding to the given id. .INDENT 7.0 .TP .B Return type \fI\%Folder\fP .TP .B Returns the folder corresponding to \fBf_id\fP .UNINDENT .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .INDENT 7.0 .TP .B root_folder The root folder of this library. .INDENT 7.0 .TP .B Return type \fI\%Folder\fP .TP .B Returns the root folder of this library .UNINDENT .UNINDENT .INDENT 7.0 .TP .B upload_data(data, folder=None, **kwargs) Upload data to this library. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdata\fP (\fIstr\fP) \-\- dataset contents .IP \(bu 2 \fBfolder\fP (\fI\%Folder\fP) \-\- a folder object, or \fBNone\fP to upload to the root folder .UNINDENT .TP .B Return type \fI\%LibraryDataset\fP .TP .B Returns the dataset object that represents the uploaded content .UNINDENT .sp Optional keyword arguments: \fBfile_type\fP, \fBdbkey\fP\&. .UNINDENT .INDENT 7.0 .TP .B upload_from_galaxy_fs(paths, folder=None, link_data_only=None, **kwargs) Upload data to this library from filesystem paths on the server. .sp \fBNOTE:\fP .INDENT 7.0 .INDENT 3.5 For this method to work, the Galaxy instance must have the \fBallow_library_path_paste\fP option set to \fBTrue\fP in the \fBconfig/galaxy.ini\fP configuration file. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpaths\fP (str or \fBIterable\fP of str) \-\- server\-side file paths from which data should be read .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 .UNINDENT .TP .B Return type list of \fI\%LibraryDataset\fP .TP .B Returns the dataset objects that represent the uploaded content .UNINDENT .sp See \fI\%upload_data()\fP for info on other params. .UNINDENT .INDENT 7.0 .TP .B upload_from_local(path, folder=None, **kwargs) Upload data to this library from a local file. .INDENT 7.0 .TP .B Parameters \fBpath\fP (\fIstr\fP) \-\- local file path from which data should be read .UNINDENT .sp See \fI\%upload_data()\fP for info on other params. .UNINDENT .INDENT 7.0 .TP .B upload_from_url(url, folder=None, **kwargs) Upload data to this library from the given URL. .INDENT 7.0 .TP .B Parameters \fBurl\fP (\fIstr\fP) \-\- URL from which data should be read .UNINDENT .sp See \fI\%upload_data()\fP for info on other params. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Folder(f_dict, container, gi=None) Maps to a folder in a Galaxy library. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdescription\(aq, \(aqdeleted\(aq, \(aqitem_count\(aq) .UNINDENT .INDENT 7.0 .TP .B container_id Deprecated property. .sp Id of the folder container. Use \fBcontainer.id\fP instead. .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .INDENT 7.0 .TP .B parent The parent folder of this folder. The parent of the root folder is \fBNone\fP\&. .INDENT 7.0 .TP .B Return type \fI\%Folder\fP .TP .B Returns the parent of this folder .UNINDENT .UNINDENT .INDENT 7.0 .TP .B refresh() Re\-fetch the attributes pertaining to this object. .sp Returns: self .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Dataset(ds_dict, container, gi=None) Abstract base class for Galaxy datasets. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdata_type\(aq, \(aqfile_name\(aq, \(aqfile_size\(aq, \(aqstate\(aq, \(aqdeleted\(aq, \(aqfile_ext\(aq) .UNINDENT .INDENT 7.0 .TP .B POLLING_INTERVAL = 1 .UNINDENT .INDENT 7.0 .TP .B container_id Deprecated property. .sp Id of the dataset container. Use \fBcontainer.id\fP instead. .UNINDENT .INDENT 7.0 .TP .B download(file_object, chunk_size=4096) Open dataset for reading and save its contents to \fBfile_object\fP\&. .INDENT 7.0 .TP .B Parameters \fBfile_object\fP (\fIfile\fP) \-\- output file object .UNINDENT .sp See \fI\%get_stream()\fP for info on other params. .UNINDENT .INDENT 7.0 .TP .B get_contents(chunk_size=4096) Open dataset for reading and return its \fBfull\fP contents. .sp See \fI\%get_stream()\fP for param info. .UNINDENT .INDENT 7.0 .TP .B get_stream(chunk_size=4096) Open dataset for reading and return an iterator over its contents. .INDENT 7.0 .TP .B Parameters \fBchunk_size\fP (\fIint\fP) \-\- read this amount of bytes at a time .UNINDENT .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 Due to a change in the Galaxy API endpoint, this method does not work on \fI\%LibraryDataset\fP instances with Galaxy \fBrelease_2014.06.02\fP\&. Methods that delegate work to this one are also affected: \fI\%peek()\fP, \fI\%download()\fP and \fI\%get_contents()\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B peek(chunk_size=4096) Open dataset for reading and return the first chunk. .sp See \fI\%get_stream()\fP for param info. .UNINDENT .INDENT 7.0 .TP .B refresh() Re\-fetch the attributes pertaining to this object. .sp Returns: self .UNINDENT .INDENT 7.0 .TP .B wait(polling_interval=1, break_on_error=True) Wait for this dataset to come out of the pending states. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpolling_interval\fP (\fIfloat\fP) \-\- polling interval in seconds .IP \(bu 2 \fBbreak_on_error\fP (\fIbool\fP) \-\- if \fBTrue\fP, raise a RuntimeError exception if the dataset ends in the \(aqerror\(aq state. .UNINDENT .UNINDENT .sp \fBWARNING:\fP .INDENT 7.0 .INDENT 3.5 This is a blocking operation that can take a very long time. Also, note that this method does not return anything; however, this dataset is refreshed (possibly multiple times) during the execution. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.HistoryDatasetAssociation(ds_dict, container, gi=None) Maps to a Galaxy \fBHistoryDatasetAssociation\fP\&. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdata_type\(aq, \(aqfile_name\(aq, \(aqfile_size\(aq, \(aqstate\(aq, \(aqdeleted\(aq, \(aqfile_ext\(aq, \(aqtags\(aq, \(aqvisible\(aq) .UNINDENT .INDENT 7.0 .TP .B SRC = \(aqhda\(aq .UNINDENT .INDENT 7.0 .TP .B delete() Delete this dataset. .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.LibraryDatasetDatasetAssociation(ds_dict, container, gi=None) Maps to a Galaxy \fBLibraryDatasetDatasetAssociation\fP\&. .INDENT 7.0 .TP .B SRC = \(aqldda\(aq .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.LibraryDataset(ds_dict, container, gi=None) Maps to a Galaxy \fBLibraryDataset\fP\&. .INDENT 7.0 .TP .B SRC = \(aqld\(aq .UNINDENT .INDENT 7.0 .TP .B delete(purged=False) Delete this library dataset. .INDENT 7.0 .TP .B Parameters \fBpurged\fP (\fIbool\fP) \-\- if \fBTrue\fP, also purge (permanently delete) the dataset .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Tool(t_dict, gi=None) Maps to a Galaxy tool. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqversion\(aq) .UNINDENT .INDENT 7.0 .TP .B POLLING_INTERVAL = 10 .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .INDENT 7.0 .TP .B run(inputs, history, wait=False, polling_interval=10) Execute this tool in the given history with inputs from dict \fBinputs\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBinputs\fP (\fIdict\fP) \-\- dictionary of input datasets and parameters for the tool (see below) .IP \(bu 2 \fBhistory\fP (\fI\%History\fP) \-\- the history where to execute the tool .IP \(bu 2 \fBwait\fP (\fIbool\fP) \-\- whether to wait while the returned datasets are in a pending state .IP \(bu 2 \fBpolling_interval\fP (\fIfloat\fP) \-\- polling interval in seconds .UNINDENT .TP .B Return type list of \fI\%HistoryDatasetAssociation\fP .TP .B Returns list of output datasets .UNINDENT .sp The \fBinputs\fP dict should contain input datasets and parameters in the (largely undocumented) format used by the Galaxy API. Some examples can be found in \fI\%Galaxy\(aqs API test suite\fP\&. The value of an input dataset can also be a \fI\%Dataset\fP object, which will be automatically converted to the needed format. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Job(j_dict, gi=None) Maps to a Galaxy job. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqstate\(aq) .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.Preview(pw_dict, gi=None) Abstract base class for Galaxy entity \(aqpreviews\(aq. .sp Classes derived from this one model the short summaries returned by global getters such as \fB/api/libraries\fP\&. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq) .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.LibraryPreview(pw_dict, gi=None) Models Galaxy library \(aqpreviews\(aq. .sp Instances of this class wrap dictionaries obtained by getting \fB/api/libraries\fP from Galaxy. .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.HistoryPreview(pw_dict, gi=None) Models Galaxy history \(aqpreviews\(aq. .sp Instances of this class wrap dictionaries obtained by getting \fB/api/histories\fP from Galaxy. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq, \(aqtags\(aq) .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class bioblend.galaxy.objects.wrappers.WorkflowPreview(pw_dict, gi=None) Models Galaxy workflow \(aqpreviews\(aq. .sp Instances of this class wrap dictionaries obtained by getting \fB/api/workflows\fP from Galaxy. .INDENT 7.0 .TP .B BASE_ATTRS = (\(aqid\(aq, \(aqname\(aq, \(aqdeleted\(aq, \(aqpublished\(aq, \(aqtags\(aq) .UNINDENT .INDENT 7.0 .TP .B gi_module .UNINDENT .UNINDENT .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\%http://wiki.galaxyproject.org/Learn/API\fP . .sp To open a connection call: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C from bioblend.galaxy import GalaxyInstance gi = GalaxyInstance(url=\(aqhttp://example.galaxy.url\(aq, key=\(aqyour\-API\-key\(aq) .ft P .fi .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 .nf .ft C >>> gi.histories.get_histories() [{u\(aqid\(aq: u\(aqf3c2b0f3ecac9f02\(aq, u\(aqname\(aq: u\(aqRNAseq_DGE_BASIC_Prep\(aq, u\(aqurl\(aq: u\(aq/api/histories/f3c2b0f3ecac9f02\(aq}, {u\(aqid\(aq: u\(aq8a91dcf1866a80c2\(aq, u\(aqname\(aq: u\(aqJune demo\(aq, u\(aqurl\(aq: u\(aq/api/histories/8a91dcf1866a80c2\(aq}] .ft P .fi .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 .nf .ft C >>> gi.histories.show_history(\(aqf3c2b0f3ecac9f02\(aq, contents=False) {u\(aqannotation\(aq: u\(aq\(aq, u\(aqcontents_url\(aq: u\(aq/api/histories/f3c2b0f3ecac9f02/contents\(aq, u\(aqid\(aq: u\(aqf3c2b0f3ecac9f02\(aq, u\(aqname\(aq: u\(aqRNAseq_DGE_BASIC_Prep\(aq, u\(aqnice_size\(aq: u\(aq93.5 MB\(aq, u\(aqstate\(aq: u\(aqok\(aq, u\(aqstate_details\(aq: {u\(aqdiscarded\(aq: 0, u\(aqempty\(aq: 0, u\(aqerror\(aq: 0, u\(aqfailed_metadata\(aq: 0, u\(aqnew\(aq: 0, u\(aqok\(aq: 7, u\(aqpaused\(aq: 0, u\(aqqueued\(aq: 0, u\(aqrunning\(aq: 0, u\(aqsetting_metadata\(aq: 0, u\(aqupload\(aq: 0 }, u\(aqstate_ids\(aq: {u\(aqdiscarded\(aq: [], u\(aqempty\(aq: [], u\(aqerror\(aq: [], u\(aqfailed_metadata\(aq: [], u\(aqnew\(aq: [], u\(aqok\(aq: [u\(aqd6842fb08a76e351\(aq, u\(aq10a4b652da44e82a\(aq, u\(aq81c601a2549966a0\(aq, u\(aqa154f05e3bcee26b\(aq, u\(aq1352fe19ddce0400\(aq, u\(aq06d549c52d753e53\(aq, u\(aq9ec54455d6279cc7\(aq], u\(aqpaused\(aq: [], u\(aqqueued\(aq: [], u\(aqrunning\(aq: [], u\(aqsetting_metadata\(aq: [], u\(aqupload\(aq: [] } } .ft P .fi .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 .nf .ft C >>> gi.datasets.show_dataset(\(aq10a4b652da44e82a\(aq) {u\(aqdata_type\(aq: u\(aqfastqsanger\(aq, u\(aqdeleted\(aq: False, u\(aqfile_size\(aq: 16527060, u\(aqgenome_build\(aq: u\(aqdm3\(aq, u\(aqid\(aq: 17499, u\(aqmetadata_data_lines\(aq: None, u\(aqmetadata_dbkey\(aq: u\(aqdm3\(aq, u\(aqmetadata_sequences\(aq: None, u\(aqmisc_blurb\(aq: u\(aq15.8 MB\(aq, u\(aqmisc_info\(aq: u\(aqNoneuploaded fastqsanger file\(aq, u\(aqmodel_class\(aq: u\(aqHistoryDatasetAssociation\(aq, u\(aqname\(aq: u\(aqC1_R2_1.chr4.fq\(aq, u\(aqpurged\(aq: False, u\(aqstate\(aq: u\(aqok\(aq, u\(aqvisible\(aq: True} .ft P .fi .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 .nf .ft C >>> gi.tools.upload_file(\(aqtest.txt\(aq, \(aqf3c2b0f3ecac9f02\(aq) {u\(aqimplicit_collections\(aq: [], u\(aqjobs\(aq: [{u\(aqcreate_time\(aq: u\(aq2015\-07\-28T17:52:39.756488\(aq, u\(aqexit_code\(aq: None, u\(aqid\(aq: u\(aq9752b387803d3e1e\(aq, u\(aqmodel_class\(aq: u\(aqJob\(aq, u\(aqstate\(aq: u\(aqnew\(aq, u\(aqtool_id\(aq: u\(aqupload1\(aq, u\(aqupdate_time\(aq: u\(aq2015\-07\-28T17:52:39.987509\(aq}], u\(aqoutput_collections\(aq: [], u\(aqoutputs\(aq: [{u\(aqcreate_time\(aq: u\(aq2015\-07\-28T17:52:39.331176\(aq, u\(aqdata_type\(aq: u\(aqgalaxy.datatypes.data.Text\(aq, u\(aqdeleted\(aq: False, u\(aqfile_ext\(aq: u\(aqauto\(aq, u\(aqfile_size\(aq: 0, u\(aqgenome_build\(aq: u\(aq?\(aq, u\(aqhda_ldda\(aq: u\(aqhda\(aq, u\(aqhid\(aq: 16, u\(aqhistory_content_type\(aq: u\(aqdataset\(aq, u\(aqhistory_id\(aq: u\(aqf3c2b0f3ecac9f02\(aq, u\(aqid\(aq: u\(aq59c76a119581e190\(aq, u\(aqmetadata_data_lines\(aq: None, u\(aqmetadata_dbkey\(aq: u\(aq?\(aq, u\(aqmisc_blurb\(aq: None, u\(aqmisc_info\(aq: None, u\(aqmodel_class\(aq: u\(aqHistoryDatasetAssociation\(aq, u\(aqname\(aq: u\(aqtest.txt\(aq, u\(aqoutput_name\(aq: u\(aqoutput0\(aq, u\(aqpeek\(aq: u\(aq
\(aq, u\(aqpurged\(aq: False, u\(aqstate\(aq: u\(aqqueued\(aq, u\(aqtags\(aq: [], u\(aqupdate_time\(aq: u\(aq2015\-07\-28T17:52:39.611887\(aq, u\(aquuid\(aq: u\(aqff0ee99b\-7542\-4125\-802d\-7a193f388e7e\(aq, u\(aqvisible\(aq: True}]} .ft P .fi .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 .nf .ft C >>> gi.tools.upload_from_ftp(\(aqtest.txt\(aq, \(aqf3c2b0f3ecac9f02\(aq) {u\(aqimplicit_collections\(aq: [], u\(aqjobs\(aq: [{u\(aqcreate_time\(aq: u\(aq2015\-07\-28T17:57:43.704394\(aq, u\(aqexit_code\(aq: None, u\(aqid\(aq: u\(aq82b264d8c3d11790\(aq, u\(aqmodel_class\(aq: u\(aqJob\(aq, u\(aqstate\(aq: u\(aqnew\(aq, u\(aqtool_id\(aq: u\(aqupload1\(aq, u\(aqupdate_time\(aq: u\(aq2015\-07\-28T17:57:43.910958\(aq}], u\(aqoutput_collections\(aq: [], u\(aqoutputs\(aq: [{u\(aqcreate_time\(aq: u\(aq2015\-07\-28T17:57:43.209041\(aq, u\(aqdata_type\(aq: u\(aqgalaxy.datatypes.data.Text\(aq, u\(aqdeleted\(aq: False, u\(aqfile_ext\(aq: u\(aqauto\(aq, u\(aqfile_size\(aq: 0, u\(aqgenome_build\(aq: u\(aq?\(aq, u\(aqhda_ldda\(aq: u\(aqhda\(aq, u\(aqhid\(aq: 17, u\(aqhistory_content_type\(aq: u\(aqdataset\(aq, u\(aqhistory_id\(aq: u\(aqf3c2b0f3ecac9f02\(aq, u\(aqid\(aq: u\(aqa676e8f07209a3be\(aq, u\(aqmetadata_data_lines\(aq: None, u\(aqmetadata_dbkey\(aq: u\(aq?\(aq, u\(aqmisc_blurb\(aq: None, u\(aqmisc_info\(aq: None, u\(aqmodel_class\(aq: u\(aqHistoryDatasetAssociation\(aq, u\(aqname\(aq: u\(aqtest.txt\(aq, u\(aqoutput_name\(aq: u\(aqoutput0\(aq, u\(aqpeek\(aq: u\(aq
\(aq, u\(aqpurged\(aq: False, u\(aqstate\(aq: u\(aqqueued\(aq, u\(aqtags\(aq: [], u\(aqupdate_time\(aq: u\(aq2015\-07\-28T17:57:43.544407\(aq, u\(aquuid\(aq: u\(aq2cbe8f0a\-4019\-47c4\-87e2\-005ce35b8449\(aq, u\(aqvisible\(aq: True}]} .ft P .fi .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 .nf .ft C >>> gi.libraries.get_libraries() [{u\(aqid\(aq: u\(aq8e6f930d00d123ea\(aq, u\(aqname\(aq: u\(aqRNA\-seq workshop data\(aq, u\(aqurl\(aq: u\(aq/api/libraries/8e6f930d00d123ea\(aq}, {u\(aqid\(aq: u\(aqf740ab636b360a70\(aq, u\(aqname\(aq: u\(aq1000 genomes\(aq, u\(aqurl\(aq: u\(aq/api/libraries/f740ab636b360a70\(aq}] .ft P .fi .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 .nf .ft C >>> gi.libraries.show_library(\(aq8e6f930d00d123ea\(aq) {u\(aqcontents_url\(aq: u\(aq/api/libraries/8e6f930d00d123ea/contents\(aq, u\(aqdescription\(aq: u\(aqRNA\-Seq workshop data\(aq, u\(aqname\(aq: u\(aqRNA\-Seq\(aq, u\(aqsynopsis\(aq: u\(aqData for the RNA\-Seq tutorial\(aq} .ft P .fi .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 .nf .ft C >>> gi.libraries.upload_file_from_local_path(\(aq8e6f930d00d123ea\(aq, \(aq/local/path/to/mydata.fastq\(aq, file_type=\(aqfastqsanger\(aq) .ft P .fi .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 .nf .ft C >>> gi.workflows.get_workflows() [{u\(aqid\(aq: u\(aqe8b85ad72aefca86\(aq, u\(aqname\(aq: u"TopHat + cufflinks part 1", u\(aqurl\(aq: u\(aq/api/workflows/e8b85ad72aefca86\(aq}, {u\(aqid\(aq: u\(aqb0631c44aa74526d\(aq, u\(aqname\(aq: u\(aqCuffDiff\(aq, u\(aqurl\(aq: u\(aq/api/workflows/b0631c44aa74526d\(aq}] .ft P .fi .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 .nf .ft C >>> gi.workflows.show_workflow(\(aqe8b85ad72aefca86\(aq) {u\(aqid\(aq: u\(aqe8b85ad72aefca86\(aq, u\(aqinputs\(aq: {u\(aq252\(aq: {u\(aqlabel\(aq: u\(aqInput RNA\-seq fastq\(aq, u\(aqvalue\(aq: u\(aq\(aq } }, u\(aqname\(aq: u"TopHat + cufflinks part 1", u\(aqsteps\(aq: {u\(aq250\(aq: {u\(aqid\(aq: 250, u\(aqinput_steps\(aq: {u\(aqinput1\(aq: {u\(aqsource_step\(aq: 252, u\(aqstep_output\(aq: u\(aqoutput\(aq } }, u\(aqtool_id\(aq: u\(aqtophat\(aq, u\(aqtype\(aq: u\(aqtool\(aq }, u\(aq251\(aq: {u\(aqid\(aq: 251, u\(aqinput_steps\(aq: {u\(aqinput\(aq: {u\(aqsource_step\(aq: 250, u\(aqstep_output\(aq: u\(aqaccepted_hits\(aq } }, u\(aqtool_id\(aq: u\(aqcufflinks\(aq, u\(aqtype\(aq: u\(aqtool\(aq }, u\(aq252\(aq: {u\(aqid\(aq: 252, u\(aqinput_steps\(aq: {}, u\(aqtool_id\(aq: None, u\(aqtype\(aq: u\(aqdata_input\(aq } }, u\(aqurl\(aq: u\(aq/api/workflows/e8b85ad72aefca86\(aq } .ft P .fi .UNINDENT .UNINDENT .SS Export or import a Workflow .sp Workflows can be exported from or imported into Galaxy as JSON. 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 .nf .ft C >>> workflow_string = gi.workflows.export_workflow_json(\(aqe8b85ad72aefca86\(aq) .ft P .fi .UNINDENT .UNINDENT .sp This gives us a (rather long) string with a JSON\-encoded representation of the Workflow. We can import this string as a new Workflow with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C >>> gi.workflows.import_workflow_json(workflow_string) {u\(aqid\(aq: u\(aqc0bacafdfe211f9a\(aq, u\(aqname\(aq: u\(aqTopHat + cufflinks part 1 (imported from API)\(aq, u\(aqurl\(aq: u\(aq/api/workflows/c0bacafdfe211f9a\(aq} .ft P .fi .UNINDENT .UNINDENT .sp This call returns a dictionary containing basic metadata on the new Workflow object. Since in this case we have imported the JSON string into the original Galaxy instance, we now have a duplicate of the original Workflow in our account: .sp .nf .ft C >>> gi.workflows.get_workflows() [{u\(aqid\(aq: u\(aqc0bacafdfe211f9a\(aq, u\(aqname\(aq: u\(aqTopHat + cufflinks part 1 (imported from API)\(aq, u\(aqurl\(aq: u\(aq/api/workflows/c0bacafdfe211f9a\(aq}, {u\(aqid\(aq: u\(aqe8b85ad72aefca86\(aq, u\(aqname\(aq: u"TopHat + cufflinks part 1", u\(aqurl\(aq: u\(aq/api/workflows/e8b85ad72aefca86\(aq}, {u\(aqid\(aq: u\(aqb0631c44aa74526d\(aq, u\(aqname\(aq: u\(aqCuffDiff\(aq, u\(aqurl\(aq: u\(aq/api/workflows/b0631c44aa74526d\(aq}] .ft P .fi .sp Instead of using JSON strings 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 API reference 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 Run a Workflow .sp To run 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 .nf .ft C >>> wf = gi.workflows.show_workflow(\(aqe8b85ad72aefca86\(aq) >>> wf[\(aqinputs\(aq] {u\(aq252\(aq: {u\(aqlabel\(aq: u\(aqInput RNA\-seq fastq\(aq, u\(aqvalue\(aq: u\(aq\(aq } } .ft P .fi .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 \fBrun_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 .nf .ft C >>> datamap = dict() >>> datamap[\(aq252\(aq] = { \(aqsrc\(aq:\(aqhda\(aq, \(aqid\(aq:\(aq10a4b652da44e82a\(aq } >>> gi.workflows.run_workflow(\(aqe8b85ad72aefca86\(aq, datamap, history_name=\(aqNew output history\(aq) {u\(aqhistory\(aq: u\(aq0a7b7992a7cabaec\(aq, u\(aqoutputs\(aq: [u\(aq33be8ad9917d9207\(aq, u\(aqfbee1c2dc793c114\(aq, u\(aq85866441984f9e28\(aq, u\(aq1c51aa78d3742386\(aq, u\(aqa68e8770e52d03b4\(aq, u\(aqc54baf809e3036ac\(aq, u\(aqba0db8ce6cd1fe8f\(aq, u\(aqc019e4cf08b2ac94\(aq ] } .ft P .fi .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 API reference 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 \fBrun_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. \fBrun_workflow\fP returns the id of the output History and of the datasets that will be created as a result of this run. Note that these dataset ids are valid immediately, so we can specify these datasets as inputs to new jobs even before the files have been created, and the new jobs will be added to the queue with the appropriate dependencies. .sp If we view the output History immediately after calling \fBrun_workflow\fP, we will see something like: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C >>> gi.histories.show_history(\(aq0a7b7992a7cabaec\(aq) {u\(aqannotation\(aq: u\(aq\(aq, u\(aqcontents_url\(aq: u\(aq/api/histories/0a7b7992a7cabaec/contents\(aq, u\(aqid\(aq: u\(aq0a7b7992a7cabaec\(aq, u\(aqname\(aq: u\(aqNew output history\(aq, u\(aqnice_size\(aq: u\(aq0 bytes\(aq, u\(aqstate\(aq: u\(aqqueued\(aq, u\(aqstate_details\(aq: {u\(aqdiscarded\(aq: 0, u\(aqempty\(aq: 0, u\(aqerror\(aq: 0, u\(aqfailed_metadata\(aq: 0, u\(aqnew\(aq: 0, u\(aqok\(aq: 0, u\(aqpaused\(aq: 0, u\(aqqueued\(aq: 8, u\(aqrunning\(aq: 0, u\(aqsetting_metadata\(aq: 0, u\(aqupload\(aq: 0}, u\(aqstate_ids\(aq: {u\(aqdiscarded\(aq: [], u\(aqempty\(aq: [], u\(aqerror\(aq: [], u\(aqfailed_metadata\(aq: [], u\(aqnew\(aq: [], u\(aqok\(aq: [], u\(aqpaused\(aq: [], u\(aqqueued\(aq: [u\(aq33be8ad9917d9207\(aq, u\(aqfbee1c2dc793c114\(aq, u\(aq85866441984f9e28\(aq, u\(aq1c51aa78d3742386\(aq, u\(aqa68e8770e52d03b4\(aq, u\(aqc54baf809e3036ac\(aq, u\(aqba0db8ce6cd1fe8f\(aq, u\(aqc019e4cf08b2ac94\(aq], u\(aqrunning\(aq: [], u\(aqsetting_metadata\(aq: [], u\(aqupload\(aq: [] } } .ft P .fi .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 .nf .ft C >>> gi.users.get_users() [{u\(aqemail\(aq: u\(aquserA@unimelb.edu.au\(aq, u\(aqid\(aq: u\(aq975a9ce09b49502a\(aq, u\(aqquota_percent\(aq: None, u\(aqurl\(aq: u\(aq/api/users/975a9ce09b49502a\(aq}, {u\(aqemail\(aq: u\(aquserB@student.unimelb.edu.au\(aq, u\(aqid\(aq: u\(aq0193a95acf427d2c\(aq, u\(aqquota_percent\(aq: None, u\(aqurl\(aq: u\(aq/api/users/0193a95acf427d2c\(aq}] .ft P .fi .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 .INDENT 0.0 .TP .B class bioblend.toolshed.ToolShedInstance(url, key=\(aq\(aq, email=None, password=None) A base representation of an instance of ToolShed, identified by a URL and a user\(aqs API key. .sp After you have created an \fBToolShed\fP object, access various modules via the class fields (see the source for the most up\-to\-date list): \fBrepositories\fP are the minimum set supported. For example, to work with a repositories, and get a list of all the public repositories, the following should be done: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C from bioblend import toolshed ts = toolshed.ToolShedInstance(url=\(aqhttp://testtoolshed.g2.bx.psu.edu\(aq) rl = ts.repositories.get_repositories() tools = ts.tools.search_tools(\(aqfastq\(aq) .ft P .fi .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBurl\fP (\fIstr\fP) \-\- A FQDN or IP for a given instance of ToolShed. For example: \fI\%http://testtoolshed.g2.bx.psu.edu\fP .IP \(bu 2 \fBkey\fP (\fIstr\fP) \-\- If required, user\(aqs API key for the given instance of ToolShed, obtained from the user preferences. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B __init__(url, key=\(aq\(aq, email=None, password=None) A base representation of an instance of ToolShed, identified by a URL and a user\(aqs API key. .sp After you have created an \fBToolShed\fP object, access various modules via the class fields (see the source for the most up\-to\-date list): \fBrepositories\fP are the minimum set supported. For example, to work with a repositories, and get a list of all the public repositories, the following should be done: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C from bioblend import toolshed ts = toolshed.ToolShedInstance(url=\(aqhttp://testtoolshed.g2.bx.psu.edu\(aq) rl = ts.repositories.get_repositories() tools = ts.tools.search_tools(\(aqfastq\(aq) .ft P .fi .UNINDENT .UNINDENT .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBurl\fP (\fIstr\fP) \-\- A FQDN or IP for a given instance of ToolShed. For example: \fI\%http://testtoolshed.g2.bx.psu.edu\fP .IP \(bu 2 \fBkey\fP (\fIstr\fP) \-\- If required, user\(aqs API key for the given instance of ToolShed, obtained from the user preferences. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Repositories .sp Interaction with a Tool Shed instance repositories .INDENT 0.0 .TP .B class bioblend.toolshed.repositories.ToolShedClient(toolshed_instance) .INDENT 7.0 .TP .B create_repository(name, synopsis, description=None, type=\(aqunrestricted\(aq, remote_repository_url=None, homepage_url=None, category_ids=None) Create a new repository in a Tool Shed .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- Name of the repository .IP \(bu 2 \fBsynopsis\fP (\fIstr\fP) \-\- Synopsis of the repository .IP \(bu 2 \fBdescription\fP (\fIstr\fP) \-\- Optional description of the repository .IP \(bu 2 \fBtype\fP (\fIstr\fP) \-\- type of the repository. One of "unrestricted", "repository_suite_definition", or "tool_dependency_definition" .IP \(bu 2 \fBremote_repository_url\fP (\fIstr\fP) \-\- Remote URL (e.g. github/bitbucket repository) .IP \(bu 2 \fBhomepage_url\fP (\fIstr\fP) \-\- Upstream\(aqs homepage for the project. .IP \(bu 2 \fBcategory_ids\fP (\fIlist\fP) \-\- List of encoded category IDs .UNINDENT .TP .B Return type dict .TP .B Returns a dictionary containing information about the new repository. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C { "deleted": false, "deprecated": false, "description": "new_synopsis", "homepage_url": "https://github.com/galaxyproject/", "id": "8cf91205f2f737f4", "long_description": "this is some repository", "model_class": "Repository", "name": "new_repo_17", "owner": "qqqqqq", "private": false, "remote_repository_url": "https://github.com/galaxyproject/tools\-devteam", "times_downloaded": 0, "type": "unrestricted", "user_id": "adb5f5c93f827949" } .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_categories() Returns a list of dictionaries that contain descriptions of the repository categories found on the given Tool Shed instance. .INDENT 7.0 .TP .B Return type list .TP .B Returns A list of dictionaries containing information about repository categories present in the Tool Shed. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqdeleted\(aq: False, u\(aqdescription\(aq: u\(aqTools for manipulating data\(aq, u\(aqid\(aq: u\(aq175812cd7caaf439\(aq, u\(aqmodel_class\(aq: u\(aqCategory\(aq, u\(aqname\(aq: u\(aqText Manipulation\(aq, u\(aqurl\(aq: u\(aq/api/categories/175812cd7caaf439\(aq},] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp New in version 0.5.2. .UNINDENT .INDENT 7.0 .TP .B get_ordered_installable_revisions(name, owner) Returns the ordered list of changeset revision hash strings that are associated with installable revisions. As in the changelog, the list is ordered oldest to newest. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- the name of the repository .IP \(bu 2 \fBowner\fP (\fIstr\fP) \-\- the owner of the repository .UNINDENT .TP .B Return type list .TP .B Returns List of changeset revision hash string from oldest to newest .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_repositories() Get a list of all the repositories in a Galaxy Tool Shed .INDENT 7.0 .TP .B Return type list .TP .B Returns Returns a list of dictionaries containing information about repositories present in the Tool Shed. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqtimes_downloaded\(aq: 0, u\(aquser_id\(aq: u\(aq5cefd48bc04af6d4\(aq, u\(aqdescription\(aq: u\(aqOrder Contigs\(aq, u\(aqdeleted\(aq: False, u\(aqdeprecated\(aq: False, u\(aqprivate\(aq: False, u\(aqurl\(aq: u\(aq/api/repositories/287bd69f724b99ce\(aq, u\(aqowner\(aq: u\(aqbillybob\(aq, u\(aqid\(aq: u\(aq287bd69f724b99ce\(aq, u\(aqname\(aq: u\(aqbest_tool_ever\(aq}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp Changed in version 0.4.1: Changed method name from \fBget_tools\fP to \fBget_repositories\fP to better align with the Tool Shed concepts .UNINDENT .INDENT 7.0 .TP .B get_repository_revision_install_info(name, owner, changeset_revision) Return a list of dictionaries of metadata about a certain changeset revision for a single tool. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fIstr\fP) \-\- the name of the repository .IP \(bu 2 \fBowner\fP (\fIstr\fP) \-\- the owner of the repository .IP \(bu 2 \fBchangeset_revision\fP (\fIstr\fP) \-\- the changset_revision of the RepositoryMetadata object associated with the repository .UNINDENT .TP .B Return type List of dictionaries .TP .B Returns .INDENT 7.0 .TP .B Returns a list of the following dictionaries: .INDENT 7.0 .IP \(bu 2 a dictionary defining the repository .IP \(bu 2 a dictionary defining the repository revision (RepositoryMetadata) .IP \(bu 2 a dictionary including the additional information required to install the repository .UNINDENT .UNINDENT .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqtimes_downloaded\(aq: 269, u\(aquser_id\(aq: u\(aq1de29d50c3c44272\(aq, u\(aqdescription\(aq: u\(aqGalaxy Freebayes Bayesian genetic variant detector tool\(aq, u\(aqdeleted\(aq: False, u\(aqdeprecated\(aq: False, u\(aqprivate\(aq: False, u\(aqlong_description\(aq: u\(aqGalaxy Freebayes Bayesian genetic variant detector tool originally included in the Galaxy code distribution but migrated to the tool shed.\(aq, u\(aqurl\(aq: u\(aq/api/repositories/491b7a3fddf9366f\(aq, u\(aqowner\(aq: u\(aqdevteam\(aq, u\(aqid\(aq: u\(aq491b7a3fddf9366f\(aq, u\(aqname\(aq: u\(aqfreebayes\(aq}, {u\(aqrepository_id\(aq: u\(aq491b7a3fddf9366f\(aq, u\(aqhas_repository_dependencies\(aq: False, u\(aqincludes_tools_for_display_in_tool_panel\(aq: True, u\(aqurl\(aq: u\(aq/api/repository_revisions/504be8aaa652c154\(aq, u\(aqmalicious\(aq: False, u\(aqincludes_workflows\(aq: False, u\(aqdownloadable\(aq: True, u\(aqincludes_tools\(aq: True, u\(aqchangeset_revision\(aq: u\(aqd291dc763c4c\(aq, u\(aqid\(aq: u\(aq504be8aaa652c154\(aq, u\(aqincludes_tool_dependencies\(aq: True, u\(aqincludes_datatypes\(aq: False}, {u\(aqfreebayes\(aq: [u\(aqGalaxy Freebayes Bayesian genetic variant detector tool\(aq, u\(aqhttp://takadonet@toolshed.g2.bx.psu.edu/repos/devteam/freebayes\(aq, u\(aqd291dc763c4c\(aq, u\(aq9\(aq, u\(aqdevteam\(aq, {}, {u\(aqfreebayes/0.9.6_9608597d12e127c847ae03aa03440ab63992fedf\(aq: {u\(aqrepository_name\(aq: u\(aqfreebayes\(aq, u\(aqname\(aq: u\(aqfreebayes\(aq, u\(aqreadme\(aq: u\(aqFreeBayes requires g++ and the standard C and C++ development libraries. Additionally, cmake is required for building the BamTools API.\(aq, u\(aqversion\(aq: u\(aq0.9.6_9608597d12e127c847ae03aa03440ab63992fedf\(aq, u\(aqrepository_owner\(aq: u\(aqdevteam\(aq, u\(aqchangeset_revision\(aq: u\(aqd291dc763c4c\(aq, u\(aqtype\(aq: u\(aqpackage\(aq}, u\(aqsamtools/0.1.18\(aq: {u\(aqrepository_name\(aq: u\(aqfreebayes\(aq, u\(aqname\(aq: u\(aqsamtools\(aq, u\(aqreadme\(aq: u\(aqCompiling SAMtools requires the ncurses and zlib development libraries.\(aq, u\(aqversion\(aq: u\(aq0.1.18\(aq, u\(aqrepository_owner\(aq: u\(aqdevteam\(aq, u\(aqchangeset_revision\(aq: u\(aqd291dc763c4c\(aq, u\(aqtype\(aq: u\(aqpackage\(aq}}]}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B repository_revisions(downloadable=None, malicious=None, tools_functionally_correct=None, missing_test_components=None, do_not_test=None, includes_tools=None, test_install_error=None, skip_tool_test=None) Returns a (possibly filtered) list of dictionaries that include information about all repository revisions. The following parameters can be used to filter the list. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdownloadable\fP (\fIBoolean\fP) \-\- Can the tool be downloaded .IP \(bu 2 \fBmalicious\fP (\fIBoolean\fP) \-\- .IP \(bu 2 \fBtools_functionally_correct\fP (\fIBoolean\fP) \-\- .IP \(bu 2 \fBmissing_test_components\fP (\fIBoolean\fP) \-\- .IP \(bu 2 \fBdo_not_test\fP (\fIBoolean\fP) \-\- .IP \(bu 2 \fBincludes_tools\fP (\fIBoolean\fP) \-\- .IP \(bu 2 \fBtest_install_error\fP (\fIBoolean\fP) \-\- .IP \(bu 2 \fBskip_tool_test\fP (\fIBoolean\fP) \-\- .UNINDENT .TP .B Return type List of dictionaries .TP .B Returns Returns a (possibly filtered) list of dictionaries that include information about all repository revisions. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C [{u\(aqrepository_id\(aq: u\(aq78f2604ff5e65707\(aq, u\(aqhas_repository_dependencies\(aq: False, u\(aqincludes_tools_for_display_in_tool_panel\(aq: True, u\(aqurl\(aq: u\(aq/api/repository_revisions/92250afff777a169\(aq, u\(aqmalicious\(aq: False, u\(aqincludes_workflows\(aq: False, u\(aqdownloadable\(aq: True, u\(aqincludes_tools\(aq: True, u\(aqchangeset_revision\(aq: u\(aq6e26c5a48e9a\(aq, u\(aqid\(aq: u\(aq92250afff777a169\(aq, u\(aqincludes_tool_dependencies\(aq: False, u\(aqincludes_datatypes\(aq: False}, {u\(aqrepository_id\(aq: u\(aqf9662009da7bfce0\(aq, u\(aqhas_repository_dependencies\(aq: False, u\(aqincludes_tools_for_display_in_tool_panel\(aq: True, u\(aqurl\(aq: u\(aq/api/repository_revisions/d3823c748ae2205d\(aq, u\(aqmalicious\(aq: False, u\(aqincludes_workflows\(aq: False, u\(aqdownloadable\(aq: True, u\(aqincludes_tools\(aq: True, u\(aqchangeset_revision\(aq: u\(aq15a54fa11ad7\(aq, u\(aqid\(aq: u\(aqd3823c748ae2205d\(aq, u\(aqincludes_tool_dependencies\(aq: False, u\(aqincludes_datatypes\(aq: False}] .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B search_repositories(q, page=1, page_size=10) Search for repositories in a Galaxy Tool Shed .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBq\fP (\fIstr\fP) \-\- query string for searching purposes .IP \(bu 2 \fBpage\fP (\fIint\fP) \-\- page requested .IP \(bu 2 \fBpage_size\fP (\fIint\fP) \-\- page size requested .UNINDENT .TP .B Return type dict .TP .B Returns dictionary containing search hits as well as metadata for the search example: { u\(aqhits\(aq: [ .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B { u\(aqmatched_terms\(aq: [], u\(aqrepository\(aq: .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .TP .B { u\(aqapproved\(aq: u\(aqno\(aq, u\(aqdescription\(aq: u\(aqConvert export file to fastq\(aq, u\(aqfull_last_updated\(aq: u\(aq2015\-01\-18 09:48 AM\(aq, u\(aqhomepage_url\(aq: None, u\(aqid\(aq: u\(aqbdfa208f0cf6504e\(aq, u\(aqlast_updated\(aq: u\(aqless than a year\(aq, u\(aqlong_description\(aq: u\(aqThis is a simple too to convert Solexas Export files to FASTQ files. The tool installation needs to add a new Export file type, the new class is included in the README file as a patch.\(aq, u\(aqname\(aq: u\(aqexport_to_fastq\(aq, u\(aqremote_repository_url\(aq: None, u\(aqrepo_owner_username\(aq: u\(aqlouise\(aq, u\(aqtimes_downloaded\(aq: 164 .UNINDENT .sp }, .UNINDENT .UNINDENT .sp u\(aqscore\(aq: 4.92 .UNINDENT .sp }, .UNINDENT .UNINDENT .INDENT 0.0 .TP .B { .INDENT 7.0 .INDENT 3.5 u\(aqmatched_terms\(aq: [], u\(aqrepository\(aq: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B { u\(aqapproved\(aq: u\(aqno\(aq, u\(aqdescription\(aq: u\(aqConvert BAM file to fastq\(aq, u\(aqfull_last_updated\(aq: u\(aq2015\-04\-07 11:57 AM\(aq, u\(aqhomepage_url\(aq: None, u\(aqid\(aq: u\(aq175812cd7caaf439\(aq, u\(aqlast_updated\(aq: u\(aqless than a month\(aq, u\(aqlong_description\(aq: u\(aqUse Picards SamToFastq to convert a BAM file to fastq. Useful for storing reads as BAM in Galaxy and converting to fastq when needed for analysis.\(aq, u\(aqname\(aq: u\(aqbam_to_fastq\(aq, u\(aqremote_repository_url\(aq: None, u\(aqrepo_owner_username\(aq: u\(aqbrad\-chapman\(aq, u\(aqtimes_downloaded\(aq: 138 .UNINDENT .sp }, .UNINDENT .UNINDENT .sp u\(aqscore\(aq: 4.14 .UNINDENT .UNINDENT .sp } .UNINDENT .UNINDENT .UNINDENT .sp ], u\(aqhostname\(aq: u\(aq\fI\%https://testtoolshed.g2.bx.psu.edu/\fP\(aq, u\(aqpage\(aq: u\(aq1\(aq, u\(aqpage_size\(aq: u\(aq2\(aq, u\(aqtotal_results\(aq: u\(aq64\(aq } .UNINDENT .UNINDENT .INDENT 7.0 .TP .B show_repository(toolShed_id) Display information of a repository from Tool Shed .INDENT 7.0 .TP .B Parameters \fBtoolShed_id\fP (\fIstr\fP) \-\- Encoded toolShed ID .TP .B Return type dictionary .TP .B Returns Information about the tool For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {{u\(aqtimes_downloaded\(aq: 0, u\(aquser_id\(aq: u\(aq5cefd48bc04af6d4\(aq, u\(aqdescription\(aq: u\(aqOrder Contigs\(aq, u\(aqdeleted\(aq: False, u\(aqdeprecated\(aq: False, u\(aqprivate\(aq: False, u\(aqurl\(aq: u\(aq/api/repositories/287bd69f724b99ce\(aq, u\(aqowner\(aq: u\(aqbillybob\(aq, u\(aqid\(aq: u\(aq287bd69f724b99ce\(aq, u\(aqname\(aq: u\(aqbest_tool_ever\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp Changed in version 0.4.1: Changed method name from \fBshow_tool\fP to \fBshow_repository\fP to better align with the Tool Shed concepts .UNINDENT .INDENT 7.0 .TP .B show_repository_revision(metadata_id) Returns a dictionary that includes information about a specified repository revision. .INDENT 7.0 .TP .B Parameters \fBmetadata_id\fP (\fIstr\fP) \-\- Encoded repository metadata ID .TP .B Return type dictionary .TP .B Returns Returns a dictionary that includes information about a specified repository revision. For example: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {u\(aqrepository_id\(aq: u\(aq491b7a3fddf9366f\(aq, u\(aqhas_repository_dependencies\(aq: False, u\(aqincludes_tools_for_display_in_tool_panel\(aq: True, u\(aqtest_install_error\(aq: False, u\(aqurl\(aq: u\(aq/api/repository_revisions/504be8aaa652c154\(aq, u\(aqmalicious\(aq: False, u\(aqincludes_workflows\(aq: False, u\(aqid\(aq: u\(aq504be8aaa652c154\(aq, u\(aqdo_not_test\(aq: False, u\(aqdownloadable\(aq: True, u\(aqincludes_tools\(aq: True, u\(aqtool_test_results\(aq: {u\(aqmissing_test_components\(aq: [],, u\(aqincludes_datatypes\(aq: False} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B update_repository(id, tar_ball_path, commit_message=None) Update the contents of a tool shed repository with specified tar ball. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBid\fP (\fIstr\fP) \-\- Encoded repository ID .IP \(bu 2 \fBtar_ball_path\fP (\fIstr\fP) \-\- Path to file containing tar ball to upload. .IP \(bu 2 \fBcommit_message\fP (\fIstr\fP) \-\- Commit message used for underlying mercurial repository backing tool shed repository. .UNINDENT .TP .B Return type dict .TP .B Returns Returns a dictionary that includes repository content warnings. Most valid uploads will result in no such warning and an exception will be raised generally if there are problems. .sp For example a successful upload will look like: .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C {u\(aqcontent_alert\(aq: u\(aq\(aq, u\(aqmessage\(aq: u\(aq\(aq} .ft P .fi .UNINDENT .UNINDENT .UNINDENT .sp New in version 0.5.2. .UNINDENT .UNINDENT .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 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) .UNINDENT .UNINDENT .INDENT 0.0 .TP .B bioblend.get_version() Returns a string with the current version of the library (e.g., "0.2.0") .UNINDENT .INDENT 0.0 .TP .B bioblend.init_logging() Initialize BioBlend\(aqs logging from a configuration file. .UNINDENT .INDENT 0.0 .TP .B bioblend.set_file_logger(name, filepath, level=20, format_string=None) .UNINDENT .INDENT 0.0 .TP .B bioblend.set_stream_logger(name, level=10, format_string=None) .UNINDENT .SS Config .INDENT 0.0 .TP .B class bioblend.config.Config(path=None, fp=None, do_load=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 .INDENT 7.0 .TP .B get(section, name, default=None) .UNINDENT .INDENT 7.0 .TP .B get_value(section, name, default=None) .UNINDENT .INDENT 7.0 .TP .B getbool(section, name, default=False) .UNINDENT .INDENT 7.0 .TP .B getfloat(section, name, default=0.0) .UNINDENT .INDENT 7.0 .TP .B getint(section, name, default=0) .UNINDENT .UNINDENT .SH TESTING .sp If you\(aqd like to do more than just a mock test, you\(aqll want to point BioBlend to an instance of Galaxy. Do so by exporting the following two variables: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ export BIOBLEND_GALAXY_URL=http://127.0.0.1:8080 $ export BIOBLEND_GALAXY_API_KEY= .ft P .fi .UNINDENT .UNINDENT .sp The unit tests, stored in the \fBtests\fP folder, can be run using \fI\%nose\fP\&. From the project root: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ nosetests .ft P .fi .UNINDENT .UNINDENT .SH GETTING HELP .sp If you\(aqve 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 \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 genindex .IP \(bu 2 modindex .IP \(bu 2 search .UNINDENT .SH AUTHOR Enis Afgan .SH COPYRIGHT 2012-2016, Enis Afgan .\" Generated by docutils manpage writer. .