IMP logo
IMP Reference Guide  2.8.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 OptionParser
7 
8 
9 def parse_args():
10  usage = """%prog [options] <parameter file> <transformations file>
11  <reference PDB>
12 
13 This program calculates the RMSD between modeled cyclic symmetric complexes and
14 the reference structure. The RMSD and cross correlation of each complex is
15 written into a file called rmsd.output.
16 
17 Notice: no structural alignment is performed!"""
18 
19  parser = OptionParser(usage)
20  parser.add_option("--vec", dest="vec", default="", metavar="FILE",
21  help="output the RMSDs as a vector into the named "
22  "file, if specified")
23  parser.add_option("--start", dest="start", default=0, type="int",
24  help="first model in transformations file to compare "
25  "with the reference (by default, model 0)")
26  parser.add_option("--end", dest="end", default=-1, type="int",
27  help="last model in transformations file to compare "
28  "with the reference (by default, the final model)")
29  (options, args) = parser.parse_args()
30  if len(args) != 3:
31  parser.error("incorrect number of arguments")
32  return options, args
33 
34 
35 def main():
36  opts, args = parse_args()
37  IMP.set_log_level(IMP.WARNING)
38  rmsds = IMP.cnmultifit.get_rmsd_for_models(args[0], args[1], args[2],
39  opts.start, opts.end)
40  if opts.vec:
41  open(opts.vec, 'w').write(" ".join(['%f' % x for x in rmsds]))
42 
43 if __name__ == '__main__':
44  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.