annotate rgWebLogo3.py @ 3:13045f6015cb draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
author iuc
date Fri, 17 Nov 2017 09:38:19 -0500
parents ced02f5334a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
1 # modified june 2 ross lazarus to add units option at Assaf Gordon's suggestion
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
2 # rgWebLogo3.py
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
3 # wrapper to check that all fasta files are same length
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
4
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
5 from __future__ import print_function
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
6
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
7 import optparse
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
8 import os
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
9 import subprocess
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
10 import sys
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
11 import tempfile
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
12
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
13 WEBLOGO = 'weblogo' # executable name for weblogo3 - confusing isn't it?
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
14
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
15
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
16 class WL3:
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
17 """
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
18 simple wrapper class to check fasta sequence lengths are all identical
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
19 """
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
20 FASTASTARTSYM = '>'
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
21 badseq = '## error - sequences in file %s are not all the same length - cannot proceed. Please read the tool documentation carefully'
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
22
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
23 def __init__(self, opts=None):
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
24 assert opts is not None, 'WL3 class needs opts passed in - got None'
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
25 self.opts = opts
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
26 self.fastaf = open(self.opts.input, 'r')
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
27 self.clparams = {}
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
28
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
29 def whereis(self, program):
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
30 for path in os.environ.get('PATH', '').split(':'):
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
31 if os.path.exists(os.path.join(path, program)) and not os.path.isdir(os.path.join(path, program)):
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
32 return os.path.join(path, program)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
33 return None
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
34
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
35 def runCL(self):
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
36 """ construct and run a command line
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
37 """
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
38 wl = self.whereis(WEBLOGO)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
39 if not wl:
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
40 print('## rgWebLogo3.py error - cannot locate the weblogo binary %s on the current path' % (WEBLOGO), file=sys.stderr)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
41 print('## Please ensure it is installed and working from https://github.com/weblogo/weblogo', file=sys.stderr)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
42 sys.exit(1)
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
43 cll = [WEBLOGO, ]
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
44 cll += [' '.join(it) for it in list(self.clparams.items())]
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
45 cl = ' '.join(cll)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
46 assert cl > '', 'runCL needs a command line as clparms'
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
47 fd, templog = tempfile.mkstemp(suffix='rgtempRun.txt')
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
48 tlf = open(templog, 'w')
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
49 process = subprocess.Popen(cl, shell=True, stderr=tlf, stdout=tlf)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
50 rval = process.wait()
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
51 tlf.close()
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
52 tlogs = ''.join(open(templog, 'r').readlines())
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
53 if len(tlogs) > 1:
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
54 s = '## executing %s returned status %d and log (stdout/stderr) records: \n%s\n' % (cl, rval, tlogs)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
55 else:
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
56 s = '## executing %s returned status %d. Nothing appeared on stderr/stdout\n' % (cl, rval)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
57 os.unlink(templog) # always
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
58 if rval != 0:
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
59 print('## rgWebLogo3.py error - executing %s returned error code %d' % (cl, rval), file=sys.stderr)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
60 print('## This may be a data problem or a tool dependency (%s) installation problem' % WEBLOGO, file=sys.stderr)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
61 print('## Please ensure %s is correctly installed and working on the command line -see https://github.com/weblogo/weblogo' % WEBLOGO, file=sys.stderr)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
62 sys.exit(1)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
63 return s
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
64
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
65 def iter_fasta(self):
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
66 """
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
67 generator for fasta sequences from a file
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
68 """
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
69 aseq = []
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
70 seqname = None
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
71 for i, row in enumerate(self.fastaf):
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
72 if row.startswith(self.FASTASTARTSYM):
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
73 if seqname is not None: # already in a sequence
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
74 s = ''.join(aseq)
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
75 ls = len(s)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
76 yield (seqname, ls)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
77 seqname = row[1:].strip()
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
78 aseq = []
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
79 else:
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
80 if i > 0:
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
81 print('Invalid fasta file %s - does not start with %s - please read the tool documentation carefully' % (self.opts.input, self.FASTASTARTSYM), file=sys.stderr)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
82 sys.exit(1)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
83 else:
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
84 seqname = row[1:].strip()
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
85 else: # sequence row
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
86 if seqname is None:
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
87 print('Invalid fasta file %s - does not start with %s - please read the tool documentation carefully' % (self.opts.input, self.FASTASTARTSYM), file=sys.stderr)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
88 sys.exit(1)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
89 else:
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
90 aseq.append(row.strip())
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
91
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
92 if seqname is not None: # last one
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
93 las = len(''.join(aseq))
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
94 yield (seqname, las)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
95
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
96 def fcheck(self):
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
97 """ are all fasta sequence same length?
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
98 might be mongo big
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
99 """
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
100 flen = None
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
101 lasti = None
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
102 f = self.iter_fasta()
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
103 for i, (seqname, seqlen) in enumerate(f):
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
104 lasti = i
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
105 if i == 0:
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
106 flen = seqlen
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
107 else:
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
108 if seqlen != flen:
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
109 print(self.badseq % self.opts.input, file=sys.stderr)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
110 sys.exit(1)
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
111 return '# weblogo input %s has %d sequences all of length %d' % (self.opts.input, lasti + 1, flen)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
112
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
113 def run(self):
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
114 check = self.fcheck()
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
115 self.clparams['-f'] = self.opts.input
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
116 self.clparams['-o'] = self.opts.output
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
117 self.clparams['-t'] = '"%s"' % self.opts.logoname # must be wrapped as a string
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
118 self.clparams['-F'] = self.opts.outformat
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
119 if self.opts.size is not None:
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
120 self.clparams['-s'] = self.opts.size
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
121 if self.opts.lower is not None:
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
122 self.clparams['-l'] = self.opts.lower
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
123 if self.opts.upper is not None:
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
124 self.clparams['-u'] = self.opts.upper
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
125 if self.opts.colours is not None:
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
126 self.clparams['-c'] = self.opts.colours
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
127 if self.opts.units is not None:
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
128 self.clparams['-U'] = self.opts.units
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
129 s = self.runCL()
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
130 return check, s
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
131
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
132
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
133 if __name__ == '__main__':
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
134 op = optparse.OptionParser()
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
135 op.add_option('-i', '--input', default=None)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
136 op.add_option('-F', '--outformat', default='png')
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
137 op.add_option('-s', '--size', default=None)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
138 op.add_option('-o', '--output', default='rgWebLogo3')
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
139 op.add_option('-t', '--logoname', default='rgWebLogo3')
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
140 op.add_option('-c', '--colours', default=None)
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
141 op.add_option('-l', '--lower', default=None)
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
142 op.add_option('-u', '--upper', default=None)
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
143 op.add_option('-U', '--units', default=None)
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
144 opts, args = op.parse_args()
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
145 assert opts.input is not None, 'weblogo3 needs a -i parameter with a fasta input file - cannot open'
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
146 assert os.path.isfile(opts.input), 'weblogo3 needs a valid fasta input file - cannot open %s' % opts.input
0
f64b81fda062 Imported from capsule None
devteam
parents:
diff changeset
147 w = WL3(opts)
3
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
148 checks, s = w.run()
13045f6015cb planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weblogo3 commit d0f167e74e705788adcd9c846db011aee490074b
iuc
parents: 2
diff changeset
149 print(checks, file=sys.stdout) # for info