IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
rmsd.py
1 #!/usr/bin/env python
2 
3 __doc__ = "Calculate RMSD between a model and the reference."
4 
5 import IMP.cnmultifit
6 from IMP import ArgumentParser
7 
8 
9 def parse_args():
10  desc = """
11 This program calculates the RMSD between modeled cyclic symmetric complexes and
12 the reference structure. The RMSD and cross correlation of each complex is
13 written into a file called rmsd.output.
14 
15 Notice: no structural alignment is performed!"""
16 
17  p = ArgumentParser(description=desc)
18  p.add_argument("--vec", dest="vec", default="", metavar="FILE",
19  help="output the RMSDs as a vector into the named "
20  "file, if specified")
21  p.add_argument("--start", dest="start", default=0, type=int,
22  help="first model in transformations file to compare "
23  "with the reference (by default, model 0)")
24  p.add_argument("--end", dest="end", default=-1, type=int,
25  help="last model in transformations file to compare "
26  "with the reference (by default, the final model)")
27  p.add_argument("param_file", help="parameter file name")
28  p.add_argument("trans_file", help="transformations file name")
29  p.add_argument("ref_pdb", help="reference PDB file name")
30 
31  return p.parse_args()
32 
33 
34 def main():
35  IMP.set_log_level(IMP.WARNING)
36  args = parse_args()
37  rmsds = IMP.cnmultifit.get_rmsd_for_models(args.param_file,
38  args.trans_file, args.ref_pdb,
39  args.start, args.end)
40  if args.vec:
41  open(args.vec, 'w').write(" ".join(['%f' % x for x in rmsds]))
42 
43 
44 if __name__ == '__main__':
45  main()
Floats get_rmsd_for_models(const std::string param_filename, const std::string trans_filename, const std::string ref_filename, int start_model=0, int end_model=-1)
Generate cyclic atomic structures using cryo-electron microscopy data.
void set_log_level(LogLevel l)
Set the current global log level.