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