3 __doc__ =
"Add RMSD to reference to each fitting file."
6 from IMP
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)
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__":
An ensemble of fitting solutions.
SettingsData * read_settings(const char *filename)
GenericHierarchies get_leaves(Hierarchy mhd)
Get all the leaves of the bit of hierarchy.
ProteinsAnchorsSamplingSpace read_protein_anchors_mapping(multifit::ProteomicsData *prots, const std::string &anchors_prot_map_fn, int max_paths=INT_MAX)
Align proteomics graph to EM density map.
double get_rmsd(const Selection &s0, const Selection &s1, const IMP::algebra::Transformation3D &tr_for_second=IMP::algebra::get_identity_transformation_3d())
void transform(XYZ a, const algebra::Transformation3D &tr)
Apply a transformation to the particle.
See IMP.multifit for more information.
void write_fitting_solutions(const char *fitting_fn, const FittingSolutionRecords &fit_sols, int num_sols=-1)
Write fitting solutions to a file.
ProteomicsData * read_proteomics_data(const char *proteomics_fn)
Proteomics reader.
IMP::kernel::OptionParser OptionParser
FittingSolutionRecords read_fitting_solutions(const char *fitting_fn)
Fitting solutions reader.
void read_pdb(base::TextInput input, int model, Hierarchy h)