38 dmap = IMP.em.read_map(
40 dmap.get_header_writable().set_resolution(resolution)
49 sampled_input_density.set_particles(ps)
50 sampled_input_density.resample()
51 sampled_input_density.calcRMS()
55 dmap, sampled_input_density, sampled_input_density.get_header().dmin)
56 print(
"The CC score of the native transformation is:", best_score)
63 IMP.algebra.get_unit_bounding_box_3d())
65 rand_angle = random.uniform(-70. / 180 * math.pi, 70. / 180 * math.pi)
81 sampled_input_density.resample()
82 sampled_input_density.calcRMS()
85 dmap, sampled_input_density, sampled_input_density.get_header().dmin)
87 print(
"The start score is:", start_score,
"with rmsd of:", start_rmsd)
90 print(
"performing local refinement, may run for 3-4 minutes")
98 sampled_input_density.resample()
99 sampled_input_density.calcRMS()
102 dmap, sampled_input_density, sampled_input_density.get_header().dmin)
103 print(
"The score after centering is:", score2,
"with rmsd of:", rmsd)
107 mh.get_particle(), refiner,
113 print(
"The start score is:", start_score,
"with rmsd of:", start_rmsd)
114 for i
in range(fitting_sols.get_number_of_solutions()):
121 print(
"Fit with index:", i,
" with cc: ", 1. - fitting_sols.get_score(i),
122 " and rmsd to native of:", rmsd)
125 prot_rb, fitting_sols.get_transformation(i).get_inverse())
static FloatKey get_mass_key()
Return the hierarchy leaves under a particle.
double get_coarse_cc_coefficient(const DensityMap *grid1, const DensityMap *grid2, double grid2_voxel_data_threshold, bool allow_padding=false, FloatPair norm_factors=FloatPair(0., 0.))
Calculates the cross correlation coefficient between two maps.
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
void add_radii(Hierarchy d, const ForceFieldParameters *ffp=get_all_atom_CHARMM_parameters(), FloatKey radius_key=FloatKey("radius"))
Add vdW radius from given force field.
void write_pdb(const Selection &mhd, TextOutput out, unsigned int model=1)
algebra::Vector3D get_centroid(const XYZs &ps)
Get the centroid.
GenericHierarchies get_leaves(Hierarchy mhd)
Get all the leaves of the bit of hierarchy.
void read_pdb(TextInput input, int model, Hierarchy h)
Vector3D get_random_vector_in(const Cylinder3D &c)
Generate a random vector in a cylinder with uniform density.
Rotation3D get_rotation_about_axis(const Vector3D &axis, double angle)
Generate a Rotation3D object from a rotation around an axis.
Class for storing model, its restraints, constraints, and particles.
Class for sampling a density map from particles.
double get_rmsd(const Selection &s0, const Selection &s1)
void transform(XYZ a, const algebra::Transformation3D &tr)
Apply a transformation to the particle.
Basic utilities for handling cryo-electron microscopy 3D density maps.
static const IMP::core::HierarchyTraits & get_traits()
Get the molecular hierarchy HierarchyTraits.
std::string get_example_path(std::string file_name)
Return the full path to one of this module's example files.
void set_log_level(LogLevel l)
Set the current global log level.
FittingSolutions local_rigid_fitting(Particle *p, Refiner *refiner, const FloatKey &weight_key, DensityMap *dmap, OptimizerStates display_log, Int number_of_optimization_runs=5, Int number_of_mc_steps=10, Int number_of_cg_steps=100, Float max_translation=2., Float max_rotation=.3, bool fast=true)
Local rigid fitting of a rigid body.
Basic functionality that is expected to be used by a wide variety of IMP users.
IMP::core::RigidBody create_rigid_body(Hierarchy h)
Rotation3D get_identity_rotation_3d()
Return a rotation that does not do anything.
VectorD< D > get_random_vector_on(const UnitSimplexD< D > &s)
Generate a random vector on a unit simplex with uniform density.
Select all CA ATOM records.
Functionality for loading, creating, manipulating and scoring atomic structures.
void set_check_level(CheckLevel tf)
Control runtime checks in the code.