annotate tools/ncbi_blast_plus/blast2go.py @ 2:5cb24d07c316 draft

Uploaded v0.0.4 with explicit dependency on 'blast_datatypes' for 'blastxml' format definition. No functional changes.
author peterjc
date Fri, 22 Feb 2013 09:13:27 -0500
parents 7b53cc52e7ed
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
1 #!/usr/bin/env python
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
2 """Galaxy wrapper for Blast2GO for pipelines, b2g4pipe v2.3.5.
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
3
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
4 This script takes exactly three command line arguments:
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
5 * Input BLAST XML filename
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
6 * Blast2GO properties filename (settings file)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
7 * Output tabular filename
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
8
2
5cb24d07c316 Uploaded v0.0.4 with explicit dependency on 'blast_datatypes' for 'blastxml' format definition. No functional changes.
peterjc
parents: 1
diff changeset
9 Sadly b2g4pipe (at least v2.3.5 to v2.5.0) cannot cope with current
5cb24d07c316 Uploaded v0.0.4 with explicit dependency on 'blast_datatypes' for 'blastxml' format definition. No functional changes.
peterjc
parents: 1
diff changeset
10 style large BLAST XML files (e.g. from BLAST 2.2.25+), so we reformat
5cb24d07c316 Uploaded v0.0.4 with explicit dependency on 'blast_datatypes' for 'blastxml' format definition. No functional changes.
peterjc
parents: 1
diff changeset
11 these to avoid it crashing with a Java heap space OutOfMemoryError.
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
12
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
13 As part of this reformatting, we check for BLASTP or BLASTX output
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
14 (otherwise raise an error), and print the query count.
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
15
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
16 It then calls the Java command line tool, and moves the output file to
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
17 the location Galaxy is expecting, and removes the tempory XML file.
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
18 """
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
19 import sys
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
20 import os
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
21 import subprocess
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
22
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
23 #You may need to edit this to match your local setup,
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
24 blast2go_jar = "/opt/b2g4pipe/blast2go.jar"
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
25
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
26
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
27 def stop_err(msg, error_level=1):
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
28 """Print error message to stdout and quit with given error level."""
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
29 sys.stderr.write("%s\n" % msg)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
30 sys.exit(error_level)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
31
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
32 if len(sys.argv) != 4:
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
33 stop_err("Require three arguments: XML filename, properties filename, output tabular filename")
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
34
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
35 xml_file, prop_file, tabular_file = sys.argv[1:]
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
36
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
37 #We should have write access here:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
38 tmp_xml_file = tabular_file + ".tmp.xml"
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
39
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
40 if not os.path.isfile(xml_file):
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
41 stop_err("Input BLAST XML file not found: %s" % xml_file)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
42
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
43 if not os.path.isfile(prop_file):
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
44 stop_err("Blast2GO configuration file not found: %s" % prop_file)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
45
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
46 def prepare_xml(original_xml, mangled_xml):
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
47 """Reformat BLAST XML to suit Blast2GO.
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
48
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
49 Blast2GO can't cope with 1000s of <Iteration> tags within a
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
50 single <BlastResult> tag, so instead split this into one
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
51 full XML record per interation (i.e. per query). This gives
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
52 a concatenated XML file mimicing old versions of BLAST.
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
53
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
54 This also checks for BLASTP or BLASTX output, and outputs
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
55 the number of queries. Galaxy will show this as "info".
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
56 """
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
57 in_handle = open(original_xml)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
58 footer = " </BlastOutput_iterations>\n</BlastOutput>\n"
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
59 header = ""
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
60 while True:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
61 line = in_handle.readline()
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
62 if not line:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
63 #No hits?
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
64 stop_err("Problem with XML file?")
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
65 if line.strip() == "<Iteration>":
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
66 break
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
67 header += line
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
68
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
69 if "<BlastOutput_program>blastx</BlastOutput_program>" in header:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
70 print "BLASTX output identified"
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
71 elif "<BlastOutput_program>blastp</BlastOutput_program>" in header:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
72 print "BLASTP output identified"
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
73 else:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
74 in_handle.close()
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
75 stop_err("Expect BLASTP or BLASTX output")
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
76
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
77 out_handle = open(mangled_xml, "w")
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
78 out_handle.write(header)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
79 out_handle.write(line)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
80 count = 1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
81 while True:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
82 line = in_handle.readline()
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
83 if not line:
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
84 break
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
85 elif line.strip() == "<Iteration>":
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
86 #Insert footer/header
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
87 out_handle.write(footer)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
88 out_handle.write(header)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
89 count += 1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
90 out_handle.write(line)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
91
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
92 out_handle.close()
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
93 in_handle.close()
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
94 print "Input has %i queries" % count
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
95
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
96
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
97 def run(cmd):
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
98 #Avoid using shell=True when we call subprocess to ensure if the Python
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
99 #script is killed, so too is the child process.
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
100 try:
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
101 child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
102 except Exception, err:
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
103 stop_err("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err))
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
104 #Use .communicate as can get deadlocks with .wait(),
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
105 stdout, stderr = child.communicate()
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
106 return_code = child.returncode
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
107 if return_code:
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
108 cmd_str = " ".join(cmd)
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
109 if stderr and stdout:
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
110 stop_err("Return code %i from command:\n%s\n\n%s\n\n%s" % (return_code, cmd_str, stdout, stderr))
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
111 else:
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
112 stop_err("Return code %i from command:\n%s\n%s" % (return_code, cmd_str, stderr))
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
113 #For early diagnostics,
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
114 else:
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
115 print stdout
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
116 print stderr
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
117
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
118 if not os.path.isfile(blast2go_jar):
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
119 stop_err("Blast2GO JAR file not found: %s" % blast2go_jar)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
120
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
121 prepare_xml(xml_file, tmp_xml_file)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
122 #print "XML file prepared for Blast2GO"
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
123
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
124 #We will have write access wherever the output should be,
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
125 #so we'll ask Blast2GO to use that as the stem for its output
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
126 #(it will append .annot to the filename)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
127 cmd = ["java", "-jar", blast2go_jar,
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
128 "-in", tmp_xml_file,
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
129 "-prop", prop_file,
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
130 "-out", tabular_file, #Used as base name for output files
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
131 "-a", # Generate *.annot tabular file
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
132 #"-img", # Generate images, feature not in v2.3.5
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
133 ]
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
134 #print " ".join(cmd)
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
135 run(cmd)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
136
1
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
137 #Remove the temp XML file
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
138 os.remove(tmp_xml_file)
7b53cc52e7ed Migrated tool version 0.0.2 from old tool shed archive to new tool shed repository
peterjc
parents: 0
diff changeset
139
0
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
140 out_file = tabular_file + ".annot"
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
141 if not os.path.isfile(out_file):
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
142 stop_err("ERROR - No output annotation file from Blast2GO")
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
143
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
144 #Move the output file where Galaxy expects it to be:
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
145 os.rename(out_file, tabular_file)
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
146
4bfd64cf18ab Migrated tool version 0.0.1 from old tool shed archive to new tool shed repository
peterjc
parents:
diff changeset
147 print "Done"