allpy
annotate utils/pool @ 888:53800c7e3458
add test for secondary structure markup for sequence
Module protein_pdb was copied from blocks3d/protein_pdb.py.
Sequence is created from string, pdb is loaded, ss-markup is applied.
Then secondary structure is checked to be entirely alpha-helix.
see #120
author | Boris Nagaev <bnagaev@gmail.com> |
---|---|
date | Sun, 18 Sep 2011 15:11:49 +0400 |
parents | |
children |
rev | line source |
---|---|
dendik@799 | 1 #!/usr/bin/python |
dendik@799 | 2 import subprocess |
dendik@799 | 3 import os |
dendik@799 | 4 import shlex |
dendik@799 | 5 import optparse |
dendik@799 | 6 |
dendik@799 | 7 p = optparse.OptionParser() |
dendik@799 | 8 p.add_option('-n', '--size', type=int, help='Pool size') |
dendik@799 | 9 p.add_option('-c', '--cmd', |
dendik@799 | 10 help='Command template. Insert {} for argument.' |
dendik@799 | 11 ' Put the argument in double quotes if it may contain spaces.') |
dendik@799 | 12 options, args = p.parse_args() |
dendik@799 | 13 |
dendik@799 | 14 spawned = 0 |
dendik@799 | 15 for arg in args: |
dendik@799 | 16 if spawned > options.size: |
dendik@799 | 17 os.wait() |
dendik@799 | 18 spawned -= 1 |
dendik@799 | 19 cmd = shlex.split(options.cmd.replace('{}', arg)) |
dendik@799 | 20 subprocess.Popen(cmd) |
dendik@799 | 21 spawned += 1 |
dendik@799 | 22 |
dendik@799 | 23 try: |
dendik@799 | 24 while True: |
dendik@799 | 25 os.wait() |
dendik@799 | 26 except Exception: |
dendik@799 | 27 pass |
dendik@799 | 28 |
dendik@799 | 29 # vim: set ts=4 sts=4 et sw=4: |