# HG changeset patch
# User bgruening
# Date 1381735571 14400
# Node ID 225d40beff1a66776fc03e8a90013ec048eb73ee
# Parent 93b2baa4b9d67112a40aa4c581f945bd93c11442
Uploaded
diff -r 93b2baa4b9d6 -r 225d40beff1a antismash.xml
--- a/antismash.xml Sat Oct 12 09:18:04 2013 -0400
+++ b/antismash.xml Mon Oct 14 03:26:11 2013 -0400
@@ -13,8 +13,12 @@
#import os, glob
- #set $outputfolder = os.path.join($html.files_path, 'antismash')
- ln -s $infile #echo 'input_tempfile.' + $infile.ext#;
+ #set $outputfolder = $html.files_path
+ #if $infile.ext == 'genbank':
+ #set $file_extension = 'gb'
+ #end if
+
+ ln -s $infile #echo 'input_tempfile.' + $file_extension#;
mkdir -p $outputfolder;
run_antismash.py
--cpus 4
@@ -35,7 +39,7 @@
--outputfolder $outputfolder
- #echo 'input_tempfile.' + $infile.ext#
+ #echo 'input_tempfile.' + $file_extension#
## leave out the start and end features, it can be easily replaced with Galaxy tools
##--from START Start analysis at nucleotide specified
@@ -51,13 +55,22 @@
## gene clusters
#if 'geneclusterprots_tabular' in str($outputs).split(','):
- cp #echo os.path.join($outputfolder, 'geneclusters.txt')# $geneclusterprots;
+ cp #echo os.path.join($outputfolder, 'geneclusters.txt')# $geneclusterprots_tabular;
#end if
+ #if 'geneclusterprots_fasta' in str($outputs).split(','):
+ cp #echo os.path.join($outputfolder, '*_genecluster_proteins.fa')# $geneclusterprots_fasta;
+ #end if
+
+
##SVG images
#if 'archive_svgs' in str($outputs).split(','):
cd #echo os.path.join($outputfolder, 'svg')#;
- tar cfz $archive_svgs *_all.svg genecluster*;
+ #if $clusterblast:
+ tar cfz $archive_svgs *_all.svg genecluster*;
+ #else:
+ tar cfz $archive_svgs genecluster*;
+ #end if
#end if
##all files in a archive
@@ -68,24 +81,32 @@
## genbank
#if 'gb' in str($outputs).split(','):
- #for $gb_file in glob.glob( os.path.join($outputfolder, '*.gbk') ):
- cat $gb_file >> $genbank;
- #end for
+ cat #echo os.path.join($outputfolder, '*.gbk')# > $genbank;
#end if
-
+
-
-
+
+
-
-
-
+
+
-
+
@@ -134,16 +155,16 @@
-
+
'geneclusterprots_fasta' in outputs
-
+
'geneclusterprots_tabular' in outputs
-
+
'archive' in outputs
-
+
'archive_svgs' in outputs
@@ -165,8 +186,8 @@
**Input**
-The ideal input for antiSMASH is an annotated nucleotide file in Genbank format or EMBL format. If no annotation is available,
-we recommend running your sequence through an annotation pipeline like RAST are one included in Galaxy.
+The ideal input for antiSMASH is an annotated nucleotide file in Genbank format. If no annotation is available,
+we recommend running your sequence through an annotation pipeline like RAST are the one included in Galaxy.
There are several optional analyses that may or may not be run on your sequence.
diff -r 93b2baa4b9d6 -r 225d40beff1a src/genecluster_sequence/__init__.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/genecluster_sequence/__init__.py Mon Oct 14 03:26:11 2013 -0400
@@ -0,0 +1,38 @@
+#!/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] )
+
+
diff -r 93b2baa4b9d6 -r 225d40beff1a tool_dependencies.xml
--- a/tool_dependencies.xml Sat Oct 12 09:18:04 2013 -0400
+++ b/tool_dependencies.xml Mon Oct 14 03:26:11 2013 -0400
@@ -137,6 +137,13 @@
sed -i 's/check_prereqs(plugins, options) > 0/False/g' $INSTALL_DIR/run_antismash.py
https://bitbucket.org/antismash/antismash2/downloads/clusterblast.tar.gz
tar xfvz clusterblast.tar.gz -C $INSTALL_DIR/antismash/generic_modules/clusterblast
+
+
+ $REPOSITORY_INSTALL_DIR/src/
+ $INSTALL_DIR/antismash/output_modules/
+