Set up a Galaxy for Training
OverviewQuestions:Objectives:
How do I prepare my Galaxy instance to support a training module?
How can I generate a Docker Galaxy instance for my topic?
Use ephemeris to install the training requirements to a Galaxy instance
Create a docker image for a training topic
Time estimation: 2 hoursLast modification: Oct 18, 2022
Introduction
In this tutorial, you will learn how to provision your Galaxy instance to support training modules from the GTN repository.
Tutorials in this repository are all supplemented with files describing the technical requirements to run them. This makes it easy to automate installation of tutorial requirements.
tools.yaml
: describes the Tool Shed tools used in the tutorialdata-library.yaml
: describes the input datasetsdata-manager.yaml
: describes the reference data required by toolsworkflows
folder: contains one or more workflows with all steps in the tutorialtours
folder: contains one or more yaml files describing interactive tours
Comment: RequirementsFor more information about how to create these files, please see our module on specifying the technical requirements for your tutorial.
For just the list of Ephemeris commands needed for installation, skip to the Quickstart section at the end of this tutorial.
AgendaIn this tutorial, we will deal with:
Prepare for installation
If you have a Galaxy server already running somewhere and would like to support one or more training modules, ephemeris can be used to easily install all the required tools, reference data, data libraries, tours and workflows.
For the purposes of this training, we will create a Galaxy instance running on localhost:8080
, but these instructions can be adapted for use with any Galaxy instance by replacing this value with the URL or IP address of your Galaxy server.
Start a local Galaxy
To setup a Galaxy server locally, we will first clone the Galaxy github repository, make a few small edits to the galaxy.yaml
configuration file, and then start the server.
Hands-on: Setup a local Galaxy instance
- Clone the github repository
git clone https://github.com/galaxyproject/galaxy.git cd galaxy
- Add yourself as admin user in
config/galaxy.yaml
cp config/galaxy.yml.sample config/galaxy.yml
open the
galaxy.yml
file with your favorite editor and edit the following line with your email address:admin_users: user@example.org
- Start Galaxy
sh run.sh
Galaxy will now install all its requirements, which may take a few minutes, when all is finished installing, you should see something like this in your screen:
Starting server in PID 9560. serving on http://localhost:8080
- Open Galaxy
- Open a web browser
- Navigate to
localhost:8080
to access Galaxy
Find your Galaxy API key
In order to install the tutorial requirements, we will need the API key of an admin user.
Hands-on: Obtain Galaxy API key
- Register an account on Galaxy using the email address you added to the
config/galaxy.yml
file
- Once logged in, verify that you have a menu item named
Admin
in your top menu bar.- Go to your
User -> Preferences
in the top menu bar, then click onManage API key
- Click on
Create a new key
to generate an API key
- Copy your API key to somewhere convenient, you will need it throughout this tutorial
Install Ephemeris
To install to training requirements to our Galaxy, we will use Ephemeris, let’s install it now:
Hands-on: Install Ephemeris# optional: create a virtual environment virtualenv .venv; . .venv/bin/activate # install ephemeris pip install ephemeris
Installing tutorial requirements
We have created a small bash script to automatically install all of a tutorial’s requirements to an existing Galaxy. It’s located in this repository under: bin/install_tutorial_requirements.sh
In this example we will install the requirements for the Reference-based RNASeq tutorial to the Galaxy instance running on localhost.
Hands-on: Install a tutorial
- If you have not done so yet, clone the training material github repo:
git clone https://github.com/galaxyproject/training-material.git cd training-material
Run the script to install the RNASeq tutorial
bin/install_tutorial_requirements.sh topics/transcriptomics/tutorials/ref-based http://localhost:8080 <api key>
Installation may take some time. This script will automatically install the tools, create a data library and populate it with the input datasets from Zenodo, install and publish the workflows, and run any data managers that might be required.
The only thing the script cannot currently automate is the installation of the interactive tours. We will now do this manually by copying the contents of the tours
folder to our Galaxy instance, in the folder $GALAXY_ROOT/config/plugins/tours
Hands-on: Install the interactive Tours
- Copy the
tour.yaml
file from the training materials repo to Galaxycp -r topics/transcriptomics/tutorials/ref-based/tours/ $GALAXY_ROOT/config/plugins/tours
Installing an entire topic
If you would like to install all the requirements for every tutorial within an entire topic, you can use the script in bin/install_topic_requirements.sh
Installing a subset of components
If you would like to pick and choose what to install for each tutorial, below are descriptions of the commands used to install each of the components (tools, workflows, reference data, data libraries, tours) please see the Quickstart section for the individual commands used by the script
Quickstart
Below is the list of commands used in this tutorial.
Using the scripts in this repository:
# Make sure you are in the root of the training-material repo
cd <training-materials repo root>
# install single tutorial
bin/install_tutorial_requirements.sh topics/<yourtopic>/tutorials/<yourtutorial> <Galaxy URL> <API key>
# install entire topic
bin/install_topic_requirements.sh topics/<yourtopic> <Galaxy URL> <API key>
Using ephemeris directly:
# install tools
shed-tools install -g <Galaxy URL> -a <API key> -t topics/<topic>/tutorials/<tutorial>/tools.yaml
# create data library with input datasets
setup-data-libraries -g <Galaxy URL> -a <API key> -i topics/<topic>/tutorials/<tutorial>/data-library.yaml
# install reference data
run-data-managers -g <Galaxy URL> -a <API key> --config topics/<topic>/tutorials/<tutorial>/data-manager.yaml
# install workflows
workflow-install --publish-workflows -g <Galaxy URL> -a <API key> -w topics/<topic>/tutorials/<tutorial>/workflows
# install tours
copy the contents of the "tours" directory for the tutorial to Galaxy's "config/plugins/tours/"
When data libraries are created, depending on the server settings, they may be created privately. You will need to fix their permissions either through the UI or the API if you have many datasets. UseGalaxy.eu uses a script to correct the permissions.
Conclusion
Key points
Technical requirements have been defined for all the training materials
Ephemeris can be used to automatically install these requirements to an existing Galaxy
Convenience scripts are provided in the training material repository allow for easy installation
Docker images can easily be created per topic
Frequently Asked Questions
Have questions about this tutorial? Check out the FAQ page for the Teaching and Hosting Galaxy training topic to see if your question is listed there. If not, please ask your question on the GTN Gitter Channel or the Galaxy Help ForumFeedback
Did you use this material as an instructor? Feel free to give us feedback on how it went.
Did you use this material as a learner or student? Click the form below to leave feedback.
Citing this Tutorial
- Saskia Hiltemann, Bérénice Batut, 2022 Set up a Galaxy for Training (Galaxy Training Materials). https://training.galaxyproject.org/training-material/topics/teaching/tutorials/setup-galaxy-for-training/tutorial.html Online; accessed TODAY
- Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems 10.1016/j.cels.2018.05.012
Congratulations on successfully completing this tutorial!@misc{teaching-setup-galaxy-for-training, author = "Saskia Hiltemann and Bérénice Batut", title = "Set up a Galaxy for Training (Galaxy Training Materials)", year = "2022", month = "10", day = "18" url = "\url{https://training.galaxyproject.org/training-material/topics/teaching/tutorials/setup-galaxy-for-training/tutorial.html}", note = "[Online; accessed TODAY]" } @article{Batut_2018, doi = {10.1016/j.cels.2018.05.012}, url = {https://doi.org/10.1016%2Fj.cels.2018.05.012}, year = 2018, month = {jun}, publisher = {Elsevier {BV}}, volume = {6}, number = {6}, pages = {752--758.e1}, author = {B{\'{e}}r{\'{e}}nice Batut and Saskia Hiltemann and Andrea Bagnacani and Dannon Baker and Vivek Bhardwaj and Clemens Blank and Anthony Bretaudeau and Loraine Brillet-Gu{\'{e}}guen and Martin {\v{C}}ech and John Chilton and Dave Clements and Olivia Doppelt-Azeroual and Anika Erxleben and Mallory Ann Freeberg and Simon Gladman and Youri Hoogstrate and Hans-Rudolf Hotz and Torsten Houwaart and Pratik Jagtap and Delphine Larivi{\`{e}}re and Gildas Le Corguill{\'{e}} and Thomas Manke and Fabien Mareuil and Fidel Ram{\'{\i}}rez and Devon Ryan and Florian Christoph Sigloch and Nicola Soranzo and Joachim Wolff and Pavankumar Videm and Markus Wolfien and Aisanjiang Wubuli and Dilmurat Yusuf and James Taylor and Rolf Backofen and Anton Nekrutenko and Björn Grüning}, title = {Community-Driven Data Analysis Training for Biology}, journal = {Cell Systems} }