- example_tool.py tools/mytools
- example_tool.xml tools/mytools
- my_tool_conf.xml config/
- my_job_conf.xml config/
Last active
March 8, 2016 04:47
-
-
Save kantale/b7fecd62da22a1523aa2 to your computer and use it in GitHub Desktop.
How to setup galaxy with TORQUE in Amazon's cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
''' | |
Just a simple tool that adds the line number at | |
the end of each line | |
''' | |
with open(sys.argv[1]) as f_in, open(sys.argv[2], 'w') as f_out: | |
c = 0 | |
for l in f_in: | |
c += 1 | |
f_out.write(l.replace('\n', '') + '\t%i'%c + '\n') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tool id="custom_tool_1" name="Custom Tool 1" version="0.1.0"> | |
<description>Experimental tool 1</description> | |
<command interpreter="python">example_tool.py $input $output</command> | |
<inputs> | |
<param format="tabular" name="input" type="data" label="Source file"/> | |
</inputs> | |
<outputs> | |
<data format="tabular" name="output" /> | |
</outputs> | |
<tests> | |
<test> | |
<param name="input" value="test_input.txt"/> | |
<output name="output" file="test_output.txt"/> | |
</test> | |
</tests> | |
<help> | |
The best tool ever. | |
</help> | |
</tool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!-- A sample job config that explicitly configures job running the way it is configured by default (if there is no explicit config). --> | |
<job_conf> | |
<plugins> | |
<plugin id="local" | |
type="runner" | |
load="galaxy.jobs.runners.local:LocalJobRunner" | |
workers="4"/> | |
<plugin id="torque1" type="runner" | |
load="galaxy.jobs.runners.pbs:PBSJobRunner" | |
workers="2"/> | |
</plugins> | |
<handlers> | |
<handler id="main"/> | |
</handlers> | |
<destinations default="local"> | |
<destination id="local" runner="local"/> | |
<destination id="torque1_dst" runner="torque1"/> | |
</destinations> | |
<tools> | |
<tool id="custom_tool_1" destination="torque1_dst"/> | |
</tools> | |
</job_conf> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section name="MyTools" id="mTools"> | |
<tool file="mytools/example_tool.xml" /> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a b c | |
e f g | |
h i j |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This guide assumes that you have setup and ssh-ed in an EC2 instance. The instance that I used was "Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-f95ef58a". I would love to see some comments.
Get packages:
Install TORQUE
Add to /etc/hosts
For example:
Continue:
This should look like:
continue with:
Add HOSTNAME to
Add root@HOSTNAME to:
Start everything:
Make sure this this command:
Produces something like this:
Make a test job
Make the file: test.sh
Submit it:
Make sure that everything went ok:
Install pbs-python
Install galaxy
edit config/galaxy.ini and add: (MAKE SURE YOU ARE MAKING THIS CHANGE IN THE
[server:main]
SECTION!!)Make sure that it runs fine:
Now it is a nice time to:
test_input.txt
(Get_data --> upload file)stop server with control-c
Let's add a tool: (Assuming you have a local copy of these files in ../)
Edit config/galaxy.ini and add the line:
Rerun server:
You should be able to see the tool at the end of the tool bar:
Make a workflow to test the tool installation
Save it and run, giving as input the file
test.txt
The results should look like this:
Configure my_tool to run via TORQUE
Stop the serve (ctrl-c)
Edit galaxy/config.ini and add the following lines:
Create the
cluster_files_directory
Rerun the server and run the same workflow again (exactly as before)
With qstat you should be able to confirm that the workflow was submitted:
Also the resulted file should be the same as before.