changeset 0:1e8862eb2eba draft

Uploaded
author crs4
date Fri, 06 Sep 2013 05:58:59 -0400
parents
children 2dcf5873f1b1
files COPYING mugsy.py mugsy.xml tool_dependencies.xml
diffstat 4 files changed, 167 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/COPYING	Fri Sep 06 05:58:59 2013 -0400
@@ -0,0 +1,23 @@
+Copyright © 2012-2013 CRS4 Srl. http://www.crs4.it/
+Created by:
+Massimiliano Orsini <massimiliano.orsini@crs4.it>
+Nicola Soranzo <nicola.soranzo@crs4.it>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mugsy.py	Fri Sep 06 05:58:59 2013 -0400
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+"""
+Mugsy wrapper
+
+For draft genomes a single multi-FASTA file containig all contigs should be provided.
+"""
+
+import optparse
+import os
+import shutil
+import subprocess
+import sys
+import tempfile
+
+def __main__():
+    """ main function """
+    parser = optparse.OptionParser()
+    parser.add_option('-r', dest='reference', help='reference FASTA file')
+    parser.add_option('-c', dest='contigs', help='contigs FASTA file')
+    parser.add_option('-p', dest='prefix', default='prefix', help='prefix ')
+    parser.add_option('-l', dest='logfile', help='logfile')
+    parser.add_option('--ml', dest='mugsylog', help='mugsylog file')
+    parser.add_option('--maf', dest='maf', help='ouput MAF alignment file ')
+    (options, args) = parser.parse_args()
+    if len(args) > 0:
+        parser.error('Wrong number of arguments')
+    
+    logfile = options.logfile
+    wd = tempfile.mkdtemp()
+    try:
+        command = "mugsy --directory %s --prefix %s --log %s %s %s" % (wd, options.prefix, options.mugsylog, options.reference, options.contigs)
+        print 'Mugsy command to be executed:\n ' + command
+        
+        log = open(logfile, 'w') if logfile else sys.stdout
+        try:
+            subprocess.check_call(command, stderr=log, shell=True) # need to redirect stderr because mugsy writes its logging info there
+        finally:
+            if log != sys.stdout:
+                log.close()
+        print 'Mugsy executed!'
+        
+        shutil.move(os.path.join(wd, options.prefix + '.maf'), options.maf)
+    finally:
+        shutil.rmtree(wd)
+
+
+if __name__ == "__main__":
+    __main__()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mugsy.xml	Fri Sep 06 05:58:59 2013 -0400
@@ -0,0 +1,44 @@
+<tool id="mugsy" name="Mugsy" version="1.0.1">
+  <description>multiple whole genome aligner</description>
+  <requirements>
+    <requirement type="package" version="1.2.3.1">mugsy</requirement>
+  </requirements>
+  <command interpreter="python">
+    mugsy.py -r $reference -c $contigs -l $logfile --ml $mugsylog --maf $maffile
+  </command>
+
+  <inputs>
+    <param name="reference" type="data" format="fasta" label="Reference" help="FASTA format" />
+    <param name="contigs" type="data" format="fasta" label="Contigs/draft" help="FASTA format" />
+  </inputs>
+  <outputs>
+    <data name="logfile" format="txt" label="${tool.name} on ${on_string}: log" />
+    <data name="mugsylog" format="txt" label="${tool.name} on ${on_string}: mugsy.log" />
+    <data name="maffile" format="maf" label="${tool.name} on ${on_string}: MAF" />
+  </outputs>
+  <tests>
+
+  </tests>
+  <help>
+**What it does**
+
+Mugsy generates a MAF (multiple alignment format) file containing the multiple alignments from FASTA inputs.
+
+This implementation runs with two files only: reference vs contigs/draft(s). For multiple alignment a single Multi-FASTA file containing all contigs should be provided.
+
+**License and citation**
+
+This Galaxy tool is Copyright © 2012-2013 `CRS4 Srl.`_ and is released under the `MIT license`_.
+
+.. _CRS4 Srl.: http://www.crs4.it/
+.. _MIT license: http://opensource.org/licenses/MIT
+
+If you use this tool in Galaxy, please cite the website http://orione.crs4.it/
+
+This tool uses `Mugsy`_, which is licensed separately. Please cite |Angiuoli2010|_.
+
+.. _Mugsy: http://mugsy.sourceforge.net/
+.. |Angiuoli2010| replace:: Angiuoli, S. V., Salzberg S. L. (2010) Mugsy: Fast multiple alignment of closely related whole genomes. *Bioinformatics* 27(3), 334-342
+.. _Angiuoli2010: http://bioinformatics.oxfordjournals.org/content/27/3/334
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Fri Sep 06 05:58:59 2013 -0400
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="boost" version="1.53.0">
+    <repository changeset_revision="dbdde1a2d0c5" name="package_boost_1_53" owner="iuc" prior_installation_required="True" toolshed="http://toolshed.g2.bx.psu.edu" />
+  </package>
+  <package name="mugsy" version="1.2.3.1">
+    <install version="1.0">
+      <actions>
+        <!-- checkout from svn source repository into a directory with the same name of the package, which will be automatically used as working directory -->
+        <action type="shell_command">svn checkout http://svn.code.sf.net/p/mugsy/code/ mugsy</action>
+        <!-- fix for Boost >= 1.42.0 -->
+        <action type="shell_command">sed -i 's/boost\/property_map\.hpp/boost\/property_map\/property_map.hpp/' trunk/chaining/synchain-mugsy.cpp</action>
+        <!-- fix for Boost >= 1.47.0 -->
+        <action type="shell_command">sed -i 's/boost\/graph\/kolmogorov_max_flow\.hpp/boost\/graph\/boykov_kolmogorov_max_flow.hpp/' trunk/chaining/synchain-mugsy.cpp trunk/mugsy-seqan/projects/library/apps/mugsy/mugsy.cpp</action>
+        <!-- fix chaining Makefile -->
+        <action type="shell_command">sed -i -e 's/-static//g' -e 's/-lbgl-viz -lboost_graph-gcc41-mt//g' trunk/chaining/Makefile</action>
+        <!-- fix missing include in show-diff.cc -->
+        <action type="shell_command">sed -i '13 a \#include &lt;algorithm&gt;' trunk/MUMmer3.20/src/tigr/show-diff.cc</action>
+        <!-- skip make of streeproto.h since it would fail because of missing skproto.x -->
+        <action type="shell_command">touch trunk/MUMmer3.20/src/kurtz/streesrc/streeproto.h</action>
+        <!-- fix Makefile -->
+        <action type="shell_command">sed -i -e 's/install synchain-mugsy/install chaining\/synchain-mugsy/' -e 's/install mugsyWGA \(.*\)/install mugsy-seqan\/projects\/library\/apps\/mugsy\/gcc\/mugsy \1\/mugsyWGA/' trunk/Makefile</action>
+        <!-- fix MUMmer3.20 Makefile -->
+        <action type="shell_command">sed -i '/DOC_DIR/d' trunk/MUMmer3.20/Makefile</action>
+        <!-- populate the environment variables from the dependent repos -->
+        <action type="set_environment_for_install">
+          <repository name="package_boost_1_53" owner="bgruening" toolshed="http://toolshed.g2.bx.psu.edu">
+            <package name="boost" version="1.53.0" />
+          </repository>
+        </action>
+        <!-- use $BOOST_ROOT_DIR in chaining Makefile -->
+        <action type="shell_command">sed -i -e 's/-I \/usr\/local\/projects\/angiuoli\/boost\/include\/boost-1_38/-I $(BOOST_ROOT_DIR)\/include/g' -e 's/-L \/usr\/local\/projects\/angiuoli\/boost\/lib\//-L $(BOOST_ROOT_DIR)\/lib/g' trunk/chaining/Makefile trunk/mugsy-seqan/platforms/gcc/platform.mak</action>
+        <!-- equivalent of make clean -->
+        <action type="shell_command">rm -f trunk/chaining/synchain-mugsy trunk/mugsyWGA trunk/synchain-mugsy &amp;&amp; make -C trunk/MUMmer3.20 clean</action>
+        <action type="shell_command">make -C trunk all</action>
+        <action type="shell_command">make -C trunk install</action>
+        <action type="move_directory_files">
+          <source_directory>trunk/mugsy_x86-64-v1r2.3.1</source_directory>
+          <destination_directory>$INSTALL_DIR</destination_directory>
+        </action>
+        <action type="set_environment">
+          <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR</environment_variable>
+        </action>
+        <action type="set_environment">
+          <environment_variable action="set_to" name="MUGSY_INSTALL">$INSTALL_DIR</environment_variable>
+        </action>
+      </actions>
+    </install>
+    <readme>
+    </readme>
+  </package>
+</tool_dependency>