annotate inter.py @ 4:4d47ab2b7bcc

Uploaded
author davidmurphy
date Fri, 13 Jan 2012 07:18:19 -0500
parents c55bdc2fb9fa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
1 #!/usr/tmp/bin/python2.7
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
2
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
3
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
4 import weblogolib
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
5 from corebio.utils.deoptparse import DeOptionParser
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
6 import sys
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
7
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
8
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
9 #setup
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
10 def blackboxcodonl(inputf,outputf):
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
11 parser = weblogolib._build_option_parser()
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
12
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
13 (opts, args) = parser.parse_args(['--size', 'large', '--composition', 'none', '--fin',inputf,'--fout', outputf])
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
14
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
15
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
16 if args : parser.error("Unparsable arguments: %s " % args)
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
17 #best not to change anything in the try except block.
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
18 try:
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
19 data = weblogolib._build_logodata(opts)
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
20 format = weblogolib._build_logoformat(data, opts)
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
21 formatter = opts.formatter
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
22 formatter(data, format, opts.fout)
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
23 except ValueError, err :
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
24 print >>sys.stderr, 'Error:', err
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
25 sys.exit(2)
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
26 except KeyboardInterrupt, err:
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
27 sys.exit(0)
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
28
c55bdc2fb9fa Uploaded
davidmurphy
parents:
diff changeset
29 blackboxcodonl('/home/david/examples/cluster17.aln',"outfile.eps")