### Run Toy Example Workflow Source: https://github.com/galaxyproject/bioblend/blob/main/docs/examples/objects/README.txt This script runs a 'toy' example workflow that is designed to complete faster than the microbiology examples. It waits for the job to finish and downloads the results to a local file. Ensure your API key is configured. ```python export GALAXY_API_KEY=000this_should_be_your_api_key00 python small.py ``` -------------------------------- ### Install BioBlend with Testing Dependencies Source: https://github.com/galaxyproject/bioblend/blob/main/docs/index.md Install BioBlend along with extra libraries required for running local tests. ```bash python3 -m pip install bioblend[testing] ``` -------------------------------- ### Install BioBlend via pip Source: https://github.com/galaxyproject/bioblend/blob/main/docs/index.md Install the stable release of BioBlend using pip. This is the recommended method for most users. ```bash python3 -m pip install bioblend ``` -------------------------------- ### Install BioBlend from Source Source: https://github.com/galaxyproject/bioblend/blob/main/docs/index.md Install the most current source code directly from the BioBlend Git repository using pip. ```bash python3 -m pip install git+https://github.com/galaxyproject/bioblend ``` -------------------------------- ### Get List of Users Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of all users in the Galaxy instance. This method requires administrator privileges. ```python >>> gi.users.get_users() [{'email': 'userA@example.org', 'id': '975a9ce09b49502a', 'quota_percent': None, 'url': '/api/users/975a9ce09b49502a'}, {'email': 'userB@example.org', 'id': '0193a95acf427d2c', 'quota_percent': None, 'url': '/api/users/0193a95acf427d2c'}] ``` -------------------------------- ### Get Data Libraries Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of all Data Libraries available to the authenticated user. ```APIDOC ## View Data Libraries ### Description Retrieves a list of metadata dictionaries for all Data Libraries available to the current account. ### Method Signature `gi.libraries.get_libraries()` ### Parameters This method does not take any parameters. ### Response Example ```json [ { "id": "8e6f930d00d123ea", "name": "RNA-seq workshop data", "url": "/api/libraries/8e6f930d00d123ea" }, { "id": "f740ab636b360a70", "name": "1000 genomes", "url": "/api/libraries/f740ab636b360a70" } ] ``` ``` -------------------------------- ### Get All Workflows Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of metadata dictionaries for all workflows in your Galaxy account. Each dictionary contains the workflow's ID, name, and API URL. ```default >>> gi.workflows.get_workflows() [{'id': 'e8b85ad72aefca86', 'name': 'TopHat + cufflinks part 1', 'url': '/api/workflows/e8b85ad72aefca86'}, {'id': 'b0631c44aa74526d', 'name': 'CuffDiff', 'url': '/api/workflows/b0631c44aa74526d'}] ``` -------------------------------- ### Get List of Galaxy Data Libraries Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of all available Data Libraries accessible by the current user. Each item in the list contains basic metadata. ```python >>> gi.libraries.get_libraries() [{'id': '8e6f930d00d123ea', 'name': 'RNA-seq workshop data', 'url': '/api/libraries/8e6f930d00d123ea'}, {'id': 'f740ab636b360a70', 'name': '1000 genomes', 'url': '/api/libraries/f740ab636b360a70'}] ``` -------------------------------- ### Make POST Request to Galaxy API Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Use `make_post_request` to send data to the Galaxy API, for example, to create a new history. The API key is automatically included. The response contains details of the created resource. ```python >>> gi.make_post_request(gi.base_url + "/api/histories", payload={"name": "test history"}) {'importable': False, 'create_time': '2019-07-05T20:10:04.823716', 'contents_url': '/api/histories/a77b3f95070d689a/contents', 'id': 'a77b3f95070d689a', 'size': 0, 'user_id': '5b732999121d4593', 'username_and_slug': None, 'annotation': None, 'state_details': {'discarded': 0, 'ok': 0, 'failed_metadata': 0, 'upload': 0, 'paused': 0, 'running': 0, 'setting_metadata': 0, 'error': 0, 'new': 0, 'queued': 0, 'empty': 0}, 'state': 'new', 'empty': True, 'update_time': '2019-07-05T20:10:04.823742', 'tags': [], 'deleted': False, 'genome_build': None, 'slug': None, 'name': 'test history', 'url': '/api/histories/a77b3f95070d689a', 'state_ids': {'discarded': [], 'ok': [], 'failed_metadata': [], 'upload': [], 'paused': [], 'running': [], 'setting_metadata': [], 'error': [], 'new': [], 'queued': [], 'empty': []}, 'published': False, 'model_class': 'History', 'purged': False} ``` -------------------------------- ### Make GET Request to Galaxy API Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Use `make_get_request` to retrieve data from the Galaxy API. The API key is automatically included. The response is returned as a JSON object. ```python >>> gi.make_get_request(gi.base_url + "/api/version").json() {'version_major': '19.05', 'extra': {}} ``` -------------------------------- ### Get Workflows Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of all workflows currently available in the user's account, including their IDs, names, and URLs. ```APIDOC ## Get Workflows ### Description Retrieves a list of all workflows currently available in the user's account, including their IDs, names, and URLs. ### Method ```python gi.workflows.get_workflows() ``` ### Response #### Success Response (200) - **workflows** (list) - A list of dictionaries, where each dictionary contains: - **id** (string) - The unique identifier for the workflow. - **name** (string) - The name of the workflow. - **url** (string) - The API endpoint URL for the workflow. ``` -------------------------------- ### Connect to Galaxy Instance Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Establishes a connection to a Galaxy server using the provided URL and API key. Requires an account on the Galaxy instance and a valid API key. ```python from bioblend.galaxy import GalaxyInstance gi = GalaxyInstance(url='http://example.galaxy.url', key='your-API-key') ``` -------------------------------- ### Set Galaxy Instance URL and API Key for Testing Source: https://github.com/galaxyproject/bioblend/blob/main/docs/index.md Export these environment variables to point BioBlend to a Galaxy instance for testing. Ensure you replace the placeholder with your actual API key. ```default $ export BIOBLEND_GALAXY_URL=http://127.0.0.1:8080 $ export BIOBLEND_GALAXY_API_KEY= ``` -------------------------------- ### Interact with Galaxy via Straightforward API Source: https://github.com/galaxyproject/bioblend/blob/main/ABOUT.rst Use this snippet to interact with Galaxy using a straightforward API. It requires initializing a GalaxyInstance with the Galaxy IP and an API key. ```python from bioblend.galaxy import GalaxyInstance gi = GalaxyInstance('', key='your API key') libs = gi.libraries.get_libraries() gi.workflows.show_workflow('workflow ID') wf_invocation = gi.workflows.invoke_workflow('workflow ID', inputs) ``` -------------------------------- ### Run BioBlend Tests and Save Output Source: https://github.com/galaxyproject/bioblend/blob/main/CONTRIBUTING.md Run BioBlend tests and simultaneously view the output in the terminal and save it to a log file. ```bash ./run_bioblend_tests.sh -g GALAXY_PATH [-r GALAXY_REV] [-e TOX_ENV] 2>&1 | tee log.txt ``` -------------------------------- ### Run Unit Tests with Pytest Source: https://github.com/galaxyproject/bioblend/blob/main/docs/index.md Execute the unit tests for BioBlend using pytest from the project's root directory. ```default $ pytest ``` -------------------------------- ### Run BioBlend Tests with Galaxy Path Source: https://github.com/galaxyproject/bioblend/blob/main/CONTRIBUTING.md Execute BioBlend tests by specifying the path to a cloned Galaxy repository. Optionally, specify a Galaxy revision and a Tox environment for testing against different Python versions. ```bash ./run_bioblend_tests.sh -g GALAXY_PATH [-r GALAXY_REV] [-e TOX_ENV] ``` -------------------------------- ### Interact with Galaxy via Object-Oriented API Source: https://github.com/galaxyproject/bioblend/blob/main/ABOUT.rst This snippet demonstrates interacting with Galaxy using an object-oriented API. It allows for more direct manipulation of Galaxy objects like workflows and histories. ```python 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_invocation = wf.invoke(input_map, params=params) ``` -------------------------------- ### Run Bacterial De Novo Assembly Workflow Source: https://github.com/galaxyproject/bioblend/blob/main/docs/examples/objects/README.txt This script demonstrates how to run a bacterial de novo assembly workflow on the Orione Galaxy server. Ensure your API key is set via environment variable or by replacing YOUR_API_KEY in the script. The script runs the workflow asynchronously and outputs the history name and ID. ```python export GALAXY_API_KEY=000this_should_be_your_api_key00 python w3_bacterial_denovo.py ``` -------------------------------- ### Run Metagenomics Workflow Source: https://github.com/galaxyproject/bioblend/blob/main/docs/examples/objects/README.txt This script demonstrates how to run a metagenomics workflow on the Orione Galaxy server. Configure your API key by replacing YOUR_API_KEY or setting the GALAXY_API_KEY environment variable. The script runs the workflow asynchronously and outputs the history name and ID. ```python export GALAXY_API_KEY=000this_should_be_your_api_key00 python w5_metagenomics.py ``` -------------------------------- ### View Workflows After Import Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves and displays the list of workflows after an import operation, showing the newly added workflow alongside existing ones. ```pycon >>> gi.workflows.get_workflows() [{'id': 'c0bacafdfe211f9a', 'name': 'TopHat + cufflinks part 1 (imported from API)', 'url': '/api/workflows/c0bacafdfe211f9a'}, {'id': 'e8b85ad72aefca86', 'name': 'TopHat + cufflinks part 1', 'url': '/api/workflows/e8b85ad72aefca86'}, {'id': 'b0631c44aa74526d', 'name': 'CuffDiff', 'url': '/api/workflows/b0631c44aa74526d'}] ``` -------------------------------- ### Import Workflow from Dictionary Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Imports a workflow into Galaxy from a Python dictionary representation. This creates a new workflow, potentially a duplicate if imported into the same instance. ```default >>> gi.workflows.import_workflow_dict(workflow_dict) {'id': 'c0bacafdfe211f9a', 'name': 'TopHat + cufflinks part 1 (imported from API)', 'url': '/api/workflows/c0bacafdfe211f9a'} ``` -------------------------------- ### Show Workflow Details Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves detailed information about a specific workflow, including its inputs, name, steps, and URL, by providing its ID. ```APIDOC ## Show Workflow Details ### Description Retrieves detailed information about a specific workflow, including its inputs, name, steps, and URL, by providing its ID. ### Method ```python gi.workflows.show_workflow(workflow_id) ``` ### Parameters #### Path Parameters - **workflow_id** (string) - Required - The ID of the workflow to display. ### Response #### Success Response (200) - **workflow_details** (dict) - A dictionary containing detailed information about the workflow, including: - **id** (string) - The unique identifier for the workflow. - **name** (string) - The name of the workflow. - **inputs** (dict) - Information about the workflow's inputs. - **steps** (dict) - Information about the workflow's steps. - **url** (string) - The API endpoint URL for the workflow. ``` -------------------------------- ### Show Specific Workflow Details Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Fetches detailed information about a specific workflow, including its inputs, name, steps, and API URL, by providing its unique ID. ```default >>> gi.workflows.show_workflow('e8b85ad72aefca86') {'id': 'e8b85ad72aefca86', 'inputs': {'252': {'label': 'Input RNA-seq fastq', 'value': ''}}, 'name': 'TopHat + cufflinks part 1', 'steps': {'250': {'id': 250, 'input_steps': {'input1': {'source_step': 252, 'step_output': 'output'}}, 'tool_id': 'tophat', 'type': 'tool'}, '251': {'id': 251, 'input_steps': {'input': {'source_step': 250, 'step_output': 'accepted_hits'}}, 'tool_id': 'cufflinks', 'type': 'tool'}, '252': {'id': 252, 'input_steps': {}, 'tool_id': None, 'type': 'data_input'}}, 'url': '/api/workflows/e8b85ad72aefca86'} ``` -------------------------------- ### Run Bacterial Re-sequencing Workflow Source: https://github.com/galaxyproject/bioblend/blob/main/docs/examples/objects/README.txt This script demonstrates how to run a bacterial re-sequencing workflow on the Orione Galaxy server. Replace YOUR_API_KEY with your actual API key or set the GALAXY_API_KEY environment variable. The script runs the workflow asynchronously and outputs the history name and ID. ```python export GALAXY_API_KEY=000this_should_be_your_api_key00 python w2_bacterial_reseq.py ``` -------------------------------- ### Show Details of a Specific Galaxy Data Library Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Fetches detailed information for a specific Data Library using its ID. This includes its name, description, and content URL. ```python >>> gi.libraries.show_library('8e6f930d00d123ea') {'contents_url': '/api/libraries/8e6f930d00d123ea/contents', 'description': 'RNA-Seq workshop data', 'name': 'RNA-Seq', 'synopsis': 'Data for the RNA-Seq tutorial'} ``` -------------------------------- ### Show Dataset Details Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves detailed information about a specific dataset in Galaxy using its ID. The returned dictionary includes metadata such as data type, file size, and state. ```python >>> gi.datasets.show_dataset('10a4b652da44e82a') {'data_type': 'fastqsanger', 'deleted': False, 'file_size': 16527060, 'genome_build': 'dm3', 'id': 17499, 'metadata_data_lines': None, 'metadata_dbkey': 'dm3', 'metadata_sequences': None, 'misc_blurb': '15.8 MB', 'misc_info': 'Noneuploaded fastqsanger file', 'model_class': 'HistoryDatasetAssociation', 'name': 'C1_R2_1.chr4.fq', 'purged': False, 'state': 'ok', 'visible': True} ``` -------------------------------- ### Upload File from FTP to History Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Imports a file from the user's FTP folder into a specified Galaxy history. This is recommended for files larger than 2GB. ```APIDOC ## Upload File from FTP to History ### Description Imports a file from the user's FTP folder into a specified Galaxy history. This method is suitable for large files (greater than 2GB). ### Method Signature `gi.tools.upload_from_ftp(ftp_filepath, history_id)` ### Parameters #### Path Parameters - `ftp_filepath` (string) - Required - The path to the file in the user's FTP folder. - `history_id` (string) - Required - The ID of the Galaxy history to upload the file to. ### Response Example ```json { "implicit_collections": [], "jobs": [ { "create_time": "2015-07-28T17:57:43.704394", "exit_code": null, "id": "82b264d8c3d11790", "model_class": "Job", "state": "new", "tool_id": "upload1", "update_time": "2015-07-28T17:57:43.910958" } ], "output_collections": [], "outputs": [ { "create_time": "2015-07-28T17:57:43.209041", "data_type": "galaxy.datatypes.data.Text", "deleted": false, "file_ext": "auto", "file_size": 0, "genome_build": "?", "hda_ldda": "hda", "hid": 17, "history_content_type": "dataset", "history_id": "f3c2b0f3ecac9f02", "id": "a676e8f07209a3be", "metadata_data_lines": null, "metadata_dbkey": "?", "misc_blurb": null, "misc_info": null, "model_class": "HistoryDatasetAssociation", "name": "test.txt", "output_name": "output0", "peek": "
", "purged": false, "state": "queued", "tags": [], "update_time": "2015-07-28T17:57:43.544407", "uuid": "2cbe8f0a-4019-47c4-87e2-005ce35b8449", "visible": true } ] } ``` ``` -------------------------------- ### Show Workflow Inputs Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves the input schema for a given workflow ID to understand its expected inputs. ```python >>> wf = gi.workflows.show_workflow('e8b85ad72aefca86') >>> wf['inputs'] {'252': {'label': 'Input RNA-seq fastq', 'value': ''}} ``` -------------------------------- ### Upload Local File to Galaxy History Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Use this method to upload a local file to a specified Galaxy history. Ensure the file path is correct. ```python >>> gi.tools.upload_file('test.txt', 'f3c2b0f3ecac9f02') {'implicit_collections': [], 'jobs': [{'create_time': '2015-07-28T17:52:39.756488', 'exit_code': None, 'id': '9752b387803d3e1e', 'model_class': 'Job', 'state': 'new', 'tool_id': 'upload1', 'update_time': '2015-07-28T17:52:39.987509'}], 'output_collections': [], 'outputs': [{'create_time': '2015-07-28T17:52:39.331176', 'data_type': 'galaxy.datatypes.data.Text', 'deleted': False, 'file_ext': 'auto', 'file_size': 0, 'genome_build': '?', 'hda_ldda': 'hda', 'hid': 16, 'history_content_type': 'dataset', 'history_id': 'f3c2b0f3ecac9f02', 'id': '59c76a119581e190', 'metadata_data_lines': None, 'metadata_dbkey': '?', 'misc_blurb': None, 'misc_info': None, 'model_class': 'HistoryDatasetAssociation', 'name': 'test.txt', 'output_name': 'output0', 'peek': '
', 'purged': False, 'state': 'queued', 'tags': [], 'update_time': '2015-07-28T17:52:39.611887', 'uuid': 'ff0ee99b-7542-4125-802d-7a193f388e7e', 'visible': True}]} ``` -------------------------------- ### Upload File to Data Library Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Uploads a file from your local machine to a specified Data Library. You can optionally specify the file type; otherwise, Galaxy attempts to auto-detect it. ```python >>> gi.libraries.upload_file_from_local_path('8e6f930d00d123ea', '/local/path/to/mydata.fastq', file_type='fastqsanger') ``` -------------------------------- ### Import Workflow Dictionary Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Imports a workflow into Galaxy from a Python dictionary representation. This creates a new workflow based on the provided definition. ```APIDOC ## Import Workflow Dictionary ### Description Imports a workflow into Galaxy from a Python dictionary representation. This creates a new workflow based on the provided definition. ### Method ```python gi.workflows.import_workflow_dict(workflow_dict) ``` ### Parameters #### Request Body - **workflow_dict** (dict) - Required - A dictionary representing the workflow definition to import. ### Response #### Success Response (200) - **imported_workflow_info** (dict) - A dictionary containing basic metadata of the newly imported workflow, including its ID, name, and URL. ``` -------------------------------- ### Show History State After Workflow Invocation Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Displays the state of a history immediately after invoking a workflow, showing datasets in a 'queued' state. ```default >>> gi.histories.show_history('0a7b7992a7cabaec') {'annotation': '', 'contents_url': '/api/histories/0a7b7992a7cabaec/contents', 'id': '0a7b7992a7cabaec', 'name': 'New output history', 'nice_size': '0 bytes', 'state': 'queued', 'state_details': {'discarded': 0, 'empty': 0, 'error': 0, 'failed_metadata': 0, 'new': 0, 'ok': 0, 'paused': 0, 'queued': 8, 'running': 0, 'setting_metadata': 0, 'upload': 0}, 'state_ids': {'discarded': [], 'empty': [], 'error': [], 'failed_metadata': [], 'new': [], 'ok': [], 'paused': [], 'queued': ['33be8ad9917d9207', 'fbee1c2dc793c114', '85866441984f9e28', '1c51aa78d3742386', 'a68e8770e52d03b4', 'c54baf809e3036ac', 'ba0db8ce6cd1fe8f', 'c019e4cf08b2ac94'], 'running': [], 'setting_metadata': [], 'upload': []}} ``` -------------------------------- ### Upload File to History Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Uploads a local file to a specified Galaxy history. For files larger than 2GB, FTP upload is recommended. ```APIDOC ## Upload File to History ### Description Uploads a local file to a specified Galaxy history. ### Method Signature `gi.tools.upload_file(local_filepath, history_id)` ### Parameters #### Path Parameters - `local_filepath` (string) - Required - The path to the local file to upload. - `history_id` (string) - Required - The ID of the Galaxy history to upload the file to. ### Response Example ```json { "implicit_collections": [], "jobs": [ { "create_time": "2015-07-28T17:52:39.756488", "exit_code": null, "id": "9752b387803d3e1e", "model_class": "Job", "state": "new", "tool_id": "upload1", "update_time": "2015-07-28T17:52:39.987509" } ], "output_collections": [], "outputs": [ { "create_time": "2015-07-28T17:52:39.331176", "data_type": "galaxy.datatypes.data.Text", "deleted": false, "file_ext": "auto", "file_size": 0, "genome_build": "?", "hda_ldda": "hda", "hid": 16, "history_content_type": "dataset", "history_id": "f3c2b0f3ecac9f02", "id": "59c76a119581e190", "metadata_data_lines": null, "metadata_dbkey": "?", "misc_blurb": null, "misc_info": null, "model_class": "HistoryDatasetAssociation", "name": "test.txt", "output_name": "output0", "peek": "
", "purged": false, "state": "queued", "tags": [], "update_time": "2015-07-28T17:52:39.611887", "uuid": "ff0ee99b-7542-4125-802d-7a193f388e7e", "visible": true } ] } ``` ``` -------------------------------- ### Show History Details Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Fetches detailed metadata for a specific Galaxy history using its ID. Setting 'contents=False' (default) returns only dataset IDs within the history. ```python >>> gi.histories.show_history('f3c2b0f3ecac9f02', contents=False) {'annotation': '', 'contents_url': '/api/histories/f3c2b0f3ecac9f02/contents', 'id': 'f3c2b0f3ecac9f02', 'name': 'RNAseq_DGE_BASIC_Prep', 'nice_size': '93.5 MB', 'state': 'ok', 'state_details': {'discarded': 0, 'empty': 0, 'error': 0, 'failed_metadata': 0, 'new': 0, 'ok': 7, 'paused': 0, 'queued': 0, 'running': 0, 'setting_metadata': 0, 'upload': 0}, 'state_ids': {'discarded': [], 'empty': [], 'error': [], 'failed_metadata': [], 'new': [], 'ok': ['d6842fb08a76e351', '10a4b652da44e82a', '81c601a2549966a0', 'a154f05e3bcee26b', '1352fe19ddce0400', '06d549c52d753e53', '9ec54455d6279cc7'], 'paused': [], 'queued': [], 'running': [], 'setting_metadata': [], 'upload': []}} ``` -------------------------------- ### Invoke Workflow with Datasets Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Invokes a Galaxy workflow using a specified dataset. The dataset source is 'hda' (HistoryDatasetAssociation) and a new history is created for the output. ```default >>> datamap = {'252': {'src':'hda', 'id':'10a4b652da44e82a'}} >>> gi.workflows.invoke_workflow('e8b85ad72aefca86', inputs=datamap, history_name='New output history') {'history': '0a7b7992a7cabaec', 'outputs': ['33be8ad9917d9207', 'fbee1c2dc793c114', '85866441984f9e28', '1c51aa78d3742386', 'a68e8770e52d03b4', 'c54baf809e3036ac', 'ba0db8ce6cd1fe8f', 'c019e4cf08b2ac94']} ``` -------------------------------- ### Show Library Details Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves detailed information about a specific Data Library, identified by its ID. ```APIDOC ## Show Library Details ### Description Retrieves detailed information about a specific Data Library, identified by its ID. ### Method Signature `gi.libraries.show_library(library_id)` ### Parameters #### Path Parameters - `library_id` (string) - Required - The ID of the Data Library to retrieve details for. ### Response Example ```json { "contents_url": "/api/libraries/8e6f930d00d123ea/contents", "description": "RNA-Seq workshop data", "name": "RNA-Seq", "synopsis": "Data for the RNA-Seq tutorial" } ``` ``` -------------------------------- ### Upload File from FTP to Galaxy History Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Use this method for uploading files larger than 2GB via FTP. It requires the file to be present in the user's FTP folder on the Galaxy server. ```python >>> gi.tools.upload_from_ftp('test.txt', 'f3c2b0f3ecac9f02') {'implicit_collections': [], 'jobs': [{'create_time': '2015-07-28T17:57:43.704394', 'exit_code': None, 'id': '82b264d8c3d11790', 'model_class': 'Job', 'state': 'new', 'tool_id': 'upload1', 'update_time': '2015-07-28T17:57:43.910958'}], 'output_collections': [], 'outputs': [{'create_time': '2015-07-28T17:57:43.209041', 'data_type': 'galaxy.datatypes.data.Text', 'deleted': False, 'file_ext': 'auto', 'file_size': 0, 'genome_build': '?', 'hda_ldda': 'hda', 'hid': 17, 'history_content_type': 'dataset', 'history_id': 'f3c2b0f3ecac9f02', 'id': 'a676e8f07209a3be', 'metadata_data_lines': None, 'metadata_dbkey': '?', 'misc_blurb': None, 'misc_info': None, 'model_class': 'HistoryDatasetAssociation', 'name': 'test.txt', 'output_name': 'output0', 'peek': '
', 'purged': False, 'state': 'queued', 'tags': [], 'update_time': '2015-07-28T17:57:43.544407', 'uuid': '2cbe8f0a-4019-47c4-87e2-005ce35b8449', 'visible': True}]} ``` -------------------------------- ### Upload File to Data Library Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Uploads a file from a local path to a specified Galaxy Data Library. The file type can be automatically detected or explicitly set. ```APIDOC ## Upload File to Data Library ### Description Uploads a file from a local path to a specified Galaxy Data Library. The file type can be automatically detected or explicitly set. ### Method ```python gi.libraries.upload_file_from_local_path(library_id, local_path, file_type='auto') ``` ### Parameters #### Path Parameters - **library_id** (string) - Required - The ID of the destination Data Library. - **local_path** (string) - Required - The local path to the file to upload. #### Query Parameters - **file_type** (string) - Optional - The type of file to assign in Galaxy. Defaults to 'auto' for automatic detection. ``` -------------------------------- ### View Users Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of all users in the Galaxy system. This method is only available to Galaxy administrators. ```APIDOC ## View Users ### Description Methods for managing users are grouped under `GalaxyInstance.users.*`. User management is only available to Galaxy administrators, meaning the API key used to connect to Galaxy must belong to an admin account. ### Method `GET` (implied by `get_users` action) ### Endpoint `/api/users` (inferred from context) ### Parameters None explicitly mentioned for this method. ### Request Example ```python gi.users.get_users() ``` ### Response #### Success Response (200) - **email** (string) - The email address of the user. - **id** (string) - The unique identifier of the user. - **quota_percent** (number or null) - The percentage of the user's quota that is currently used, or null if not applicable. - **url** (string) - The API URL to access the specific user resource. #### Response Example ```json [ { "email": "userA@example.org", "id": "975a9ce09b49502a", "quota_percent": null, "url": "/api/users/975a9ce09b49502a" }, { "email": "userB@example.org", "id": "0193a95acf427d2c", "quota_percent": null, "url": "/api/users/0193a95acf427d2c" } ] ``` ``` -------------------------------- ### Export Workflow to Dictionary Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Exports a workflow's definition into a complex Python dictionary. This dictionary can be used for archiving or importing the workflow elsewhere. ```default >>> workflow_dict = gi.workflows.export_workflow_dict('e8b85ad72aefca86') ``` -------------------------------- ### View Histories Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Retrieves a list of histories associated with the connected Galaxy account. Each history in the list is represented by a dictionary containing basic metadata such as its ID and name. ```python >>> gi.histories.get_histories() [{'id': 'f3c2b0f3ecac9f02', 'name': 'RNAseq_DGE_BASIC_Prep', 'url': '/api/histories/f3c2b0f3ecac9f02'}, {'id': '8a91dcf1866a80c2', 'name': 'June demo', 'url': '/api/histories/8a91dcf1866a80c2'}] ``` -------------------------------- ### Export Workflow Dictionary Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Exports a workflow's definition into a Python dictionary format, which can be used for archiving or transferring workflows. ```APIDOC ## Export Workflow Dictionary ### Description Exports a workflow's definition into a Python dictionary format, which can be used for archiving or transferring workflows. ### Method ```python gi.workflows.export_workflow_dict(workflow_id) ``` ### Parameters #### Path Parameters - **workflow_id** (string) - Required - The ID of the workflow to export. ### Response #### Success Response (200) - **workflow_dict** (dict) - A dictionary representing the workflow's definition. ``` -------------------------------- ### Increase BioBlend Test Job Timeout Source: https://github.com/galaxyproject/bioblend/blob/main/CONTRIBUTING.md Temporarily increase the job timeout for BioBlend tests by setting an environment variable. ```bash export BIOBLEND_TEST_JOB_TIMEOUT=100 ``` -------------------------------- ### Invoke a workflow Source: https://github.com/galaxyproject/bioblend/blob/main/docs/api_docs/galaxy/docs.md Invokes a Galaxy workflow with specified datasets and creates a new history for the output. The method returns immediately after submitting jobs to the Galaxy workflow engine. ```APIDOC ## Invoke a workflow ### Description To invoke a workflow, you need to specify which datasets to use for the workflow inputs. Datasets can be sourced from histories or data libraries. The `invoke_workflow` method takes a workflow ID, a data map specifying input-to-dataset mappings, and an optional history name for storing results. ### Method `POST` (implied by `invoke_workflow` action) ### Endpoint `/api/workflows/{workflow_id}/invoke` (inferred from context) ### Parameters #### Path Parameters - **workflow_id** (string) - Required - The unique identifier of the workflow to invoke. #### Query Parameters None explicitly mentioned, but `history_name` is passed as a keyword argument. #### Request Body - **inputs** (dict) - Required - A nested dictionary mapping workflow input IDs to dataset specifications. Each dataset specification should include at least 'src' (e.g., 'hda') and 'id' (the dataset's unique identifier). - **history_name** (string) - Optional - The name for a new history to be created for storing the workflow results. If not provided, results may be stored in the default history. ### Request Example ```python datamap = {'252': {'src':'hda', 'id':'10a4b652da44e82a'}} gi.workflows.invoke_workflow('e8b85ad72aefca86', inputs=datamap, history_name='New output history') ``` ### Response #### Success Response (200) - **history** (string) - The ID of the history where the workflow outputs are stored. - **outputs** (list of strings) - A list of dataset IDs generated by the workflow. #### Response Example ```json { "history": "0a7b7992a7cabaec", "outputs": [ "33be8ad9917d9207", "fbee1c2dc793c114", "85866441984f9e28", "1c51aa78d3742386", "a68e8770e52d03b4", "c54baf809e3036ac", "ba0db8ce6cd1fe8f", "c019e4cf08b2ac94" ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.