3 __doc__ =
"Generate complete models from Chimera transformations file."
8 from optparse
import OptionParser
11 usage =
"""%prog [options] <subunit> <symmetry degree>
12 <transformations file> <number of models> <output models>
14 This script, given the structure of a single subunit and the Chimera
15 transformations file, applies the transformations to generate a number of
18 <subunit> subunit PDB, the same given to MultiFit.
19 <symmetry degree> Cn degree.
20 <transformations file> MultiFit output in chimera output format.
21 <number of models> number of models to print.
22 <output models> Solutions are written as output.i.pdb."""
24 opts, args = parser.parse_args()
26 parser.error(
"incorrect number of arguments")
29 def get_transformations(sol):
30 [ind,dock_rot_s,dock_trans_s,fit_rot_s,fit_trans_s,cc_s]=sol.split(
"|")
31 s=dock_rot_s.split(
" ")
32 s1=dock_trans_s.split(
" ")
35 float(s[0]),float(s[1]),float(s[2]),
36 float(s[3]),float(s[4]),float(s[5]),
37 float(s[6]),float(s[7]),float(s[8])),
39 s=fit_rot_s.split(
" ")
40 s1=fit_trans_s.split(
" ")
43 float(s[0]),float(s[1]),float(s[2]),
44 float(s[3]),float(s[4]),float(s[5]),
45 float(s[6]),float(s[7]),float(s[8])),
49 def run(subunit_fn,symm_deg,sol_fn,num,output_fn):
52 for i
in range(symm_deg):
55 IMP.atom.setup_as_rigid_body(mh)
56 lines=open(sol_fn).readlines()
57 for j,sol
in enumerate(lines[:num]):
58 dock_t,fit_t=get_transformations(sol)
60 for i
in range(symm_deg):
63 for i
in range(symm_deg):
69 run(args[0],int(args[1]),args[2],int(args[3]),args[4])
71 if __name__ ==
"__main__":