Skip to content

Instantly share code, notes, and snippets.

@jmchilton
Created July 24, 2014 15:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmchilton/38c33d365e116c750c21 to your computer and use it in GitHub Desktop.
Save jmchilton/38c33d365e116c750c21 to your computer and use it in GitHub Desktop.
Example script that runs Galaxy's random lines tool using bioblend.
# Setup Galaxy instance and dataset for testing...
from bioblend import galaxy
gi = galaxy.GalaxyInstance("localhost:8080", "1957431058be3aa3c57ca312f4a05521")
history = gi.histories.create_history(name="TestRandomLines")
dataset_id = gi.tools.paste_content("1\n2\n3", history["id"])['outputs'][0]["id"]
# Prepare tool inputs.
from bioblend.galaxy.tools.inputs import inputs, dataset
random_lines_inputs = inputs().set("num_lines", 1).set("input", dataset(dataset_id))
# Run tool.
tool_outputs = gi.tools.run_tool(history_id=history["id"], tool_id="random_lines1", tool_inputs=random_lines_inputs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment