Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
galaxyproject
GitHub Repository: galaxyproject/training-material
Path: blob/main/bin/install_tutorial_requirements.sh
1677 views
1
#! /bin/bash
2
3
# Script to install a tutorial to a running Galaxy instance
4
#
5
# usage: install_tutorial.sh </path/to/tutorial> <galaxy_url> <admin_api_keyoexample.org
6
#
7
# example: sh bin/install_tutorial.sh topics/metagenomics/tutorials/mothur-miseq-sop http://localhost:8080 admin
8
#
9
# make sure you have ephemeris installed:
10
# pip install ephemeris -U
11
#
12
13
tutorial=$1
14
galaxy_url=$2
15
api_key=$3
16
17
18
# install workflows and tools
19
echo "Installing workflows"
20
if [ -d ${tutorial}/workflows ]
21
then
22
echo " - Extracting tools from workflows"
23
for w in ${tutorial}/workflows/*.ga
24
do
25
workflow-to-tools -w $w -o ${tutorial}/workflows/wftools.yaml -l $(basename ${tutorial})
26
echo " - Installing tools from workflow $(basename $w)"
27
shed-tools install -g ${galaxy_url} -a ${api_key} -t ${tutorial}/workflows/wftools.yaml
28
rm ${tutorial}/workflows/wftools.yaml
29
done
30
echo " - Installing workflows"
31
workflow-install --publish_workflows -g ${galaxy_url} -a ${api_key} -w ${tutorial}/workflows/
32
33
else
34
echo "No workflows to install (no directory named workflow present)"
35
fi
36
37
# install data libraries
38
echo "Populating Data Libraries"
39
if [ -f ${tutorial}/data-library.yaml ]
40
then
41
setup-data-libraries -g ${galaxy_url} -a ${api_key} -i ${tutorial}/data-library.yaml
42
else
43
echo "No data library to install (no file named data-libraries.yaml present)"
44
fi
45
46
# install reference data
47
echo "Installing reference data"
48
if [ -f ${tutorial}/data-manager.yaml ]
49
then
50
run-data-managers -g ${galaxy_url} -a ${api_key} --config ${tutorial}/data-manager.yaml
51
52
else
53
echo "No reference data to install (no file named data-manager.yaml present)"
54
fi
55
56
# install tours --> not possible via API yet
57
58