| Title: | 'Galaxy' API Implementation |
|---|---|
| Description: | On 'Galaxy' platforms like 'Galaxy Europe' <https://usegalaxy.eu>, many tools and workflows can run directly on a high-performance computer. 'GalaxyR' connects R with 'Galaxy' platforms API <https://usegalaxy.eu/api/docs> and allows credential management, uploading data, invoking workflows or tools, checking their status, and downloading results. |
| Authors: | Julian Frey [aut, cre] (ORCID: <https://orcid.org/0000-0001-7895-702X>), Zoe Schindler [ctb] (ORCID: <https://orcid.org/0000-0003-2972-1920>) |
| Maintainer: | Julian Frey <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.2 |
| Built: | 2026-11-03 10:23:20 UTC |
| Source: | https://github.com/julfrey/galaxyr |
Constructor for a Galaxy S4 object used for pipe‑based
workflows. The returned object carries identifiers such as history_id,
input_dataset_id and invocation_id through subsequent calls.
galaxy(history_name = "R API request", galaxy_url = "https://usegalaxy.eu")galaxy(history_name = "R API request", galaxy_url = "https://usegalaxy.eu")
history_name |
Character. Default name to give to a new history,
stored in the object and used by |
galaxy_url |
Character. Base URL of the Galaxy instance. If the
environment variable |
A Galaxy object in state "new".
Delete a dataset (HDA) from a Galaxy instance using the Galaxy API.
galaxy_delete_dataset( dataset_id, purge = TRUE, verbose = FALSE, galaxy_url = "https://usegalaxy.eu" )galaxy_delete_dataset( dataset_id, purge = TRUE, verbose = FALSE, galaxy_url = "https://usegalaxy.eu" )
dataset_id |
Character. The Galaxy dataset ID to delete. |
purge |
Logical. If |
verbose |
Logical. If |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
This function performs an HTTP DELETE against the Galaxy
/api/datasets/id endpoint. By default it requests a purge
(permanent removal) by adding ?purge=true. The Galaxy API key is
read from the environment variable GALAXY_API_KEY.
Make sure Sys.getenv("GALAXY_API_KEY") is set to a valid API key..
Use caution when running with purge = TRUE as this permanently
removes data.
A named list with elements:
Logical. TRUE for 2xx responses, otherwise FALSE.
Integer. HTTP status code returned by the API.
Character. The raw response body (text).
input_file <- tempfile(fileext = ".txt") test_text <- "This is an example \nfile." writeLines(test_text,input_file) history_id <- galaxy_initialize() dataset_id <- galaxy_upload_https(input_file, history_id) galaxy_delete_dataset(dataset_id)input_file <- tempfile(fileext = ".txt") test_text <- "This is an example \nfile." writeLines(test_text,input_file) history_id <- galaxy_initialize() dataset_id <- galaxy_upload_https(input_file, history_id) galaxy_delete_dataset(dataset_id)
Convenience wrapper that deletes a vector of dataset IDs using
galaxy_delete_dataset. Requests are paced with a small
sleep between calls to avoid overwhelming the server.
galaxy_delete_datasets( output_ids, purge = TRUE, sleep = 0.2, galaxy_url = "https://usegalaxy.eu" )galaxy_delete_datasets( output_ids, purge = TRUE, sleep = 0.2, galaxy_url = "https://usegalaxy.eu" )
output_ids |
Character vector of dataset IDs to delete. |
purge |
Logical. Passed to |
sleep |
Numeric. Seconds to wait between API calls. Default: |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
A named list where each element is the return value from
galaxy_delete_dataset for the corresponding dataset ID.
input_file <- tempfile(fileext = ".txt") input_file2 <- tempfile(fileext = ".txt") test_text <- "This is an example \nfile." writeLines(test_text,input_file) writeLines(test_text,input_file2) history_id <- galaxy_initialize("test upload") dataset_id <- galaxy_upload_https(input_file, history_id) dataset_id2 <- galaxy_upload_https(input_file2, history_id) galaxy_delete_datasets(list(output_ids = c(dataset_id, dataset_id2)))input_file <- tempfile(fileext = ".txt") input_file2 <- tempfile(fileext = ".txt") test_text <- "This is an example \nfile." writeLines(test_text,input_file) writeLines(test_text,input_file2) history_id <- galaxy_initialize("test upload") dataset_id <- galaxy_upload_https(input_file, history_id) dataset_id2 <- galaxy_upload_https(input_file2, history_id) galaxy_delete_datasets(list(output_ids = c(dataset_id, dataset_id2)))
galaxy_delete_history() is an S4 generic. With x as a character scalar,
it is treated as a history ID and the function returns API response metadata.
With x as a Galaxy object, history_id and galaxy_url are taken from
the object and the object state is updated.
galaxy_delete_history( x, purge = FALSE, galaxy_url = "https://usegalaxy.eu", verbose = FALSE ) ## S4 method for signature 'character' galaxy_delete_history( x, purge = FALSE, galaxy_url = "https://usegalaxy.eu", verbose = FALSE ) ## S4 method for signature 'Galaxy' galaxy_delete_history(x, purge = FALSE, verbose = FALSE)galaxy_delete_history( x, purge = FALSE, galaxy_url = "https://usegalaxy.eu", verbose = FALSE ) ## S4 method for signature 'character' galaxy_delete_history( x, purge = FALSE, galaxy_url = "https://usegalaxy.eu", verbose = FALSE ) ## S4 method for signature 'Galaxy' galaxy_delete_history(x, purge = FALSE, verbose = FALSE)
x |
A history ID ( |
purge |
Logical. If |
galaxy_url |
Character. Base URL of the Galaxy instance, used by the
character method. If |
verbose |
Logical. If |
The function calls DELETE /api/histories/{history_id} with optional
purge=TRUE to request permanent removal (server policy permitting).
For the character method: a named list with success, status, content.
For the Galaxy method: the modified Galaxy object (state set to
"success" on 2xx, otherwise "error").
## Not run: # Character method hid <- galaxy_initialize("history to delete") galaxy_delete_history(hid, purge = FALSE) # Galaxy method g <- galaxy(history_name = "history to delete") g <- galaxy_initialize(g) g <- galaxy_delete_history(g, purge = FALSE) ## End(Not run)## Not run: # Character method hid <- galaxy_initialize("history to delete") galaxy_delete_history(hid, purge = FALSE) # Galaxy method g <- galaxy(history_name = "history to delete") g <- galaxy_initialize(g) g <- galaxy_delete_history(g, purge = FALSE) ## End(Not run)
galaxy_download_result() is an S4 generic. With x as a character vector
of HDA output IDs, all corresponding datasets are downloaded into out_dir
using their Galaxy names; duplicate names are disambiguated by appending
_<i> before the extension. Existing files are not overwritten if
overwrite = FALSE, and a warning is issued when a name is adjusted.
With x as a Galaxy object its output_dataset_ids and galaxy_url
are used; the object is returned invisibly after performing the downloads.
galaxy_download_result( x, out_dir = ".", galaxy_url = "https://usegalaxy.eu", overwrite = FALSE ) ## S4 method for signature 'character' galaxy_download_result( x, out_dir = ".", galaxy_url = "https://usegalaxy.eu", overwrite = FALSE ) ## S4 method for signature 'Galaxy' galaxy_download_result(x, out_dir = ".", overwrite = FALSE)galaxy_download_result( x, out_dir = ".", galaxy_url = "https://usegalaxy.eu", overwrite = FALSE ) ## S4 method for signature 'character' galaxy_download_result( x, out_dir = ".", galaxy_url = "https://usegalaxy.eu", overwrite = FALSE ) ## S4 method for signature 'Galaxy' galaxy_download_result(x, out_dir = ".", overwrite = FALSE)
x |
A vector of HDA output IDs ( |
out_dir |
Directory in which to save the downloaded files. |
galaxy_url |
Base URL of the Galaxy instance, used by the character method. |
overwrite |
Logical; if |
For the character method, a list of httr responses; for the
Galaxy method, the (unchanged) Galaxy object invisibly.
galaxy_download_rocrate() is an S4 generic. With x as a history ID
(character) it requests an export in RO-Crate format, polls until ready,
and downloads the archive to dest_file. With x as a Galaxy object,
its history_id and galaxy_url are used and the object is returned
invisibly after performing the download.
galaxy_download_rocrate( x, dest_file = tempfile(fileext = ".zip"), galaxy_url = "https://usegalaxy.eu", format = "rocrate.zip", poll_interval = 5, timeout = 600 ) ## S4 method for signature 'character' galaxy_download_rocrate( x, dest_file = tempfile(fileext = ".zip"), galaxy_url = "https://usegalaxy.eu", format = "rocrate.zip", poll_interval = 30, timeout = 600 ) ## S4 method for signature 'Galaxy' galaxy_download_rocrate( x, dest_file = tempfile(fileext = ".zip"), format = format, poll_interval = 5, timeout = 600 )galaxy_download_rocrate( x, dest_file = tempfile(fileext = ".zip"), galaxy_url = "https://usegalaxy.eu", format = "rocrate.zip", poll_interval = 5, timeout = 600 ) ## S4 method for signature 'character' galaxy_download_rocrate( x, dest_file = tempfile(fileext = ".zip"), galaxy_url = "https://usegalaxy.eu", format = "rocrate.zip", poll_interval = 30, timeout = 600 ) ## S4 method for signature 'Galaxy' galaxy_download_rocrate( x, dest_file = tempfile(fileext = ".zip"), format = format, poll_interval = 5, timeout = 600 )
x |
A history ID ( |
dest_file |
Path to save the downloaded RO-Crate (defaults to a
temporary |
galaxy_url |
Base URL of the Galaxy instance, used by the character
method. If |
format |
Format for the history export. Possible formats depend on the Galaxy server. Typical inputs are 'tgz', 'tar', 'tar.gz', 'bag.zip', 'bag.tar', 'bag.tgz', 'rocrate.zip' or 'bco.json'. Defaults to 'rocrate.zip'. |
poll_interval |
Seconds between status checks. |
timeout |
Maximum time to wait in seconds before giving up. |
For the character method, the path to the downloaded file. For the
Galaxy method, the (unchanged) Galaxy object invisibly.
hid <- "0123456789abcdef" crate <- galaxy_download_rocrate(hid, dest_file = "history_rocrate.zip") g <- galaxy() g <- galaxy_initialize(g) g <- galaxy_download_rocrate(g, dest_file = "history_rocrate.zip")hid <- "0123456789abcdef" crate <- galaxy_download_rocrate(hid, dest_file = "history_rocrate.zip") g <- galaxy() g <- galaxy_initialize(g) g <- galaxy_download_rocrate(g, dest_file = "history_rocrate.zip")
Retrieves metadata for one or more Galaxy history datasets (HDAs), including name, size, type, state, and deletion status.
galaxy_get_file_info(file_ids, galaxy_url = "https://usegalaxy.eu")galaxy_get_file_info(file_ids, galaxy_url = "https://usegalaxy.eu")
file_ids |
Character vector of Galaxy dataset IDs. |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
This function queries the /api/datasets/{id} endpoint for each
provided dataset ID. If a dataset cannot be retrieved, its fields
are returned as NA.
A data.frame with one row per dataset and the columns:
id, name, size_bytes, human_size,
file_type, state, deleted, stringsAsFactors.
tmp_dir <- tempdir() f_name <- "iris.csv" f_path <- paste(tmp_dir, f_name, sep = "\\") write.csv(datasets::iris, f_path, row.names = FALSE) history_id <- galaxy_initialize("IRIS") file_id <- galaxy_upload_https(f_path, history_id) galaxy_get_file_info(file_id)tmp_dir <- tempdir() f_name <- "iris.csv" f_path <- paste(tmp_dir, f_name, sep = "\\") write.csv(datasets::iris, f_path, row.names = FALSE) history_id <- galaxy_initialize("IRIS") file_id <- galaxy_upload_https(f_path, history_id) galaxy_get_file_info(file_id)
Retrieve detailed metadata for a Galaxy tool
galaxy_get_tool( tool_id, galaxy_url = "https://usegalaxy.eu", tool_version = NULL )galaxy_get_tool( tool_id, galaxy_url = "https://usegalaxy.eu", tool_version = NULL )
tool_id |
Character. The Galaxy tool ID (for example
|
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
tool_version |
Optional character string to request a specific
version. If |
A list containing the tool metadata as returned by the Galaxy API (inputs, outputs, help text, etc.).
tool_id <- galaxy_get_tool_id("FastQC")[1] fastqc_tool <- galaxy_get_tool(tool_id) fastqc_tool$descriptiontool_id <- galaxy_get_tool_id("FastQC")[1] fastqc_tool <- galaxy_get_tool(tool_id) fastqc_tool$description
Retrieve Galaxy tool IDs by name
galaxy_get_tool_id( name, tools = NULL, ignore_case = TRUE, galaxy_url = "https://usegalaxy.eu", panel_id = NULL )galaxy_get_tool_id( name, tools = NULL, ignore_case = TRUE, galaxy_url = "https://usegalaxy.eu", panel_id = NULL )
name |
Character string to search for in tool names. |
tools |
Optional list as returned by |
ignore_case |
Logical. Whether matching should ignore case.
Default: |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
panel_id |
Optional character. Passed through to
|
Character vector of matching tool IDs in decreasing order (usually highest version first). Returns character(0)
if no tools match.
# Fetch the full tool list once, then lookup tools <- galaxy_list_tools() galaxy_get_tool_id("FastQC", tools = tools) # Or let the helper fetch on demand galaxy_get_tool_id("FastQC") # Exact, case-sensitive match inside a specific panel galaxy_get_tool_id("Concatenate datasets", ignore_case = FALSE, panel_id = "Text Manipulation")# Fetch the full tool list once, then lookup tools <- galaxy_list_tools() galaxy_get_tool_id("FastQC", tools = tools) # Or let the helper fetch on demand galaxy_get_tool_id("FastQC") # Exact, case-sensitive match inside a specific panel galaxy_get_tool_id("Concatenate datasets", ignore_case = FALSE, panel_id = "Text Manipulation")
Receive workflow metadata from the API
galaxy_get_workflow(workflow_id, galaxy_url = "https://usegalaxy.eu")galaxy_get_workflow(workflow_id, galaxy_url = "https://usegalaxy.eu")
workflow_id |
Character. Galaxy workflow ID. |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
a structured list with all metadata
## Not run: galaxy_get_workflow("f2db41e1fa331b3e") ## End(Not run)## Not run: galaxy_get_workflow("f2db41e1fa331b3e") ## End(Not run)
Retrieves and summarizes the input steps required by a Galaxy workflow.
galaxy_get_workflow_inputs(workflow_id, galaxy_url = "https://usegalaxy.eu")galaxy_get_workflow_inputs(workflow_id, galaxy_url = "https://usegalaxy.eu")
workflow_id |
Character. Galaxy workflow ID. |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
This function queries /api/workflows/{workflow_id} and extracts
workflow input steps (data and parameter inputs). The returned
step_id values must be used as names in the inputs argument
of galaxy_start_workflow.
A data.frame with one row per workflow input and the columns:
step_id, name, type, optional, default.
## Not run: galaxy_get_workflow_inputs("f2db41e1fa331b3e") ## End(Not run)## Not run: galaxy_get_workflow_inputs("f2db41e1fa331b3e") ## End(Not run)
Check whether the environment variable
GALAXY_API_KEY is set and non-empty.
galaxy_has_key()galaxy_has_key()
Logical. TRUE if an API key is available, otherwise FALSE.
galaxy_has_key() # returns true if api key is setgalaxy_has_key() # returns true if api key is set
The function first tries to read a size/disk_usage field from the history summary endpoint. If that is not present it fetches the history contents and sums dataset sizes (robust to a few different field names used by different Galaxy versions). Results are returned as a data.frame with bytes and a human-readable size.
galaxy_history_size( history_id, galaxy_url = "https://usegalaxy.eu", include_deleted = FALSE )galaxy_history_size( history_id, galaxy_url = "https://usegalaxy.eu", include_deleted = FALSE )
history_id |
Galaxy history ID. |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
include_deleted |
Logical; whether to include deleted datasets when summing (default FALSE) |
data.frame with columns history_id, bytes, human_size
histories <- galaxy_list_histories() if(nrow(histories > 0)){ galaxy_history_size(histories$history_id[1]) } else { message("No histories found for current user.") }histories <- galaxy_list_histories() if(nrow(histories > 0)){ galaxy_history_size(histories$history_id[1]) } else { message("No histories found for current user.") }
galaxy_initialize() is an S4 generic. With no x supplied it creates a
new history on the given Galaxy instance and returns its encoded ID. When
called with a Galaxy object it uses the object’s history_name and
galaxy_url, creates the history, and updates the object with the new
history_id and state "pending".
galaxy_initialize( x, name = "R API request", galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'missing' galaxy_initialize(name, galaxy_url) ## S4 method for signature 'Galaxy' galaxy_initialize(x)galaxy_initialize( x, name = "R API request", galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'missing' galaxy_initialize(name, galaxy_url) ## S4 method for signature 'Galaxy' galaxy_initialize(x)
x |
A |
name |
Name of the history to create. Ignored when |
galaxy_url |
Base URL of the Galaxy instance. Ignored when |
A valid Galaxy API key is required and must be available via the
GALAXY_API_KEY environment variable.
For the default method (x missing), a character scalar history ID.
For the Galaxy method, the modified Galaxy object.
history_id <- galaxy_initialize("My history name") g <- galaxy(history_name = "My history name") g <- galaxy_initialize(g)history_id <- galaxy_initialize("My history name") g <- galaxy(history_name = "My history name") g <- galaxy_initialize(g)
galaxy_list_files() is an S4 generic. With x as a character scalar,
it is treated as a Galaxy history ID and returns a data frame of history
datasets (files). With x as a Galaxy object, the history ID and URL
are taken from the object.
galaxy_list_files( x, include_deleted = FALSE, include_hidden = FALSE, galaxy_url = "https://usegalaxy.eu", limit = 500L ) ## S4 method for signature 'character' galaxy_list_files( x, include_deleted = FALSE, include_hidden = FALSE, galaxy_url = "https://usegalaxy.eu", limit = 500L ) ## S4 method for signature 'Galaxy' galaxy_list_files( x, include_deleted = FALSE, include_hidden = FALSE, limit = 500L )galaxy_list_files( x, include_deleted = FALSE, include_hidden = FALSE, galaxy_url = "https://usegalaxy.eu", limit = 500L ) ## S4 method for signature 'character' galaxy_list_files( x, include_deleted = FALSE, include_hidden = FALSE, galaxy_url = "https://usegalaxy.eu", limit = 500L ) ## S4 method for signature 'Galaxy' galaxy_list_files( x, include_deleted = FALSE, include_hidden = FALSE, limit = 500L )
x |
A history ID ( |
include_deleted |
Logical; if |
|
Logical; if |
|
galaxy_url |
Character. Base URL of the Galaxy instance, used by the
character method. If |
limit |
Integer page size for API pagination. Default: |
The function queries /api/histories/{history_id}/contents using
pagination and returns one row per history content item, restricted to
datasets (history_content_type == "dataset" when available).
A data.frame with one row per dataset and columns:
Encoded dataset ID.
Dataset name.
Encoded history ID.
Usually "dataset".
Galaxy item type (if provided by server).
Dataset state (e.g. "ok", "running", "error").
Logical deletion flag.
Logical hidden flag.
Datatype extension (if available).
Dataset size in bytes (if available).
Creation timestamp (if available).
Update timestamp (if available).
If no datasets are found, an empty data frame with these columns is returned.
# Character method (history_id) hid <- galaxy_initialize("List files example") files_df <- galaxy_list_files(hid) head(files_df) # Galaxy-object method g <- galaxy(history_name = "List files example") g <- galaxy_initialize(g) files_df2 <- galaxy_list_files(g) head(files_df2)# Character method (history_id) hid <- galaxy_initialize("List files example") files_df <- galaxy_list_files(hid) head(files_df) # Galaxy-object method g <- galaxy(history_name = "List files example") g <- galaxy_initialize(g) files_df2 <- galaxy_list_files(g) head(files_df2)
List Galaxy histories (name and history id)
galaxy_list_histories(galaxy_url = "https://usegalaxy.eu")galaxy_list_histories(galaxy_url = "https://usegalaxy.eu")
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
data.frame with columns: history_name, history_id
histories <- galaxy_list_histories()histories <- galaxy_list_histories()
List workflow invocations for a given workflow
galaxy_list_invocations(workflow_id, galaxy_url = "https://usegalaxy.eu")galaxy_list_invocations(workflow_id, galaxy_url = "https://usegalaxy.eu")
workflow_id |
The Galaxy workflow ID to list invocations for. |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
data.frame with columns: invocation_id, workflow_id, history_id, state, create_time, update_time, stringsAsFactors
List tools installed on a Galaxy instance
galaxy_list_tools( galaxy_url = "https://usegalaxy.eu", in_panel = FALSE, panel_id = NULL )galaxy_list_tools( galaxy_url = "https://usegalaxy.eu", in_panel = FALSE, panel_id = NULL )
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
in_panel |
Logical. If |
panel_id |
Optional character. When supplied, only tools from the
matching panel (section/category) are returned. The value is matched
against both the panel |
A list corresponding to the parsed JSON returned by Galaxy.
If panel_id is provided, a list of tool entries belonging to
the requested panel is returned (each entry is the raw tool metadata
as provided by Galaxy).
# All tools (flat list) tools_list <- galaxy_list_tools() length(tools_list) # Panel structure panel_list <- galaxy_list_tools(in_panel = TRUE) length(panel_list) # Tools from a specific panel (match by id or name) tools_list <- galaxy_list_tools(panel_id = "Get Data") length(tools_list)# All tools (flat list) tools_list <- galaxy_list_tools() length(tools_list) # Panel structure panel_list <- galaxy_list_tools(in_panel = TRUE) length(panel_list) # Tools from a specific panel (match by id or name) tools_list <- galaxy_list_tools(panel_id = "Get Data") length(tools_list)
Retrieves workflows accessible to the authenticated user from a Galaxy instance. Optionally includes public (published) workflows if supported by the Galaxy server.
galaxy_list_workflows( include_public = FALSE, galaxy_url = "https://usegalaxy.eu" )galaxy_list_workflows( include_public = FALSE, galaxy_url = "https://usegalaxy.eu" )
include_public |
Logical. If |
galaxy_url |
Character. Base URL of the Galaxy instance
(for example |
By default, only workflows owned by or shared with the current user
are returned. When include_public = TRUE, the function will
attempt to request published workflows as well. Availability of
public workflows depends on the Galaxy instance and version.
A data.frame with one row per workflow and columns including:
id, name, published, owner.
workflows <- galaxy_list_workflows(TRUE) head(workflows)workflows <- galaxy_list_workflows(TRUE) head(workflows)
Generic for galaxy_poll_tool
Wait for a Galaxy job to complete
S4 method to poll the status of a tool invocation
galaxy_poll_tool( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 3, timeout = 600 ) ## S4 method for signature 'character' galaxy_poll_tool( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 3, timeout = 600 ) ## S4 method for signature 'Galaxy' galaxy_poll_tool(x, poll_interval = 3, timeout = 600)galaxy_poll_tool( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 3, timeout = 600 ) ## S4 method for signature 'character' galaxy_poll_tool( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 3, timeout = 600 ) ## S4 method for signature 'Galaxy' galaxy_poll_tool(x, poll_interval = 3, timeout = 600)
x |
A job ID ( |
galaxy_url |
Base URL of the Galaxy instance, used by the character method. |
poll_interval |
Seconds between status checks. |
timeout |
Maximum time to wait in seconds. |
For the character method, the final job object; for the Galaxy
method, the modified Galaxy object.
galaxy_poll_workflow() is an S4 generic. With x as a character vector it
is treated as a workflow invocation ID; the invocation is polled until it
completes and a list of output dataset IDs is returned. With x as a
Galaxy object, the invocation_id and galaxy_url are taken from the
object, and the object is updated with the resulting output_dataset_ids and
state.
galaxy_poll_workflow( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 30, ... ) ## S4 method for signature 'character' galaxy_poll_workflow( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 30, ... ) ## S4 method for signature 'Galaxy' galaxy_poll_workflow( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 30, ... )galaxy_poll_workflow( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 30, ... ) ## S4 method for signature 'character' galaxy_poll_workflow( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 30, ... ) ## S4 method for signature 'Galaxy' galaxy_poll_workflow( x, galaxy_url = "https://usegalaxy.eu", poll_interval = 30, ... )
x |
A workflow invocation ID ( |
galaxy_url |
Base URL of the Galaxy instance, used by the character
method. If |
poll_interval |
Time in seconds between polling attempts. |
... |
not in use |
For the character method, a list with elements success and
output_ids. For the Galaxy method, the modified Galaxy object.
invocation_id <- "abc123" galaxy_poll_workflow(invocation_id)invocation_id <- "abc123" galaxy_poll_workflow(invocation_id)
Print tool inputs
galaxy_print_tool_inputs(inputs)galaxy_print_tool_inputs(inputs)
inputs |
A list of tool inputs as returned by |
A character vector with formatted input descriptions.
tool_id <- galaxy_get_tool_id("FastQC")[1] fastqc_tool <- galaxy_get_tool(tool_id) print_tool_inputs(fastqc_tool)tool_id <- galaxy_get_tool_id("FastQC")[1] fastqc_tool <- galaxy_get_tool(tool_id) print_tool_inputs(fastqc_tool)
galaxy_run_tool() is an S4 generic. With x as a character vector it is
treated as a history ID; the specified tool is invoked in that history and
the job ID is returned. With x as a Galaxy object, the history ID and
URL are taken from the object and the object is updated with the job ID.
galaxy_run_tool( x, tool_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'character' galaxy_run_tool( x, tool_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'Galaxy' galaxy_run_tool(x, tool_id, inputs = NULL, dataset_id = NULL)galaxy_run_tool( x, tool_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'character' galaxy_run_tool( x, tool_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'Galaxy' galaxy_run_tool(x, tool_id, inputs = NULL, dataset_id = NULL)
x |
A history ID ( |
tool_id |
Tool identifier to execute. |
inputs |
Named list of tool inputs. |
dataset_id |
ID of the input dataset (HDA). |
galaxy_url |
Base URL of the Galaxy instance, used by the character method. |
For the character method, a job ID; for the Galaxy method, the
modified Galaxy object.
Set Galaxy connection parameters for the current R session
galaxy_set_credentials( api_key = NULL, username = NULL, password = NULL, galaxy_url = "https://usegalaxy.eu", overwrite = TRUE )galaxy_set_credentials( api_key = NULL, username = NULL, password = NULL, galaxy_url = "https://usegalaxy.eu", overwrite = TRUE )
api_key |
Character. Galaxy API key. |
username |
Character. Galaxy username (only required for FTP uploads). |
password |
Character. Galaxy password (only required for FTP uploads). |
galaxy_url |
Character. Base URL of the Galaxy instance
(e.g. |
overwrite |
Logical. Whether to overwrite existing environment
variables. Default: |
This helper is intended for interactive sessions. It sets the following
environment variables using Sys.setenv():
GALAXY_API_KEY
GALAXY_URL
GALAXY_USERNAME
GALAXY_PASSWORD
Only arguments that are provided (non-NULL) are set.
Invisibly returns a named list of values that were set.
# This requires valid credentials to your galaxy instance ## Not run: galaxy_set_credentials( api_key = "your-secret-key", username = "your-username", password = "your-password", galaxy_url = "https://usegalaxy.eu" ) ## End(Not run)# This requires valid credentials to your galaxy instance ## Not run: galaxy_set_credentials( api_key = "your-secret-key", username = "your-username", password = "your-password", galaxy_url = "https://usegalaxy.eu" ) ## End(Not run)
galaxy_start_workflow() is an S4 generic. With x as a character vector
it is treated as a history ID: the given workflow is invoked in that history
and the invocation ID is returned. With x as a Galaxy object, the
history ID and URL are taken from the object; the workflow is started and
the object is updated with the resulting invocation_id.
galaxy_start_workflow( x, workflow_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'character' galaxy_start_workflow( x, workflow_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'Galaxy' galaxy_start_workflow(x, workflow_id, inputs = NULL, dataset_id = NULL)galaxy_start_workflow( x, workflow_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'character' galaxy_start_workflow( x, workflow_id, inputs = NULL, dataset_id = NULL, galaxy_url = "https://usegalaxy.eu" ) ## S4 method for signature 'Galaxy' galaxy_start_workflow(x, workflow_id, inputs = NULL, dataset_id = NULL)
x |
A |
workflow_id |
Character. Galaxy workflow ID. |
inputs |
Named list. Optional workflow input mapping; keys are workflow input step IDs, values are lists describing datasets/parameters. |
dataset_id |
Character. ID of the input dataset (HDA). Ignored if
|
galaxy_url |
Base URL of the Galaxy instance, used by the character
method. If |
For the character method, a character scalar invocation ID. For the
Galaxy method, the modified Galaxy object.
galaxy_upload_ftp() is an S4 generic. With no x supplied it uploads a
local file via FTP and registers it in the specified history, returning the
encoded dataset ID. When called with a Galaxy object it uses the
object's history_id and galaxy_url and updates the object with the new
input_dataset_id.
galaxy_upload_ftp( x, input_file, galaxy_ftp = "ftp.usegalaxy.eu", galaxy_url = "https://usegalaxy.eu", ... ) ## S4 method for signature 'character' galaxy_upload_ftp( x, input_file, galaxy_ftp = "ftp.usegalaxy.eu", galaxy_url = "https://usegalaxy.eu", ... ) ## S4 method for signature 'Galaxy' galaxy_upload_ftp( x, input_file, galaxy_ftp = "ftp.usegalaxy.eu", galaxy_url = "https://usegalaxy.eu", ... )galaxy_upload_ftp( x, input_file, galaxy_ftp = "ftp.usegalaxy.eu", galaxy_url = "https://usegalaxy.eu", ... ) ## S4 method for signature 'character' galaxy_upload_ftp( x, input_file, galaxy_ftp = "ftp.usegalaxy.eu", galaxy_url = "https://usegalaxy.eu", ... ) ## S4 method for signature 'Galaxy' galaxy_upload_ftp( x, input_file, galaxy_ftp = "ftp.usegalaxy.eu", galaxy_url = "https://usegalaxy.eu", ... )
x |
A |
input_file |
Path to the local file to upload. |
galaxy_ftp |
FTP server address of the Galaxy instance. |
galaxy_url |
Base URL of the Galaxy instance, used by the default
method. If |
... |
not in use |
A valid API key (GALAXY_API_KEY) and FTP credentials (GALAXY_USERNAME,
GALAXY_PASSWORD) must be available in the environment.
For the default method, a character scalar dataset ID. For the
Galaxy method, the modified Galaxy object.
galaxy_ftp <- "ftp.usegalaxy.eu" input_file <- tempfile(fileext = ".txt") writeLines("Example", input_file) hid <- galaxy_initialize("test upload") did <- galaxy_upload_ftp(input_file, hid, galaxy_ftp) g <- galaxy() g <- galaxy_initialize(g) g <- galaxy_upload_ftp(g, input_file, galaxy_ftp = galaxy_ftp)galaxy_ftp <- "ftp.usegalaxy.eu" input_file <- tempfile(fileext = ".txt") writeLines("Example", input_file) hid <- galaxy_initialize("test upload") did <- galaxy_upload_ftp(input_file, hid, galaxy_ftp) g <- galaxy() g <- galaxy_initialize(g) g <- galaxy_upload_ftp(g, input_file, galaxy_ftp = galaxy_ftp)
galaxy_upload_https() is an S4 generic. With no x supplied it uploads a
local file via HTTPS to the specified history and returns the encoded dataset
ID. When called with a Galaxy object it uses the object's history_id and
galaxy_url, uploads the file, and updates the object with the new
input_dataset_id.
galaxy_upload_https( x, input_file, wait = FALSE, wait_timeout = 600, galaxy_url = "https://usegalaxy.eu", file_type = "auto", dbkey = "?", ... ) ## S4 method for signature 'character' galaxy_upload_https( x, input_file, wait = FALSE, wait_timeout = 600, galaxy_url = "https://usegalaxy.eu", file_type = "auto", dbkey = "?", ... ) ## S4 method for signature 'Galaxy' galaxy_upload_https( x, input_file, wait = FALSE, wait_timeout = 600, galaxy_url = "https://usegalaxy.eu", file_type = "auto", dbkey = "?", ... )galaxy_upload_https( x, input_file, wait = FALSE, wait_timeout = 600, galaxy_url = "https://usegalaxy.eu", file_type = "auto", dbkey = "?", ... ) ## S4 method for signature 'character' galaxy_upload_https( x, input_file, wait = FALSE, wait_timeout = 600, galaxy_url = "https://usegalaxy.eu", file_type = "auto", dbkey = "?", ... ) ## S4 method for signature 'Galaxy' galaxy_upload_https( x, input_file, wait = FALSE, wait_timeout = 600, galaxy_url = "https://usegalaxy.eu", file_type = "auto", dbkey = "?", ... )
x |
A |
input_file |
Path to the local file to upload. |
wait |
Logical. Whether to wait for Galaxy to finish processing. |
wait_timeout |
Time in seconds until |
galaxy_url |
Base URL of the Galaxy instance, used by the default method.
If |
file_type |
Galaxy datatype identifier (e.g. |
dbkey |
Reference genome identifier (e.g. |
... |
not in use |
This uses Galaxy's built‑in upload1 tool and performs a multipart form
POST. Large files may still require FTP depending on server configuration.
A valid API key (GALAXY_API_KEY) must be available in the environment.
For the default method, a character scalar dataset ID. For the
Galaxy method, the modified Galaxy object.
hid <- galaxy_initialize("test upload") test_file <- tempfile(fileext = ".txt") writeLines("This is an example test file.", test_file) file_id <- galaxy_upload_https(hid, test_file) g <- galaxy() g <- galaxy_initialize(g) g <- galaxy_upload_https(g, test_file)hid <- galaxy_initialize("test upload") test_file <- tempfile(fileext = ".txt") writeLines("This is an example test file.", test_file) file_id <- galaxy_upload_https(hid, test_file) g <- galaxy() g <- galaxy_initialize(g) g <- galaxy_upload_https(g, test_file)
An S4 class used to carry state across a pipe‑based workflow against a Galaxy instance.
history_nameDefault name to give to a new history.
history_idEncoded ID of the history on the server.
input_dataset_idEncoded ID of the last uploaded input dataset.
inputsA list of tool/workflow inputs to be applied on the next call.
invocation_idEncoded ID of the last workflow invocation.
output_dataset_idsCharacter vector of encoded output dataset IDs.
stateOne of "new", "pending", "success" or "error".
galaxy_urlBase URL of the Galaxy instance.