changeset 24:b942dfd80819 draft

Uploaded
author bgruening
date Tue, 15 Oct 2013 04:19:33 -0400
parents d26e8aa37ce9
children 99435bb90725
files antismash.xml src/genecluster_sequence/__init__.py tool_dependencies.xml
diffstat 3 files changed, 56 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/antismash.xml	Mon Oct 14 04:36:52 2013 -0400
+++ b/antismash.xml	Tue Oct 15 04:19:33 2013 -0400
@@ -41,7 +41,6 @@
             --disable-embl
             --outputfolder $outputfolder
 
-
             #echo 'input_tempfile.' + $file_extension#
 
             ## leave out the start and end features, it can be easily replaced with Galaxy tools
@@ -53,16 +52,16 @@
         
         ## html output
         #if 'html' in str($outputs).split(','):
-            cp #echo os.path.join($outputfolder, 'index.html')# $html;
+            cp #echo os.path.join($outputfolder, 'index.html')# $html 2>/dev/null;
         #end if
         
         ## gene clusters
         #if 'geneclusterprots_tabular' in str($outputs).split(','):
-            cp #echo os.path.join($outputfolder, 'geneclusters.txt')# $geneclusterprots_tabular;
+            cp #echo os.path.join($outputfolder, 'geneclusters.txt')# $geneclusterprots_tabular 2>/dev/null;
         #end if
 
         #if 'geneclusterprots_fasta' in str($outputs).split(','):
-            cp #echo os.path.join($outputfolder, '*_genecluster_proteins.fa')# $geneclusterprots_fasta;
+            cp #echo os.path.join($outputfolder, '*_genecluster_proteins.fa')# $geneclusterprots_fasta 2>/dev/null;
         #end if
 
 
@@ -70,7 +69,7 @@
         #if 'archive_svgs' in str($outputs).split(','):
             cd #echo os.path.join($outputfolder, 'svg')#;
             #if $clusterblast:
-                tar cfz $archive_svgs *_all.svg genecluster*;
+                tar cfz $archive_svgs *_all.svg genecluster* 2>/dev/null;
             #else:
                 tar cfz $archive_svgs genecluster*;
             #end if
@@ -79,12 +78,12 @@
         ##all files in a archive
         #if 'archive' in str($outputs).split(','):
             cd $outputfolder;
-            tar cf $archive *.zip;
+            tar cf $archive *.zip 2>/dev/null;
         #end if
 
         ## genbank
         #if 'gb' in str($outputs).split(','):
-            cat #echo os.path.join($outputfolder, '*.gbk')# > $genbank;
+            cat #echo os.path.join($outputfolder, '*.gbk')# > $genbank 2>/dev/null;
         #end if
 
     </command>
--- a/src/genecluster_sequence/__init__.py	Mon Oct 14 04:36:52 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-
-"""
-    antiSMASH 2.0 output plugin to write all cluster proteins to a file (*_genecluster_proteins.fa)
-"""
-import logging
-from os import path
-from antismash import utils
-
-name = "genecluster_proteins"
-short_description = "Ouptut gene clusters as FASTA sequences"
-# Output plugins are sorted by priority, lower numbers get run first
-priority = 9
-
-def write(seq_records, options):
-    """Write all cluster proteins to a file
-
-    Args:
-        seq_records (iterable): An iterable containing Bio.SeqRecords
-        options (argparse.Namespace): The options passed to the program
-    """
-    basename = seq_records[0].id
-    output_name = path.join(options.outputfoldername, "%s_genecluster_proteins.fa" % basename)
-    logging.debug("Writing seq_records to %r" % output_name)
-
-    with open(output_name, 'w+') as handle:
-        for seq_record in seq_records:
-            clusters = utils.get_cluster_features(seq_record)
-            for cluster in clusters:
-                clustertype = utils.get_cluster_type(cluster)
-                clusternr = utils.get_cluster_number(cluster)
-                for feature in utils.get_cluster_cds_features(cluster, seq_record):
-                    qual = feature.qualifiers
-                    fasta_header = '>%s:%s %s #%s - %s\n' % (qual['locus_tag'][0], qual['protein_id'][0], clustertype, clusternr, qual['product'][0])
-                    handle.write( fasta_header )
-                    handle.write( '%s\n' % qual['translation'][0] )
-
-
--- a/tool_dependencies.xml	Mon Oct 14 04:36:52 2013 -0400
+++ b/tool_dependencies.xml	Tue Oct 15 04:19:33 2013 -0400
@@ -13,7 +13,6 @@
         <repository changeset_revision="ac9cc2992b69" name="package_biopython_1_62" owner="biopython" toolshed="http://testtoolshed.g2.bx.psu.edu" />
     </package>
 
-
     <package name="helperlibs" version="0.1.2">
         <install version="1.0">
             <actions>
@@ -84,7 +83,8 @@
     <package name="antismash" version="2.0.2">
         <install version="1.0">
            <actions_group>
-                <!-- Download the binaries for MUSCLE compatible with 64-bit OSX. -->
+
+                <!-- Download the binaries for antiSMASH compatible with 64-bit OSX. -->
                 <actions architecture="x86_64" os="darwin">
                     <action type="download_by_url">https://bitbucket.org/antismash/antismash2/downloads/antiSMASH2.0.2_macosx.zip</action>
                     <action type="move_directory_files">
@@ -94,6 +94,43 @@
                     <action type="chmod">
                         <file mode="750">$INSTALL_DIR/run_antismash.py</file>
                     </action>
+                    <!-- As last step we created an additional output plugin, that generates protein FASTA files from all clusters and
+                        we need to copy this plugin into the correct location.
+                    -->
+                    <action type="download_file">https://raw.github.com/bgruening/galaxytools/master/antismash/src/genecluster_sequence/__init__.py</action>
+                    <action type="make_directory">$INSTALL_DIR/antismash/output_modules/genecluster_sequence/</action>
+                    <action type="move_file">
+                        <source>__init__.py</source>
+                        <destination>$INSTALL_DIR/antismash/output_modules/genecluster_sequence/</destination>
+                    </action>
+                    <!-- AntiSmash has a prerequirement check that is not useful for us, because we
+                        do not offer the option for genprediction and do not install glimmer and Co.
+                        For that reason deactivate the check.
+                    -->
+                    <action type="shell_command">sed -i 's/check_prereqs(plugins, options) &gt; 0/False/g' $INSTALL_DIR/run_antismash.py</action>
+                    <action type="download_file">https://bitbucket.org/antismash/antismash2/downloads/clusterblast.tar.gz</action>
+                    <action type="shell_command">tar xfvz clusterblast.tar.gz -C $INSTALL_DIR/antismash/generic_modules/clusterblast</action>n&gt;
+                </actions>
+
+                <!-- Download the binaries for antiSMASH compatible with 64-bit OSX. -->
+                <actions architecture="i386" os="darwin">
+                    <action type="download_by_url">https://bitbucket.org/antismash/antismash2/downloads/antiSMASH2.0.2_macosx.zip</action>
+                    <action type="move_directory_files">
+                        <source_directory>.</source_directory>
+                        <destination_directory>$INSTALL_DIR</destination_directory>
+                    </action>
+                    <action type="chmod">
+                        <file mode="750">$INSTALL_DIR/run_antismash.py</file>
+                    </action>
+                    <!-- As last step we created an additional output plugin, that generates protein FASTA files from all clusters and
+                        we need to copy this plugin into the correct location.
+                    -->
+                    <action type="download_file">https://raw.github.com/bgruening/galaxytools/master/antismash/src/genecluster_sequence/__init__.py</action>
+                    <action type="make_directory">$INSTALL_DIR/antismash/output_modules/genecluster_sequence/</action>
+                    <action type="move_file">
+                        <source>__init__.py</source>
+                        <destination>$INSTALL_DIR/antismash/output_modules/genecluster_sequence/</destination>
+                    </action>
                     <!-- AntiSmash has a prerequirement check that is not useful for us, because we
                         do not offer the option for genprediction and do not install glimmer and Co.
                         For that reason deactivate the check.
@@ -102,24 +139,7 @@
                     <action type="download_file">https://bitbucket.org/antismash/antismash2/downloads/clusterblast.tar.gz</action>
                     <action type="shell_command">tar xfvz clusterblast.tar.gz -C $INSTALL_DIR/antismash/generic_modules/clusterblast</action>
                 </actions>
-                <!-- Download the binaries for MUSCLE compatible with 64-bit OSX. -->
-                <actions architecture="i386" os="darwin">
-                    <action type="download_by_url">https://bitbucket.org/antismash/antismash2/downloads/antiSMASH2.0.2_macosx.zip</action>
-                    <action type="move_directory_files">
-                        <source_directory>.</source_directory>
-                        <destination_directory>$INSTALL_DIR</destination_directory>
-                    </action>
-                    <action type="chmod">
-                        <file mode="750">$INSTALL_DIR/run_antismash.py</file>
-                    </action>
-                    <!-- AntiSmash has a prerequirement check that is not useful for us, because we
-                        do not offer the option for genprediction and do not install glimmer and Co.
-                        For that reason deactivate the check.
-                    -->
-                    <action type="shell_command">sed -i 's/check_prereqs(plugins, options) &gt; 0/False/g' $INSTALL_DIR/run_antismash.py</action>
-                    <action type="download_file">https://bitbucket.org/antismash/antismash2/downloads/clusterblast.tar.gz</action>
-                    <action type="shell_command">tar xfvz clusterblast.tar.gz -C $INSTALL_DIR/antismash/generic_modules/clusterblast</action>
-                </actions>
+
                 <!-- Download the binaries for AntiSmash compatible with 64-bit Linux. -->
                 <actions architecture="x86_64" os="linux">
                     <action target_filename="antismash-2.0.2.tar.bz2" type="download_by_url">https://bitbucket.org/antismash/antismash2/downloads/antismash-2.0.2.x86_64.tar.bz2</action>
@@ -147,6 +167,7 @@
                     <action type="download_file">https://bitbucket.org/antismash/antismash2/downloads/clusterblast.tar.gz</action>
                     <action type="shell_command">tar xfvz clusterblast.tar.gz -C $INSTALL_DIR/antismash/generic_modules/clusterblast</action>
                 </actions>
+
                 <!-- Download the binaries for AntiSmash compatible with 32-bit Linux. -->
                 <actions architecture="i386" os="linux">
                     <action type="download_by_url">https://bitbucket.org/antismash/antismash2/downloads/antismash-2.0.2.i686.tar.bz2</action>
@@ -157,6 +178,15 @@
                     <action type="chmod">
                         <file mode="750">$INSTALL_DIR/run_antismash.py</file>
                     </action>
+                    <!-- As last step we created an additional output plugin, that generates protein FASTA files from all clusters and
+                        we need to copy this plugin into the correct location.
+                    -->
+                    <action type="download_file">https://raw.github.com/bgruening/galaxytools/master/antismash/src/genecluster_sequence/__init__.py</action>
+                    <action type="make_directory">$INSTALL_DIR/antismash/output_modules/genecluster_sequence/</action>
+                    <action type="move_file">
+                        <source>__init__.py</source>
+                        <destination>$INSTALL_DIR/antismash/output_modules/genecluster_sequence/</destination>
+                    </action>
                     <!-- AntiSmash has a prerequirement check that is not useful for us, because we
                         do not offer the option for genprediction and do not install glimmer and Co.
                         For that reason deactivate the check.