galaxy_delete_dataset: Delete a Galaxy dataset by ID

View source: R/2025-10-27_JF_R_Galaxy_functions.R

galaxy_delete_datasetR Documentation

Delete a Galaxy dataset by ID

Description

Delete a dataset (HDA) from a Galaxy instance using the Galaxy API.

Usage

galaxy_delete_dataset(
  dataset_id,
  purge = TRUE,
  verbose = FALSE,
  galaxy_url = "https://usegalaxy.eu"
)

Arguments

dataset_id

Character. The Galaxy dataset ID to delete.

purge

Logical. If TRUE the API call will include purge=true to permanently remove the dataset and free space. If FALSE the dataset may be only soft-deleted depending on Galaxy configuration. Default: TRUE.

verbose

Logical. If TRUE a message with the HTTP status code will be printed. Default: TRUE.

galaxy_url

Character. Base URL of the Galaxy instance (for example "https://usegalaxy.eu"). If the environment variable GALAXY_URL is set, it takes precedence.

Details

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.

Value

A named list with elements:

success

Logical. TRUE for 2xx responses, otherwise FALSE.

status

Integer. HTTP status code returned by the API.

content

Character. The raw response body (text).

Examples


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)



GalaxyR documentation built on July 6, 2026, 5:08 p.m.