3 __doc__ =
"Add RMSD to reference to each fitting file."
6 from optparse
import OptionParser
9 usage =
"""%prog [options] <asmb.input> <proteomics> <mapping> <align param>
11 Given a set of local fits (e.g. generated by fit_fft), the RMSD between each
12 subunit and a reference orientation is calculated and added to each fitting
13 file, in the final "RMSD to reference" column. (The original fitting file is
14 not modified; a new fitting file is created with a '.RMSD' extension.)
16 Note that the assembly input file must contain a reference PDB filename for
17 each subunit (in the rightmost column).
20 parser.add_option(
"-d", action=
"store_true", dest=
"use_dock",
21 help=
"if set the docking transformation is used (and not the fitting transformation)")
22 (options, args) = parser.parse_args()
24 parser.error(
"incorrect number of arguments")
27 def run(asmb_fn,proteomics_fn,mapping_fn,params_fn,dock_trans):
33 alignment_params = IMP.multifit.AlignmentParams(params_fn)
34 align=IMP.multifit.ProteomicsEMAlignmentAtomic(mapping_data,asmb,alignment_params)
35 ensmb=IMP.multifit.Ensemble(asmb,mapping_data)
39 mhs=align.get_molecules()
41 for i,mh
in enumerate(mhs):
42 fits_fn=asmb.get_component_header(i).get_transformations_fn()
44 print "calculating rmsd for",len(fits),
"fits of protein",mh.get_name()
47 rb=IMP.atom.setup_as_rigid_body(mh_ref)
50 for i,rec
in enumerate(fits):
51 fit_t=rec.get_fit_transformation()
53 fit_t=rec.get_dock_transformation()
56 rec.set_rmsd_to_reference(rmsd)
62 options,args = parse_args()
63 run(args[0],args[1],args[2],args[3],options.use_dock)
65 if __name__==
"__main__":