libcootapi
 
Loading...
Searching...
No Matches
molecules_container_t Class Reference

the container of molecules. The class for all libcootapi functions. More...

#include <molecules-container.hh>

Classes

class  auto_read_mtz_info_t
 class for the information about columns extracted from auto-reading the given mtz file More...
 
class  fit_ligand_info_t
 
class  ltj_stats_t
 
class  r_factor_stats
 

Public Member Functions

 molecules_container_t (bool verbose=true)
 the one and only constructor
 
Generic Utils
std::string get_molecule_name (int imol) const
 
void set_molecule_name (int imol, const std::string &new_name)
 
void display_molecule_names_table () const
 Debugging function: display the table of molecule and names.
 
bool is_valid_model_molecule (int imol) const
 
bool is_valid_map_molecule (int imol_map) const
 
bool is_a_difference_map (int imol_map) const
 
int new_molecule (const std::string &name)
 
int close_molecule (int imol)
 
void end_delete_closed_molecules ()
 
void pop_back ()
 Delete the most recent/last molecule in the molecule vector.
 
void clear ()
 Delete all molecules.
 
std::vector< double > get_eigenvalues (int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
 
coot::simple_mesh_t test_origin_cube () const
 
void fill_rotamer_probability_tables ()
 Fill the rotamer probability tables (currently not ARG and LYS)
 
void accept_rotamer_probability_tables_compressed_data (const std::string &data_stream)
 
Backup and Saving
bool contains_unsaved_models () const
 
void save_unsaved_model_changes ()
 Save the unsaved model - this function has not yet been written!
 
Geometry and Dictionaries
void geometry_init_standard ()
 Read the standard list of residues.
 
std::vector< std::string > non_standard_residue_types_in_model (int imol) const
 
std::string get_rdkit_mol_pickle_base64 (const std::string &residue_name, int imol_enc)
 
Coordinates Modelling
int auto_fit_rotamer (int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf, int imol_map)
 
coot::molecule_t::rotamer_change_info_t change_to_next_rotamer (int imol, const std::string &residue_cid, const std::string &alt_conf)
 
coot::molecule_t::rotamer_change_info_t change_to_previous_rotamer (int imol, const std::string &residue_cid, const std::string &alt_conf)
 
coot::molecule_t::rotamer_change_info_t change_to_first_rotamer (int imol, const std::string &residue_cid, const std::string &alt_conf)
 
int set_residue_to_rotamer_number (int imol, const std::string &residue_cid, const std::string &alt_conf, int rotamer_number)
 
std::pair< int, unsigned int > delete_using_cid (int imol, const std::string &cid, const std::string &scope)
 
std::pair< int, unsigned int > delete_atom (int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &atom_name, const std::string &alt_conf)
 
std::pair< int, unsigned int > delete_atom_using_cid (int imol, const std::string &cid)
 
std::pair< int, unsigned int > delete_residue (int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
 
std::pair< int, unsigned int > delete_residue_using_cid (int imol, const std::string &cid)
 
std::pair< int, unsigned int > delete_residue_atoms_with_alt_conf (int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf)
 
std::pair< int, unsigned int > delete_residue_atoms_using_cid (int imol, const std::string &cid)
 
std::pair< int, unsigned int > delete_side_chain (int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
 
std::pair< int, unsigned int > delete_side_chain_using_cid (int imol, const std::string &cid)
 
std::pair< int, unsigned int > delete_chain_using_cid (int imol, const std::string &cid)
 
std::pair< int, unsigned int > delete_literal_using_cid (int imol, const std::string &cid)
 
bool delete_all_carbohydrate (int imol)
 
int change_alt_locs (int imol, const std::string &cid, const std::string &change_mode)
 
std::pair< int, std::string > add_terminal_residue_directly (int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
 
int add_terminal_residue_directly_using_cid (int imol, const std::string &cid)
 
int add_terminal_residue_directly_using_bucca_ml_growing_using_cid (int imol, const std::string &cid)
 
int add_terminal_residue_directly_using_bucca_ml_growing (int imol, const coot::residue_spec_t &spec)
 
void set_add_waters_water_to_protein_distance_lim_min (float d)
 
void set_add_waters_water_to_protein_distance_lim_max (float d)
 
void set_add_waters_variance_limit (float d)
 
void set_add_waters_sigma_cutoff (float d)
 
int add_waters (int imol_model, int imol_map)
 
int flood (int imol_model, int imol_map, float n_rmsd)
 
int add_hydrogen_atoms (int imol_model)
 
int delete_hydrogen_atoms (int imol_model)
 
int add_alternative_conformation (int imol_model, const std::string &cid)
 
int fill_partial_residue (int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
 
int fill_partial_residue_using_cid (int imol, const std::string &cid)
 
int fill_partial_residues (int imol)
 
void add_named_glyco_tree (int imol_model, int imol_map, const std::string &glycosylation_name, const std::string &asn_chain_id, int asn_res_no)
 
int flip_peptide_using_cid (int imol, const std::string &atom_cid, const std::string &alt_conf)
 
void eigen_flip_ligand (int imol, const std::string &chain_id, int res_no, const std::string &ins_code)
 
void eigen_flip_ligand_using_cid (int imol, const std::string &residue_cid)
 
int mutate (int imol, const std::string &cid, const std::string &new_residue_type)
 
int side_chain_180 (int imol, const std::string &atom_cid)
 
std::string jed_flip (int imol, const std::string &atom_cid, bool invert_selection)
 
int move_molecule_to_new_centre (int imol, float x, float y, float z)
 
void multiply_residue_temperature_factors (int imol, const std::string &cid, float factor)
 
coot::Cartesian get_molecule_centre (int imol) const
 
double get_radius_of_gyration (int imol) const
 
int copy_molecule (int imol)
 
int copy_fragment_using_cid (int imol, const std::string &multi_cid)
 
int copy_fragment_for_refinement_using_cid (int imol, const std::string &multi_cid)
 
int copy_fragment_using_residue_range (int imol, const std::string &chain_id, int res_no_start, int res_no_end)
 
int apply_transformation_to_atom_selection (int imol, const std::string &atoms_selection_cid, int n_atoms, float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22, float c0, float c1, float c2, float t0, float t1, float t2)
 
int new_positions_for_residue_atoms (int imol, const std::string &residue_cid, std::vector< coot::api::moved_atom_t > &moved_atoms)
 
int new_positions_for_atoms_in_residues (int imol, const std::vector< coot::api::moved_residue_t > &moved_residues)
 
std::pair< int, std::vector< merge_molecule_results_info_t > > merge_molecules (int imol, const std::string &list_of_other_molecules)
 
int cis_trans_convert (int imol, const std::string &atom_cid)
 
void replace_residue (int imol, const std::string &residue_cid, const std::string &new_residue_type, int imol_enc)
 
int replace_fragment (int imol_base, int imol_reference, const std::string &atom_selection)
 
int rigid_body_fit (int imol, const std::string &multi_cid, int imol_map)
 
int rotate_around_bond (int imol, const std::string &residue_cid, const std::string &atom_name_1, const std::string &atom_name_2, const std::string &atom_name_3, const std::string &atom_name_4, double torsion_angle)
 
std::pair< int, std::string > change_chain_id (int imol, const std::string &from_chain_id, const std::string &to_chain_id, bool use_resno_range, int start_resno, int end_resno)
 
int split_residue_using_map (int imol, const std::string &residue_cid, int imol_diff_map)
 
void associate_sequence (int imol, const std::string &name_or_chain_id, const std::string &sequence)
 
void assign_sequence (int imol_model, int imol_map)
 
std::vector< std::pair< std::string, std::string > > get_sequence_info (int imol) const
 
coot::chain_mutation_info_container_t get_mutation_info (int imol) const
 
Coordinates Refinement
int refine_residues_using_atom_cid (int imol, const std::string &cid, const std::string &mode, int n_cycles)
 
int refine_residues (int imol, const std::string &chain_id, int res_no, const std::string &ins_code, const std::string &alt_conf, const std::string &mode, int n_cycles)
 
int refine_residue_range (int imol, const std::string &chain_id, int res_no_start, int res_no_end, int n_cycles)
 
std::pair< int, coot::instanced_mesh_tminimize_energy (int imol, const std::string &atom_selection_cid, int n_cycles, bool do_rama_plot_restraints, float rama_plot_weight, bool do_torsion_restraints, float torsion_weight, bool refinement_is_quiet)
 
float minimize (int imol, const std::string &atom_selection_cid, int n_cycles, bool do_rama_plot_restraints, float rama_plot_weight, bool do_torsion_restraints, float torsion_weight, bool refinement_is_quiet)
 
void fix_atom_selection_during_refinement (int imol, const std::string &atom_selection_cid)
 
void add_target_position_restraint (int imol, const std::string &atom_cid, float pos_x, float pos_y, float pos_z)
 
void clear_target_position_restraint (int imol, const std::string &atom_cid)
 
void turn_off_when_close_target_position_restraint (int imol)
 
void set_logging_level (const std::string &level)
 
void set_logging_file (const std::string &file_name)
 
void set_use_rama_plot_restraints (bool state)
 
bool get_use_rama_plot_restraints () const
 
void set_rama_plot_restraints_weight (float f)
 
float get_rama_plot_restraints_weight () const
 
void set_use_torsion_restraints (bool state)
 
bool get_use_torsion_restraints () const
 
void set_torsion_restraints_weight (float f)
 
float get_torsion_restraints_weight () const
 
void init_refinement_of_molecule_as_fragment_based_on_reference (int imol_frag, int imol_ref, int imol_map)
 
std::pair< int, coot::instanced_mesh_trefine (int imol, int n_cycles)
 
coot::instanced_mesh_t add_target_position_restraint_and_refine (int imol, const std::string &atom_cid, float pos_x, float pos_y, float pos_z, int n_cycles)
 
void clear_target_position_restraints (int imol)
 
void clear_refinement (int imol)
 
void set_refinement_is_verbose (bool state)
 
void set_refinement_geman_mcclure_alpha (float a)
 
float get_geman_mcclure_alpha () const
 
int generate_self_restraints (int imol, float local_dist_max)
 
void generate_chain_self_restraints (int imol, float local_dist_max, const std::string &chain_id)
 
void generate_local_self_restraints (int imol, float local_dist_max, const std::string &residue_cids)
 
void add_parallel_plane_restraint (int imol, const std::string &residue_cid_1, const std::string &residue_cid_2)
 
coot::instanced_mesh_t get_extra_restraints_mesh (int imol, int mode)
 
int read_extra_restraints (int imol, const std::string &file_name)
 
void clear_extra_restraints (int imol)
 
int servalcat_refine_xray (int imol, int imol_map, const std::string &output_prefix)
 
int servalcat_refine_xray_with_keywords (int imol, int imol_map, const std::string &output_prefix, const nanobind::dict &key_value_pairs)
 
Coordinates Validation
coot::simple_mesh_t get_rotamer_dodecs (int imol)
 
coot::instanced_mesh_t get_rotamer_dodecs_instanced (int imol)
 
coot::simple_mesh_t get_ramachandran_validation_markup_mesh (int imol) const
 
std::vector< coot::phi_psi_prob_t > ramachandran_validation (int imol) const
 
coot::instanced_mesh_t contact_dots_for_ligand (int imol, const std::string &cid, unsigned int smoothness_factor) const
 
coot::instanced_mesh_t all_molecule_contact_dots (int imol, unsigned int smoothness_factor) const
 
coot::simple::molecule_t get_simple_molecule (int imol, const std::string &residue_cid, bool draw_hydrogen_atoms_flag)
 
generic_3d_lines_bonds_box_t make_exportable_environment_bond_box (int imol, coot::residue_spec_t &spec, float max_dist)
 
std::vector< moorhen::h_bondget_h_bonds (int imol, const std::string &cid_str, bool mcdonald_and_thornton_mode) const
 
coot::simple_mesh_t get_mesh_for_ligand_validation_vs_dictionary (int imol, const std::string &ligand_cid)
 
std::vector< coot::geometry_distortion_info_container_t > get_ligand_validation_vs_dictionary (int imol, const std::string &ligand_cid, bool include_non_bonded_contacts)
 
std::vector< coot::geometry_distortion_info_container_t > get_validation_vs_dictionary_for_selection (int imol, const std::string &selection_cid, bool include_non_bonded_contacts)
 
std::pair< int, double > get_ligand_distortion (int imol, const std::string &ligand_cid, bool include_non_bonded_contacts)
 
bool match_ligand_torsions (int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref)
 
bool match_ligand_position (int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref)
 
bool match_ligand_torsions_and_position (int imol_ligand, int imol_ref, const std::string &chain_id_ref, int resno_ref)
 
bool match_ligand_torsions_and_position_using_cid (int imol_ligand, int imol_ref, const std::string &cid)
 
coot::atom_overlaps_dots_container_t get_overlap_dots (int imol)
 
coot::atom_overlaps_dots_container_t get_overlap_dots_for_ligand (int imol, const std::string &cid_ligand)
 
std::vector< coot::plain_atom_overlap_t > get_atom_overlaps (int imol)
 Get Atom Overlaps.
 
float get_atom_overlap_score (int imol)
 
std::vector< coot::plain_atom_overlap_t > get_overlaps_for_ligand (int imol, const std::string &cid_ligand)
 Gat Atom Overlaps for a ligand or residue.
 
std::vector< positioned_atom_spec_t > get_atom_differences (int imol1, int imol2)
 
std::string get_pucker_analysis_info (int imol) const
 
Coordinates and Map Validation
coot::validation_information_t density_fit_analysis (int imol_model, int imol_map) const
 
double get_sum_density_for_atoms_in_residue (int imol, const std::string &cid, const std::vector< std::string > &atom_names, int imol_map)
 
int get_number_of_atoms_in_residue (int imol, const std::string &residue_cid) const
 
coot::validation_information_t density_correlation_analysis (int imol_model, int imol_map) const
 
coot::validation_information_t rotamer_analysis (int imol_model) const
 
coot::validation_information_t ramachandran_analysis (int imol_model) const
 
coot::validation_information_t ramachandran_analysis_for_chain (int imol_model, const std::string &chain_id) const
 
coot::validation_information_t peptide_omega_analysis (int imol_model) const
 
float get_median_temperature_factor (int imol) const
 
float get_temperature_factor_of_atom (int imol, const std::string &atom_cid) const
 
std::vector< coot::molecule_t::interesting_place_tget_interesting_places (int imol, const std::string &mode) const
 
std::vector< coot::molecule_t::interesting_place_tdifference_map_peaks (int imol_map, int imol_protein, float n_rmsd) const
 
std::vector< coot::molecule_t::interesting_place_tpepflips_using_difference_map (int imol_coords, int imol_difference_map, float n_sigma) const
 
std::vector< coot::molecule_t::interesting_place_tunmodelled_blobs (int imol_model, int imol_map, float rmsd_cut_off) const
 
std::vector< coot::atom_spec_tfind_water_baddies (int imol_model, int imol_map, float b_factor_lim, float outlier_sigma_level, float min_dist, float max_dist, bool ignore_part_occ_contact_flag, bool ignore_zero_occ_flag)
 
coot::instanced_mesh_t get_HOLE (int imol, float start_pos_x, float start_pos_y, float start_pos_z, float end_pos_x, float end_pos_y, float end_pos_z) const
 
std::pair< std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t >, std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t > > get_mmrrcc (int imol, const std::string &chain_id, unsigned int n_residue_per_residue_range, int imol_map) const
 
std::pair< std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t >, std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t > > mmrrcc (int imol, const std::string &chain_id, int imol_map) const
 
std::pair< std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t >, std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t > > mmrrcc_internal (const atom_selection_container_t &asc, const std::string &chain_id, unsigned int n_residue_per_residue_range, const clipper::Xmap< float > &xmap) const
 
std::vector< std::pair< double, double > > fourier_shell_correlation (int imol_map_1, int imol_map_2) const
 
int make_power_scaled_map (int imol_ref, int imol_map_for_scaling)
 
coot::validation_information_t get_q_score (int imol_model, int imol_map) const
 
coot::validation_information_t get_q_score_for_cid (int imol_model, const std::string &cid, int imol_map) const
 
std::pair< float, float > get_mean_and_variance_of_density_for_non_water_atoms (int imol_coords, int imol_map) const
 
float get_spherical_variance (int imol_map, int imol_model, const std::string &atom_cid, float mean_density_other_atoms) const
 
Rail Points!
int calculate_new_rail_points ()
 
int rail_points_total () const
 
Updating Maps
void associate_data_mtz_file_with_map (int imol, const std::string &data_mtz_file_name, const std::string &f_col, const std::string &sigf_col, const std::string &free_r_col)
 
int connect_updating_maps (int imol_model, int imol_with_data_info_attached, int imol_map_2fofc, int imol_map_fofc)
 
void sfcalc_genmap (int imol_model, int imol_map_with_data_attached, int imol_updating_difference_map)
 
coot::util::sfcalc_genmap_stats_t sfcalc_genmaps_using_bulk_solvent (int imol_model, int imol_2fofc_map, int imol_updating_difference_map, int imol_map_with_data_attached)
 
bool shift_field_b_factor_refinement (int imol, int imol_with_data_attached)
 
float get_density_at_position (int imol_map, float x, float y, float z) const
 
std::vector< std::pair< clipper::Coord_orth, float > > get_diff_diff_map_peaks (int imol_diff_map, float screen_centre_x, float screen_centre_y, float screen_centre_z) const
 
std::string get_data_set_file_name (int imol) const
 
Go to Blob
std::pair< bool, clipper::Coord_orth > go_to_blob (float x1, float y1, float z1, float x2, float y2, float z2, float contour_level)
 
Ligand Functions
std::vector< int > fit_ligand_right_here (int imol_protein, int imol_map, int imol_ligand, float x, float y, float z, float n_rmsd, bool use_conformers, unsigned int n_conformers)
 
std::vector< fit_ligand_info_tfit_ligand (int imol_protein, int imol_map, int imol_ligand, float n_rmsd, bool use_conformers, unsigned int n_conformers)
 
std::vector< fit_ligand_info_tfit_ligand_multi_ligand (int imol_protein, int imol_map, const std::string &multi_ligand_molecule_number_list, float n_rmsd, bool use_conformers, unsigned int n_conformers)
 
float fit_to_map_by_random_jiggle (int imol, const coot::residue_spec_t &res_spec, int n_trials, float translation_scale_factor)
 
float fit_to_map_by_random_jiggle_using_cid (int imol, const std::string &cid, int n_trials, float translation_scale_factor)
 
float fit_to_map_by_random_jiggle_with_blur_using_cid (int imol, int imol_map, const std::string &cid, float b_factor, int n_trials, float translation_scale_factor)
 
int add_compound (int imol, const std::string &tlc, int imol_dict, int imol_map, float x, float y, float z)
 
std::string get_svg_for_residue_type (int imol, const std::string &comp_id, bool use_rdkit_svg, const std::string &background_type)
 
std::string get_svg_for_2d_ligand_environment_view (int imol, const std::string &residue_cid, bool add_key)
 
std::vector< coot::residue_spec_tget_non_standard_residues_in_molecule (int imol) const
 
bool try_read_dictionaries_for_new_residue_types (int imol)
 
std::vector< int > get_dictionary_conformers (const std::string &comp_id, int imol_enc, bool remove_internal_clash_conformers)
 
texture_as_floats_t get_map_section_texture (int imol, int section_id, int axis, float data_value_for_bottom, float data_value_for_top) const
 
int get_number_of_map_sections (int imol_map, int axis_id) const
 
Other Features
coot::simple_mesh_t make_mesh_from_gltf_file (const std::string &file_name)
 
coot::simple_mesh_t get_octahemisphere (unsigned int n_divisions) const
 
unsigned int get_max_number_of_simple_mesh_vertices () const
 
void set_max_number_of_simple_mesh_vertices (unsigned int n)
 
std::string pae_png (const std::string &pae_file_name) const
 
Functions for Blender Interface
void make_mesh_for_map_contours_for_blender (int imol, float x, float y, float z, float level, float radius)
 Function for Blender interface.
 
void make_mesh_for_bonds_for_blender (int imol, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, int smoothness_factor)
 Function for Blender interface.
 
void make_mesh_for_molecular_representation_for_blender (int imol, const std::string &cid, const std::string &colour_scheme, const std::string &style, int secondary_structure_usage_flag)
 
void make_mesh_for_gaussian_surface_for_blender (int imol, float sigma, float contour_level, float box_radius, float grid_scale, float b_factor)
 Function for Blender interface.
 
void make_mesh_for_goodsell_style_for_blender (int imol, float colour_wheel_rotation_step, float saturation, float goodselliness)
 blender
 
std::vector< float > get_colour_table_for_blender (int imol)
 Function for Blender interface.
 
std::vector< float > get_vertices_for_blender (int imol)
 Function for Blender interface.
 
std::vector< int > get_triangles_for_blender (int imol)
 Function for Blender interface.
 
void test_function (const std::string &s)
 

Public Attributes

int imol_refinement_map
 
int imol_difference_map
 
bool use_gemmi
 

Basic Utilities

bool make_backups_flag
 the backup-enable state (raw public if needed/preferred)
 
std::string package_version () const
 
void set_use_gemmi (bool state)
 
bool get_use_gemmi ()
 Get the state of using GEMMI for coordinates parsing.
 
void set_make_backups (bool state)
 
bool get_make_backups () const
 
std::string file_name_to_string (const std::string &file_name) const
 
unsigned int get_number_of_molecules () const
 
void create_empty_molecules (unsigned int n_empty)
 
void set_imol_refinement_map (int i)
 
void set_map_weight (float w)
 
float get_map_weight () const
 
void scale_map (int imol_map, float scale_factor)
 
coot::atom_spec_t atom_cid_to_atom_spec (int imol, const std::string &cid) const
 
coot::residue_spec_t residue_cid_to_residue_spec (int imol, const std::string &cid) const
 
void set_show_timings (bool s)
 
moorhen::header_info_t get_header_info (int imol) const
 
int get_imol_enc_any () const
 

Coordinates Utils

std::vector< coot::lsq_range_match_info_t > lsq_matchers
 
int read_coordinates (const std::string &file_name)
 
int read_pdb (const std::string &file_name)
 
int read_small_molecule_cif (const std::string &file_name)
 
void print_secondary_structure_info (int imol) const
 
void replace_molecule_by_model_from_file (int imol, const std::string &pdb_file_name)
 
std::vector< int > split_multi_model_molecule (int imol)
 
int make_ensemble (const std::string &model_molecules_list)
 
std::string molecule_to_PDB_string (int imol) const
 
std::string molecule_to_mmCIF_string (int imol) const
 
std::pair< int, std::string > get_active_atom (float x, float y, float z, const std::string &displayed_model_molecules_list) const
 
int import_cif_dictionary (const std::string &cif_file_name, int imol_enc)
 
std::string get_cif_file_name (const std::string &comp_id, int imol_enc) const
 
std::string get_cif_restraints_as_string (const std::string &comp_id, int imol_enc) const
 
bool copy_dictionary (const std::string &monomer_name, int imol_current, int imol_new)
 
int get_monomer (const std::string &monomer_name)
 
int get_monomer_from_dictionary (const std::string &comp_id, int imol, bool idealised_flag)
 
int get_monomer_and_position_at (const std::string &comp_id, int imol, float x, float y, float z)
 
std::map< std::string, std::string > dictionary_atom_name_map (const std::string &comp_id_1, int imol_1, const std::string &comp_id_2, int imol_2)
 
std::vector< std::string > get_types_in_molecule (int imol) const
 get types
 
std::vector< std::string > get_groups_for_monomers (const std::vector< std::string > &residue_names) const
 
std::string get_group_for_monomer (const std::string &residue_name) const
 
std::string get_hb_type (const std::string &compound_id, int imol_enc, const std::string &atom_name) const
 
std::vector< std::pair< std::string, std::string > > get_gphl_chem_comp_info (const std::string &compound_id, int imol_enc)
 
std::vector< std::pair< std::string, std::string > > get_acedrg_atom_types (const std::string &compound_id, int imol_enc) const
 
coot::acedrg_types_for_residue_t get_acedrg_atom_types_for_ligand (int imol, const std::string &residue_cid) const
 
void set_occupancy (int imol, const std::string &cid, float occ_new)
 
std::string get_molecule_selection_as_json (int imol, const std::string &cid) const
 
void write_png (const std::string &compound_id, int imol, const std::string &file_name) const
 
int write_coordinates (int imol, const std::string &file_name) const
 
void set_draw_missing_residue_loops (bool state)
 
coot::simple_mesh_t get_bonds_mesh (int imol, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, int smoothness_factor)
 
coot::instanced_mesh_t get_bonds_mesh_instanced (int imol, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, bool show_atoms_as_aniso_flag, bool show_aniso_atoms_as_ortep_flag, bool draw_hydrogen_atoms_flag, int smoothness_factor)
 
coot::instanced_mesh_t get_bonds_mesh_for_selection_instanced (int imol, const std::string &atom_selection_cid, const std::string &mode, bool against_a_dark_background, float bond_width, float atom_radius_to_bond_width_ratio, bool show_atoms_as_aniso_flag, bool show_aniso_atoms_as_ortep_flag, bool draw_hydrogen_atoms_flag, int smoothness_factor)
 
coot::instanced_mesh_t get_goodsell_style_mesh_instanced (int imol, float colour_wheel_rotation_step, float saturation, float goodselliness)
 
void export_map_molecule_as_gltf (int imol, float pos_x, float pos_y, float pos_z, float radius, float contour_level, const std::string &file_name)
 
void export_model_molecule_as_gltf (int imol, const std::string &selection_cid, const std::string &mode, bool against_a_dark_background, float bonds_width, float atom_radius_to_bond_width_ratio, int smoothness_factor, bool draw_hydrogen_atoms_flag, bool draw_missing_residue_loops, const std::string &file_name)
 
void export_molecular_representation_as_gltf (int imol, const std::string &atom_selection_cid, const std::string &colour_scheme, const std::string &style, int secondary_structure_usage_flag, const std::string &file_name)
 
void export_chemical_features_as_gltf (int imol, const std::string &cid, const std::string &file_name) const
 
void set_gltf_pbr_roughness_factor (int imol, float roughness_factor)
 
void set_gltf_pbr_metalicity_factor (int imol, float metalicity)
 
std::vector< glm::vec4 > get_colour_table (int imol, bool against_a_dark_background) const
 
void set_colour_wheel_rotation_base (int imol, float r)
 
void set_base_colour_for_bonds (int imol, float r, float g, float b)
 
void add_to_non_drawn_bonds (int imol, const std::string &atom_selection_cid)
 
void clear_non_drawn_bonds (int imol)
 
void print_non_drawn_bonds (int imol) const
 
void set_user_defined_bond_colours (int imol, const std::map< unsigned int, std::array< float, 4 > > &colour_map)
 User-defined colour-index to colour.
 
void set_user_defined_atom_colour_by_selection (int imol, const std::vector< std::pair< std::string, unsigned int > > &indexed_residues_cids, bool colour_applies_to_non_carbon_atoms_also)
 
void add_colour_rule (int imol, const std::string &selection_cid, const std::string &colour)
 Add a colour rule for M2T representations.
 
void add_colour_rules_multi (int imol, const std::string &selections_and_colours_combo_string)
 
void delete_colour_rules (int imol)
 
std::vector< std::pair< std::string, std::string > > get_colour_rules (int imol) const
 
void print_colour_rules (int imol) const
 
void set_use_bespoke_carbon_atom_colour (int imol, bool state)
 
void set_bespoke_carbon_atom_colour (int imol, const coot::colour_t &col)
 
void M2T_updateFloatParameter (int imol, const std::string &param_name, float value)
 Update float parameter for MoleculesToTriangles molecular mesh.
 
void M2T_updateIntParameter (int imol, const std::string &param_name, int value)
 Update int parameter for MoleculesToTriangles molecular mesh.
 
coot::simple_mesh_t get_molecular_representation_mesh (int imol, const std::string &cid, const std::string &colour_scheme, const std::string &style, int secondary_structure_usage_flag)
 
coot::simple_mesh_t get_gaussian_surface (int imol, float sigma, float contour_level, float box_radius, float grid_scale, float b_factor) const
 
coot::simple_mesh_t get_chemical_features_mesh (int imol, const std::string &cid) const
 
mmdb::Atom * get_atom_using_cid (int imol, const std::string &cid) const
 
mmdb::Residue * get_residue_using_cid (int imol, const std::string &cid) const
 
bool residue_is_nucleic_acid (int imol, const std::string &cid) const
 
std::vector< double > get_residue_CA_position (int imol, const std::string &cid) const
 
std::vector< double > get_residue_average_position (int imol, const std::string &cid) const
 
std::vector< double > get_residue_sidechain_average_position (int imol, const std::string &cid) const
 
unsigned int get_number_of_atoms (int imol) const
 
float get_molecule_diameter (int imol) const
 
int get_number_of_hydrogen_atoms (int imol) const
 
std::vector< std::string > get_chains_in_model (int imol) const
 
std::vector< std::vector< std::string > > get_ncs_related_chains (int imol) const
 
std::vector< std::pair< coot::residue_spec_t, std::string > > get_single_letter_codes_for_chain (int imol, const std::string &chain_id) const
 
std::vector< std::string > get_residue_names_with_no_dictionary (int imol) const
 
std::string get_residue_name (int imol, const std::string &chain_id, int res_no, const std::string &ins_code) const
 
std::string get_residue_type (int imol, const std::string &cid) const
 
std::string get_SMILES_for_residue_type (const std::string &residue_name, int imol_enc) const
 
std::vector< coot::residue_spec_tresidues_with_missing_atoms (int imol)
 
std::vector< coot::residue_range_tget_missing_residue_ranges (int imol) const
 
std::vector< coot::residue_spec_tget_residues_near_residue (int imol, const std::string &residue_cid, float dist) const
 
std::vector< coot::atom_distance_tget_distances_between_atoms_of_residues (int imol, const std::string &cid_res_1, const std::string &cid_res_2, float dist_max) const
 
superpose_results_t SSM_superpose (int imol_ref, const std::string &chain_id_ref, int imol_mov, const std::string &chain_id_mov)
 
void add_lsq_superpose_match (const std::string &chain_id_ref, int res_no_ref_start, int res_no_ref_end, const std::string &chain_id_mov, int res_no_mov_start, int res_no_mov_end, int match_type)
 
void add_lsq_superpose_atom_match (const std::string &chain_id_ref, int res_no_ref, const std::string &atom_name_ref, const std::string &chain_id_mov, int res_no_mov, const std::string &atom_name_mov)
 
void clear_lsq_matches ()
 Clear any existing lsq matchers.
 
bool lsq_superpose (int imol_ref, int imol_mov)
 
int transform_map_using_lsq_matrix (int imol_map, lsq_results_t lsq_matrix, float x, float y, float z, float radius)
 
lsq_results_t get_lsq_matrix (int imol_ref, int imol_mov, bool summary_to_screen) const
 
coot::symmetry_info_t get_symmetry (int imol, float symmetry_search_radius, float centre_x, float centre_y, float centre_z) const
 
::api::cell_t get_cell (int imol) const
 
coot::util::map_molecule_centre_info_t get_map_molecule_centre (int imol) const
 
int undo (int imol)
 
int redo (int imol)
 
std::pair< int, double > get_torsion (int imol, const std::string &cid, const std::vector< std::string > &atom_names)
 
void set_temperature_factors_using_cid (int imol, const std::string &cid, float temp_fact)
 

Map Utils

user_defined_colour_table_t colour_map_by_other_map_user_defined_table
 
float get_map_sampling_rate ()
 
void set_map_sampling_rate (float msr)
 
int read_mtz (const std::string &file_name, const std::string &f, const std::string &phi, const std::string &weight, bool use_weight, bool is_a_difference_map)
 
int replace_map_by_mtz_from_file (int imol, const std::string &file_name, const std::string &f, const std::string &phi, const std::string &weight, bool use_weight)
 
std::vector< auto_read_mtz_info_tauto_read_mtz (const std::string &file_name)
 
int read_ccp4_map (const std::string &file_name, bool is_a_difference_map)
 
int write_map (int imol, const std::string &file_name) const
 
float get_map_mean (int imol) const
 
float get_map_rmsd_approx (int imol_map) const
 
coot::molecule_t::histogram_info_t get_map_histogram (int imol, unsigned int n_bins, float zoom_factor) const
 
float get_suggested_initial_contour_level (int imol) const
 
bool is_EM_map (int imol) const
 
int sharpen_blur_map (int imol_map, float b_factor, bool in_place_flag)
 
int sharpen_blur_map_with_resample (int imol_map, float b_factor, float resample_factor, bool in_place_flag)
 
int mask_map_by_atom_selection (int imol_coords, int imol_map, const std::string &cid, float atom_radius, bool invert_flag)
 
std::vector< int > partition_map_by_chain (int imol_map, int imol_model)
 
int make_mask (int imol_map_ref, int imol_model, const std::string &atom_selection_cid, float radius)
 
int flip_hand (int imol_map)
 
std::vector< int > make_masked_maps_split_by_chain (int imol, int imol_map)
 
int dedust_map (int imol)
 
void set_map_colour (int imol, float r, float g, float b)
 
void set_map_is_contoured_with_thread_pool (bool state)
 
coot::simple_mesh_t get_map_contours_mesh (int imol, double position_x, double position_y, double position_z, float radius, float contour_level)
 
coot::simple_mesh_t get_map_contours_mesh_using_other_map_for_colours (int imol_ref, int imol_map_for_colouring, double position_x, double position_y, double position_z, float radius, float contour_level, float other_map_for_colouring_min_value, float other_map_for_colouring_max_value, bool invert_colour_ramp)
 
void set_map_colour_saturation (int imol, float s)
 
void set_colour_map_for_map_coloured_by_other_map (std::vector< std::pair< double, std::vector< double > > > colour_table)
 
coot::molecule_t::histogram_info_t get_map_vertices_histogram (int imol, int imol_map_for_sampling, double position_x, double position_y, double position_z, float radius, float contour_level, unsigned int n_bins)
 
coot::util::sfcalc_genmap_stats_t get_latest_sfcalc_stats () const
 
r_factor_stats get_r_factor_stats ()
 
std::string r_factor_stats_as_string (const r_factor_stats &rfs) const
 
int average_map (const std::string &imol_maps, std::vector< float > &scales)
 
bool regen_map (int imol_map, const std::string &imol_maps, const std::vector< float > &scales)
 

Testing functions

ltj_stats_t long_term_job_stats
 long term job
 
bool interrupt_long_term_job
 
void testing_start_long_term_job (unsigned int n_seconds)
 
void testing_stop_long_term_job ()
 
ltj_stats_t testing_interrogate_long_term_job ()
 
double get_contouring_time () const
 
void set_max_number_of_threads (unsigned int n_threads)
 
void set_max_number_of_threads_in_thread_pool (unsigned int n_threads)
 
double test_the_threading (int n_threads)
 
double test_launching_threads (unsigned int n_threads_per_batch, unsigned int n_batches) const
 
double test_thread_pool_threads (unsigned int n_threads)
 
int mmcif_tests (bool last_test_only)
 

Detailed Description

the container of molecules. The class for all libcootapi functions.

Member Function Documentation

◆ accept_rotamer_probability_tables_compressed_data()

void molecules_container_t::accept_rotamer_probability_tables_compressed_data ( const std::string & data_stream)

Access to a compressed file that contains the rotamer probabilities

libcootapi will fill the rotamer probabilities tables from this compressed data stream (placeholder only)

◆ add_alternative_conformation()

int molecules_container_t::add_alternative_conformation ( int imol_model,
const std::string & cid )

Add an alternative conformation for the specified residue

Parameters
imol_modelis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 in chain A)
Returns
1 on a successful addition, 0 on failure.

◆ add_colour_rules_multi()

void molecules_container_t::add_colour_rules_multi ( int imol,
const std::string & selections_and_colours_combo_string )

Add multiple colour rules

Parameters
selections_and_colours_combo_stringe.g. "//A/1^#cc0000|//A/2^#cb0002|//A/3^#c00007", where "|" is the separator for each rule and "^" is the separator for the selection string and the colour string

◆ add_compound()

int molecules_container_t::add_compound ( int imol,
const std::string & tlc,
int imol_dict,
int imol_map,
float x,
float y,
float z )

This function is for adding compounds/molecules like buffer agents and precipitants or anions and cations. e.g. those ligands that can be positioned without need for internal torsion angle manipulation.

Parameters
imolis the model molecule index
tlcis the 3-letter-code/compound-id
imol_dictis the molecule to which the ligand is attached (if any). Typically this will be IMOL_ENC_ANY (-999999).
imol_mapis the map molecule index
xis the x position
yis the y position
zis the z position
Returns
the success status, 1 for good, 0 for not good.

◆ add_hydrogen_atoms()

int molecules_container_t::add_hydrogen_atoms ( int imol_model)

Add hydrogen atoms

Parameters
imol_modelis the model molecule index
Returns
1 on success, 0 on failure.

◆ add_lsq_superpose_atom_match()

void molecules_container_t::add_lsq_superpose_atom_match ( const std::string & chain_id_ref,
int res_no_ref,
const std::string & atom_name_ref,
const std::string & chain_id_mov,
int res_no_mov,
const std::string & atom_name_mov )

Superpose using LSQ for a scpecific atom - setup the matches

Parameters
chain_id_refthe chain ID for the reference chain
res_no_refthe residue number in the reference chain
atom_name_refthe name of the reference atom
chain_id_movthe chain ID for the moving chain
res_no_movthe residue number in the moving chain
atom_name_movthe name of the moving atom

◆ add_lsq_superpose_match()

void molecules_container_t::add_lsq_superpose_match ( const std::string & chain_id_ref,
int res_no_ref_start,
int res_no_ref_end,
const std::string & chain_id_mov,
int res_no_mov_start,
int res_no_mov_end,
int match_type )

Superpose using LSQ - setup the matches

Parameters
chain_id_refthe chain ID for the reference chain
res_no_ref_startthe starting residue number in the reference chain
res_no_ref_endthe ending residue number in the reference chain
chain_id_movthe chain ID for the moving chain
res_no_mov_startthe starting residue number in the moving chain
res_no_mov_endthe ending residue number in the moving chain
match_type0: all, 1: main, 2: CAs, 3: N, CA, C, 4: N, CA, CB, C

◆ add_named_glyco_tree()

void molecules_container_t::add_named_glyco_tree ( int imol_model,
int imol_map,
const std::string & glycosylation_name,
const std::string & asn_chain_id,
int asn_res_no )

Add N-linked glycosylation

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
glycosylation_nameis the type of glycosylation, one of: "NAG-NAG-BMA" or "high-mannose" or "hybrid" or "mammalian-biantennary" or "plant-biantennary"
asn_chain_idis the chain-id of the ASN to which the carbohydrate is to be added
asn_res_nois the residue number of the ASN to which the carbohydrate is to be added

◆ add_parallel_plane_restraint()

void molecules_container_t::add_parallel_plane_restraint ( int imol,
const std::string & residue_cid_1,
const std::string & residue_cid_2 )

Generate parallel plane restraints (for RNA and DNA)

Parameters
imolis the model molecule index
residue_cid_1is the selection CID e.g "//A/15" (residue 15 of chain A)
residue_cid_2is the selection CID e.g "//A/17" (residue 17 of chain A)

◆ add_target_position_restraint()

void molecules_container_t::add_target_position_restraint ( int imol,
const std::string & atom_cid,
float pos_x,
float pos_y,
float pos_z )

Add or update restraint (if it has a pull restraint already)

Parameters
imolis the model molecule index
atom_cidis the selection CID e.g "//A/15/OH" (atom OH of residue 15 of chain A)
pos_xis the x coordinate of the target position of the specified atom
pos_yis the y coordinate of the target position of the specified atom
pos_zis the z coordinate of the target position of the specified atom

◆ add_target_position_restraint_and_refine()

coot::instanced_mesh_t molecules_container_t::add_target_position_restraint_and_refine ( int imol,
const std::string & atom_cid,
float pos_x,
float pos_y,
float pos_z,
int n_cycles )

Create a new position for the given atom and create a new bonds mesh based on that

This is currently "heavyweight" as the bonds mesh is calculated from scratch (it is not (yet) merely a distortion of an internally-stored mesh).

Parameters
imolis the model molecule index
atom_cidis the selection CID e.g "//A/15/OH" (atom OH of residue 15 of chain A)
pos_xis the x coordinate of the target position of the specified atom
pos_yis the y coordinate of the target position of the specified atom
pos_zis the z coordinate of the target position of the specified atom
n_cyclesspecifies the number of refinement cyles to run after the target position of the atom has been applied. If n_cycles is -1 then, no cycles are done and the mesh is bonds merely calculated.
Returns
a instanced_mesh_t

◆ add_terminal_residue_directly()

std::pair< int, std::string > molecules_container_t::add_terminal_residue_directly ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code )

Add a residue onto the end of the chain by fitting to density

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
Returns
first: 1 on success, second is failure message

◆ add_terminal_residue_directly_using_bucca_ml_growing()

int molecules_container_t::add_terminal_residue_directly_using_bucca_ml_growing ( int imol,
const coot::residue_spec_t & spec )

Add a residue onto the end of the chain by fitting to density using Buccaneer building

Parameters
imolis the model molecule index
specis the residue specifier, residue_spec_t("A", 10, "")

◆ add_terminal_residue_directly_using_bucca_ml_growing_using_cid()

int molecules_container_t::add_terminal_residue_directly_using_bucca_ml_growing_using_cid ( int imol,
const std::string & cid )

Add a residue onto the end of the chain by fitting to density using Buccaneer building and cid

This function has been removed - is is now a noop.

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15/OH" (atom OH in residue 15)

◆ add_terminal_residue_directly_using_cid()

int molecules_container_t::add_terminal_residue_directly_using_cid ( int imol,
const std::string & cid )

Add a residue onto the end of the chain by fitting to density using cid

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15/OH" (atom OH in residue 15)
Returns
success status (1 for good, 0 for not done)

◆ add_to_non_drawn_bonds()

void molecules_container_t::add_to_non_drawn_bonds ( int imol,
const std::string & atom_selection_cid )

Add an atom selection cid for atoms and bonds not to be drawn

Parameters
imolis the model molecule index
atom_selection_cide.g "//A/15" (all the atoms in residue 15 of chain A)

◆ add_waters()

int molecules_container_t::add_waters ( int imol_model,
int imol_map )

Add waters

Parameters
imolis the model molecule index
imol_mapis the map molecule index
Returns
the number of waters added on a success, -1 on failure.

◆ all_molecule_contact_dots()

coot::instanced_mesh_t molecules_container_t::all_molecule_contact_dots ( int imol,
unsigned int smoothness_factor ) const

Contact dots for the whole molecule/model

Parameters
imolis the model molecule index
smoothness_factoris 1, 2 or 3 (3 is the most smooth). Recently added (20230202)
Returns
the instanced mesh for the specified molecule.

◆ apply_transformation_to_atom_selection()

int molecules_container_t::apply_transformation_to_atom_selection ( int imol,
const std::string & atoms_selection_cid,
int n_atoms,
float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22,
float c0,
float c1,
float c2,
float t0,
float t1,
float t2 )

Apply transformation to atom selection in the given molecule

Returns
the number of atoms moved.

◆ assign_sequence()

void molecules_container_t::assign_sequence ( int imol_model,
int imol_map )

Assign a sequence to a molecule

Often one might copy out a fragment from a more complete molecule (and then copy it back after the sequence has been added). This runs backrub_rotamer() on the newly assigned residues

Parameters
imolis the model molecule index
imol_mapis the map molecule index

◆ associate_data_mtz_file_with_map()

void molecules_container_t::associate_data_mtz_file_with_map ( int imol,
const std::string & data_mtz_file_name,
const std::string & f_col,
const std::string & sigf_col,
const std::string & free_r_col )

Associate a data mtz file with a molecule

This function is called before calling "connect_updating_maps()"

Parameters
imolis the map molecule index
data_mtz_file_nameis the name of the mtz file
f_colis the F column, e.g. "FOBS"
sigf_cole.g. "SIGFOBS"
free_r_cole.g. "RFREE"

◆ associate_sequence()

void molecules_container_t::associate_sequence ( int imol,
const std::string & name_or_chain_id,
const std::string & sequence )

Associate a sequence with a molecule

Parameters
imolis the model molecule index
name_or_chain_ide.g. "A"
sequenceis the model sequence

◆ atom_cid_to_atom_spec()

coot::atom_spec_t molecules_container_t::atom_cid_to_atom_spec ( int imol,
const std::string & cid ) const

Convert atom cid string to a coot atom specifier

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15/OH" (atom OH in residue 15 of chain A)
Returns
the atom spec., spec.empty() is true on failure.

◆ auto_fit_rotamer()

int molecules_container_t::auto_fit_rotamer ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code,
const std::string & alt_conf,
int imol_map )

Auto-fit rotamer

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
alt_confis the alternate conformation, e.g. "A" or "B"
imol_mapis the map molecule index
Returns
1 on successful modification, return 0 on failure

◆ auto_read_mtz()

std::vector< auto_read_mtz_info_t > molecules_container_t::auto_read_mtz ( const std::string & file_name)

Auto read the given mtz file

Parameters
file_nameis the name of the MTZ file
Returns
a vector of the maps created from reading the file

◆ average_map()

int molecules_container_t::average_map ( const std::string & imol_maps,
std::vector< float > & scales )

Get the average map

This function does no normalization of the scales, presuming that they are pre-normalized.

Parameters
imol_mapsis a colon-separated list of map indices e.g. "2:3:4"
scalesis the list of weights corresponding to the list of maps. The number of scales factors should match the number of maps
Returns
the index of the new map, or -1 on failure.

◆ calculate_new_rail_points()

int molecules_container_t::calculate_new_rail_points ( )

Calling this adds to the rail_points history. Make this pairs when we add model scoring

Returns
the new rail points (since last modification)

◆ change_alt_locs()

int molecules_container_t::change_alt_locs ( int imol,
const std::string & cid,
const std::string & change_mode )

Change alternate conformation

Note that this function only deals with (swaps) alt confs "A" and "B" - any alt-conf other than that is ignored.

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 in chain A)
change_modeis either "residue", "main-chain", "side-chain" or a comma-separated atom-name pairs (e.g "N,CA") - you can (of course) specify just one atom, e.g.: "N".
Returns
the success status (1 is done, 0 means failed to do)

◆ change_chain_id()

std::pair< int, std::string > molecules_container_t::change_chain_id ( int imol,
const std::string & from_chain_id,
const std::string & to_chain_id,
bool use_resno_range,
int start_resno,
int end_resno )

Change the chain ID

Parameters
imolis the model molecule index
from_chain_ide.g. "A"
to_chain_ide.g. "C"
use_resno_rangeuse residue number range, typically True
start_resnothe starting residue number of the range
end_resnothe ending residue number of the range
Returns
-1 on a conflict, 1 on good, 0 on did nothing, return also an information/error message

◆ change_to_first_rotamer()

coot::molecule_t::rotamer_change_info_t molecules_container_t::change_to_first_rotamer ( int imol,
const std::string & residue_cid,
const std::string & alt_conf )

Change to the first (0th) rotamer

Parameters
imolis the model molecule index
residue_cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
the change information.

◆ change_to_next_rotamer()

coot::molecule_t::rotamer_change_info_t molecules_container_t::change_to_next_rotamer ( int imol,
const std::string & residue_cid,
const std::string & alt_conf )

Change to the next rotamer (rotamer cycling is implicit if needed)

Parameters
imolis the model molecule index
residue_cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
the change information.

◆ change_to_previous_rotamer()

coot::molecule_t::rotamer_change_info_t molecules_container_t::change_to_previous_rotamer ( int imol,
const std::string & residue_cid,
const std::string & alt_conf )

Change to the previous rotamer (rotamer cycling is implicit if needed)

Parameters
imolis the model molecule index
residue_cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
the change information.

◆ cis_trans_convert()

int molecules_container_t::cis_trans_convert ( int imol,
const std::string & atom_cid )

Convert a cis peptide to a trans or vice versa

Parameters
imolis the model molecule index
atom_cidis the atom selection CID e.g "//A/15/OH" (atom OH residue 15 of chain A)
Returns
1 on a successful conversion.

◆ clear_extra_restraints()

void molecules_container_t::clear_extra_restraints ( int imol)

Clear the extra restraints

Parameters
imolis the model molecule index

◆ clear_non_drawn_bonds()

void molecules_container_t::clear_non_drawn_bonds ( int imol)

Clear the set of non-drawn atoms (so that they can be displayed again)

Parameters
imolis the model molecule index

◆ clear_refinement()

void molecules_container_t::clear_refinement ( int imol)

Call this after molecule refinement has finished (say when the molecule molecule is accepted into the original molecule)

Parameters
imolis the model molecule index

◆ clear_target_position_restraint()

void molecules_container_t::clear_target_position_restraint ( int imol,
const std::string & atom_cid )

Clear target_position restraint

Parameters
imolis the model molecule index
atom_cidis the selection CID e.g "//A/15/OH" (atom OH of residue 15 of chain A)

◆ clear_target_position_restraints()

void molecules_container_t::clear_target_position_restraints ( int imol)

Clear any and all drag-atom target position restraints

Parameters
imolis the model molecule index

◆ close_molecule()

int molecules_container_t::close_molecule ( int imol)

Close the molecule (and delete dynamically allocated memory)

Parameters
imolis the model molecule index
Returns
1 on successful closure and 0 on failure to close

◆ connect_updating_maps()

int molecules_container_t::connect_updating_maps ( int imol_model,
int imol_with_data_info_attached,
int imol_map_2fofc,
int imol_map_fofc )

Connect updating maps

Reset the rail_points (calls "reset_the_rail_points()"), updates the maps (using internal/clipper SFC). Update your contour lines meshes after calling this function.

Parameters
imol_modelis the model molecule index
imol_with_data_info_attachedis the map index with the data have been attached by the previous function (associate_data_mtz_file_with_map)
imol_map_2fofcis the map molecule index of the 2FO-FC map
imol_map_fofcis the map molecule index of the FO-FC map
Returns
1 if the connection was successful

◆ contact_dots_for_ligand()

coot::instanced_mesh_t molecules_container_t::contact_dots_for_ligand ( int imol,
const std::string & cid,
unsigned int smoothness_factor ) const

Contact dots for ligand

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
smoothness_factoris 1, 2 or 3 (3 is the most smooth). Recently added (20230202)
Returns
the instanced mesh for the specified ligand

◆ contains_unsaved_models()

bool molecules_container_t::contains_unsaved_models ( ) const

Check if there are unsaved changes for this model

e.g. as yet not written to disk

Returns
a flag of unsaved models state - e.g. if any of them are unsaved, then this returns True.

◆ copy_dictionary()

bool molecules_container_t::copy_dictionary ( const std::string & monomer_name,
int imol_current,
int imol_new )

Copy the dictionary that is specific for imol_current so that it can be used with a new molecule

Parameters
monomer_nameis the 3 letter code of the monomer in the dictionary, e.g. "ALA" for alanine
imol_currentis the model molecule index with the dictionary to be copied from
imol_newis the model molecule index the dictionary will be copied into

◆ copy_fragment_for_refinement_using_cid()

int molecules_container_t::copy_fragment_for_refinement_using_cid ( int imol,
const std::string & multi_cid )

Copy a fragment given the multi_cid selection string for refinement

Use this in preference to copy_fragment_using_cid when copying a molecule fragment to make a molten zone for refinement. That is because this version quietly also copies the residues near the residues of the selection, so that those residues can be used for links and non-bonded contact restraints.

Parameters
imolis the model molecule index
multi_cidsis a "||"-separated list of residues CIDs, e.g. "//A/12-52||//A/14-15||//B/56-66"
Returns
the new molecule number (or -1 on no atoms selected)

◆ copy_fragment_using_cid()

int molecules_container_t::copy_fragment_using_cid ( int imol,
const std::string & multi_cid )

Copy a fragment given the multi_cid selection string

Parameters
imolis the model molecule index
multi_cidsis a "||"-separated list of residues CIDs, e.g. "//A/12-52||//A/14-15||/B/56-66"
Returns
the new molecule number (or -1 on no atoms selected)

◆ copy_fragment_using_residue_range()

int molecules_container_t::copy_fragment_using_residue_range ( int imol,
const std::string & chain_id,
int res_no_start,
int res_no_end )

Copy a residue-range fragment

Parameters
imolis the model molecule index
chain_ide.g. "A"
res_no_startthe starting residue number
res_no_ref_endthe ending residue number
Returns
the new molecule number (or -1 on no atoms selected)

◆ copy_molecule()

int molecules_container_t::copy_molecule ( int imol)

Copy the molecule

Parameters
imolthe specified molecule
Returns
the new molecule number

◆ create_empty_molecules()

void molecules_container_t::create_empty_molecules ( unsigned int n_empty)

Add a number of empty molecules to the internal vector/list of molecules

Note this is not like STL reserve as it will increase the molecule index of the next added molecule by n_empty.

Parameters
n_emptythe number of empty molecules to create

◆ dedust_map()

int molecules_container_t::dedust_map ( int imol)

dedust map

Parameters
imol_mapthe map molecule index
Returns
the map molecule index of the dedusted map or -1 on failure

◆ delete_all_carbohydrate()

bool molecules_container_t::delete_all_carbohydrate ( int imol)

delete all carbohydrate

Parameters
imolis the model molecule index
Returns
true on successful deletion, return false on no deletion.

◆ delete_atom()

std::pair< int, unsigned int > molecules_container_t::delete_atom ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code,
const std::string & atom_name,
const std::string & alt_conf )

Delete atom

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
atom_nameis the name of the atom, e.g. "OH"
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_atom_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_atom_using_cid ( int imol,
const std::string & cid )

Delete atom using cid

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15/OH" (atom OH in residue 15 of chain A)
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_chain_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_chain_using_cid ( int imol,
const std::string & cid )

Delete chain using chain cid

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A" (chain A), "//*" (all chains)
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_colour_rules()

void molecules_container_t::delete_colour_rules ( int imol)

Delete the colour rules for the given molecule

Parameters
imolis the model molecule index

◆ delete_hydrogen_atoms()

int molecules_container_t::delete_hydrogen_atoms ( int imol_model)

Delete hydrogen atoms

Parameters
imol_modelis the model molecule index
Returns
1 on a successful deletion, 0 on failure.

◆ delete_literal_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_literal_using_cid ( int imol,
const std::string & cid )

Delete the atoms specified in the cid selection

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15/OH" (atom OH in residue 15)
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_residue()

std::pair< int, unsigned int > molecules_container_t::delete_residue ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code )

Delete residue

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_residue_atoms_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_residue_atoms_using_cid ( int imol,
const std::string & cid )

Delete residue atoms using cid

This is the same as delete_atom_using_cid. It will be deleted in the future

Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_residue_atoms_with_alt_conf()

std::pair< int, unsigned int > molecules_container_t::delete_residue_atoms_with_alt_conf ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code,
const std::string & alt_conf )

Delete residue atoms using alt_conf

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_residue_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_residue_using_cid ( int imol,
const std::string & cid )

Delete residue using cid

Parameters
imolis the model molecule index
cidis the residue selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_side_chain()

std::pair< int, unsigned int > molecules_container_t::delete_side_chain ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code )

Delete side chain

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_side_chain_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_side_chain_using_cid ( int imol,
const std::string & cid )

Delete side chain using cid

Parameters
imolis the model molecule index
cidis the residue selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
Returns
1 on successful deletion, return 0 on failure to delete.

◆ delete_using_cid()

std::pair< int, unsigned int > molecules_container_t::delete_using_cid ( int imol,
const std::string & cid,
const std::string & scope )

Delete item

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
scopeis one of the strings: ["ATOM", "WATER", "RESIDUE"," CHAIN"," MOLECULE", "LITERAL"]
Returns
1 on successful deletion, return 0 on failure

◆ density_correlation_analysis()

coot::validation_information_t molecules_container_t::density_correlation_analysis ( int imol_model,
int imol_map ) const

Get the density correlation validation information

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
Returns
an object validation_information_t

◆ density_fit_analysis()

coot::validation_information_t molecules_container_t::density_fit_analysis ( int imol_model,
int imol_map ) const

Density fit validation information.

This function returns the sum of the densiy of the atoms in the residue

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
Returns
an object validation_information_t

◆ dictionary_atom_name_map()

std::map< std::string, std::string > molecules_container_t::dictionary_atom_name_map ( const std::string & comp_id_1,
int imol_1,
const std::string & comp_id_2,
int imol_2 )

Match atom between 2 dictionaries

Parameters
comp_id_1is the 3-letter code for the residue/ligand in the first model, e.g. "ALA" for alanine
imol_1is the model molecule index of the first model
comp_id_2is the 3-letter code for the residue/ligand in the second model, e.g. "ALA" for alanine
imol_2is the model molecule index of the second model
Returns
the atom name match on superposing the atoms of the given dictionaries

◆ difference_map_peaks()

std::vector< coot::molecule_t::interesting_place_t > molecules_container_t::difference_map_peaks ( int imol_map,
int imol_protein,
float n_rmsd ) const

Get difference map peaks

Parameters
imol_mapis the map molecule index
imol_proteinis the model molecule index
n_rmsdnumber of sd, e.g. 4.8
Returns
a vector/list of validation_information_t

◆ eigen_flip_ligand()

void molecules_container_t::eigen_flip_ligand ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code )

Eigen-flip the specified ligand

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"

◆ eigen_flip_ligand_using_cid()

void molecules_container_t::eigen_flip_ligand_using_cid ( int imol,
const std::string & residue_cid )

Eigen-flip ligand using cid

Parameters
imolis the model molecule index
residue_cidis the residue selection CID e.g "//A/15" (residue 15 of chain A)

◆ end_delete_closed_molecules()

void molecules_container_t::end_delete_closed_molecules ( )

Delete the most recent/last closed molecule in the molecule vector, until the first non-closed molecule is found (working from the end)

◆ export_chemical_features_as_gltf()

void molecules_container_t::export_chemical_features_as_gltf ( int imol,
const std::string & cid,
const std::string & file_name ) const

export chemical features for the specified residue

◆ export_map_molecule_as_gltf()

void molecules_container_t::export_map_molecule_as_gltf ( int imol,
float pos_x,
float pos_y,
float pos_z,
float radius,
float contour_level,
const std::string & file_name )

Export map molecule as glTF file

glTF files can be imported into Blender or other 3D graphics applications

Parameters
imolis the model molecule index
xx of the center of the screen
yy of the center of the screen
zz of the center of the screen
radiuse.g. 12.0 for X-ray map and 100.0 for Cryo-EM map
contour_levele.g. 1.5 sd for X-ray, 5.0 sd for cryo-EM
file_nameextension should be .glb

◆ export_model_molecule_as_gltf()

void molecules_container_t::export_model_molecule_as_gltf ( int imol,
const std::string & selection_cid,
const std::string & mode,
bool against_a_dark_background,
float bonds_width,
float atom_radius_to_bond_width_ratio,
int smoothness_factor,
bool draw_hydrogen_atoms_flag,
bool draw_missing_residue_loops,
const std::string & file_name )

Export model molecule as glTF file

glTF files can be imported into Blender or other 3D graphics applications

Same parameters as the get_bonds_mesh function. draw_hydrogen_atoms_flag and draw_missing_residue_loops are typically False. This API will change - we want to specify surfaces and ribbons too.

◆ export_molecular_representation_as_gltf()

void molecules_container_t::export_molecular_representation_as_gltf ( int imol,
const std::string & atom_selection_cid,
const std::string & colour_scheme,
const std::string & style,
int secondary_structure_usage_flag,
const std::string & file_name )

Export molecular representation as glTF file

glTF files can be imported into Blender

Parameters
imolis the model molecule index
atom_selection_cid: e.g "//A/15" (all the atoms in residue 15 of chain A)
colour_schemeis one of "colorRampChainsScheme", "colorBySecondaryScheme", "Chain"
style"Ribbon" or "MolecularSurface"
secondary_structure_usage_flag0 (USE_HEADER), 1 (DONT_USE) or 2 (CALC_SECONDARY_STRUCTURE)
file_nameof the glTF (the file will be compressed, so choose ".glb" as the extension)

◆ file_name_to_string()

std::string molecules_container_t::file_name_to_string ( const std::string & file_name) const

File name to string

Parameters
file_nameis the name of the given file
Returns
the string of the contents of the given file-name.

◆ fill_partial_residue()

int molecules_container_t::fill_partial_residue ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code )

Fill the specified residue

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
Returns
1 on a successful fill, 0 on failure.

◆ fill_partial_residue_using_cid()

int molecules_container_t::fill_partial_residue_using_cid ( int imol,
const std::string & cid )

Fill the specified residue using cid

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 in chain A)
Returns
1 on a successful fill, 0 on failure.

◆ fill_partial_residues()

int molecules_container_t::fill_partial_residues ( int imol)

Fill all the the partially-filled residues in the molecule

Parameters
imolis the model molecule index
Returns
1 on a successful fill, 0 on failure.

◆ find_water_baddies()

std::vector< coot::atom_spec_t > molecules_container_t::find_water_baddies ( int imol_model,
int imol_map,
float b_factor_lim,
float outlier_sigma_level,
float min_dist,
float max_dist,
bool ignore_part_occ_contact_flag,
bool ignore_zero_occ_flag )

Check waters, using implicit logical OR

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
b_factor_limtypical value is 60.0
outlier_sigma_leveltypical value is 0.8
min_disttypical value is 2.3
max_disttypical value is 3.5
ignore_part_occ_contact_flagtypical value is False
ignore_zero_occ_flagtypical value is False
Returns
a vector/list of atom specifiers

◆ fit_ligand()

std::vector< fit_ligand_info_t > molecules_container_t::fit_ligand ( int imol_protein,
int imol_map,
int imol_ligand,
float n_rmsd,
bool use_conformers,
unsigned int n_conformers )

Fit ligand

Parameters
imol_proteinis the model molecule index
imol_mapis the map molecule index
imol_ligandis the ligand molecule index
n_rmsdthe number of sd used as a cut-off for the map level when finding clusters, e.g. 1.2
use_conformersis True for flexible ligands
n_conformersset the number of conformers
Returns
a vector/list of interesting information about the fitted ligands

◆ fit_ligand_multi_ligand()

std::vector< fit_ligand_info_t > molecules_container_t::fit_ligand_multi_ligand ( int imol_protein,
int imol_map,
const std::string & multi_ligand_molecule_number_list,
float n_rmsd,
bool use_conformers,
unsigned int n_conformers )

Fit multiple ligands (place-holder)

Parameters
imol_proteinis the model molecule index
imol_mapis the map molecule index
multi_ligand_molecule_number_listis a colon-separated list of molecules, e.g. "2:3:4"
n_rmsdis number of sd, e.g. 4.8
use_conformersis True for flexible ligands
n_conformersset the number of conformers
Returns
an empty vector (at the moment)

◆ fit_ligand_right_here()

std::vector< int > molecules_container_t::fit_ligand_right_here ( int imol_protein,
int imol_map,
int imol_ligand,
float x,
float y,
float z,
float n_rmsd,
bool use_conformers,
unsigned int n_conformers )

Fit the ligand at specified position. You can expect this to take about 20 seconds. For trivial (i.e non-flexible) ligands you should instead use the jiggle-fit algorithm, which takes a fraction of a second. (That is the algorithm used for "Add Other Solvent Molecules" in Coot.)

Parameters
imol_proteinis the model molecule index
imol_mapis the map molecule index
imol_ligandis the ligand molecule index
xis the x position of the blob
yis the y position of the blob
zis the z position of the blob
n_rmsdnumber of sd, e.g. 4.8
use_conformersis True for flexible ligands
n_conformersset the number of conformers
Returns
a vector/list of indices of molecules for the best fitting ligands to this blob.

◆ fit_to_map_by_random_jiggle()

float molecules_container_t::fit_to_map_by_random_jiggle ( int imol,
const coot::residue_spec_t & res_spec,
int n_trials,
float translation_scale_factor )

Jiggle-Fit Ligand

Parameters
imolis the model molecule index
res_specis the residue specifier, e.g. residue_spec_t("A", 10, "")
n_trialsis the number of trials, if n_trials is 0, then a sensible default value will be used.
translation_scale_factorif is negative then a sensible default value will be used.
Returns
a value less than -99.9 on failure to fit.

◆ fit_to_map_by_random_jiggle_using_cid()

float molecules_container_t::fit_to_map_by_random_jiggle_using_cid ( int imol,
const std::string & cid,
int n_trials,
float translation_scale_factor )

Jiggle-Fit Ligand using cid

Parameters
imolis the model molecule index
cidis the selection CID, e.g "//A/15" (ligand 15 of chain A)
n_trialsis the number of trials, if n_trials is 0, then a sensible default value will be used.
translation_scale_factorif is negative then a sensible default value will be used.
Returns
a value less than -99.9 on failure to fit.

◆ fit_to_map_by_random_jiggle_with_blur_using_cid()

float molecules_container_t::fit_to_map_by_random_jiggle_with_blur_using_cid ( int imol,
int imol_map,
const std::string & cid,
float b_factor,
int n_trials,
float translation_scale_factor )

Jiggle-Fit an atom selection, typically a whole molecule or a chain

Parameters
imolis the model molecule index
cidis the selection CID, e.g. "//A" (chain A)
b_factore.g. 100.0
n_trialsis the number of trials, if n_trials is 0, then a sensible default value will be used.
translation_scale_factorif is negative then a sensible default value will be used.
Returns
a value less than -99.9 on failure to fit.

◆ fix_atom_selection_during_refinement()

void molecules_container_t::fix_atom_selection_during_refinement ( int imol,
const std::string & atom_selection_cid )

Fix atoms during refinement

Does nothing at the moment

Parameters
imolis the model molecule index
atom_selection_cidis the selection CID e.g "//A/15/OH" (atom OH of residue 15 of chain A)

◆ flip_hand()

int molecules_container_t::flip_hand ( int imol_map)

Generate a new map which is the hand-flipped version of the input map

Parameters
imol_mapis the map molecule index
Returns
the molecule index of the new map, or -1 on failure.

◆ flip_peptide_using_cid()

int molecules_container_t::flip_peptide_using_cid ( int imol,
const std::string & atom_cid,
const std::string & alt_conf )

Flip peptide using cid

Parameters
imolis the model molecule index
atom_cidis the atom selection CID e.g "//A/15/OH" (atom OH in residue 15 of chain A)
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
1 on a successful flip

◆ flood()

int molecules_container_t::flood ( int imol_model,
int imol_map,
float n_rmsd )

Flood with dummy atoms

Parameters
imolis the model molecule index
imol_mapis the map molecule index
n_rmsde.g., 4.0
Returns
the number of waters added on a success, -1 on failure.

◆ fourier_shell_correlation()

std::vector< std::pair< double, double > > molecules_container_t::fourier_shell_correlation ( int imol_map_1,
int imol_map_2 ) const

Fourier Shell Correlation (FSC) between maps

Parameters
imol_map_1is the first map molecule index
imol_map_2is the second map molecule index
Returns
a vector/list or pairs of graph points (resolution, correlation). The resolution is in inverse Angstroms squared. An empty list is returned on failure

◆ generate_chain_self_restraints()

void molecules_container_t::generate_chain_self_restraints ( int imol,
float local_dist_max,
const std::string & chain_id )

Generate GM self restraints for the given chain

Parameters
imolis the model molecule index
local_dist_maxis the maximum distance, e.g. 4.6
chain_ide.g. "A" for chain A

◆ generate_local_self_restraints()

void molecules_container_t::generate_local_self_restraints ( int imol,
float local_dist_max,
const std::string & residue_cids )

Generate GM self restraints for the given residues

Parameters
imolis the model molecule index
local_dist_maxis the maximum distance, e.g. 4.6
residue_cidsis a "||"-separated list of residues, e.g. "//A/12||//A/14||//B/56"

◆ generate_self_restraints()

int molecules_container_t::generate_self_restraints ( int imol,
float local_dist_max )

Generate GM self restraints for the whole molecule

Parameters
imolis the model molecule index
local_dist_maxis the maximum distance, e.g. 4.6

◆ get_acedrg_atom_types()

std::vector< std::pair< std::string, std::string > > molecules_container_t::get_acedrg_atom_types ( const std::string & compound_id,
int imol_enc ) const

Get a list of atom names and their associated AceDRG atom types

Parameters
compound_idis the 3-letter code for the residue/ligand in the first model, e.g. "TYR" for tyrosine
imol_encis the molecule index for the residue type/compound_id
Returns
a list of atom names and their associated AceDRG atom types, return an empty list on failure (e.g. when atoms types are not in the dictionary)

◆ get_acedrg_atom_types_for_ligand()

coot::acedrg_types_for_residue_t molecules_container_t::get_acedrg_atom_types_for_ligand ( int imol,
const std::string & residue_cid ) const

Get AceDRG atom types for ligand bonds

Parameters
imolis the model molecule index
residue_cidis the atom selection CID e.g "//A/15" (residue 15 of chain A)
Returns
a coot::acedrg_types_for_residue_t - which contains a vector/list of bond descriptions.

◆ get_active_atom()

std::pair< int, std::string > molecules_container_t::get_active_atom ( float x,
float y,
float z,
const std::string & displayed_model_molecules_list ) const

Get the active atom given the screen centre

Parameters
xis x position of the centre of the screen
yis y position of the centre of the screen
zis z position of the centre of the screen
displayed_model_molecules_listis a colon-separated list of molecules, (e.g. "2:3:4")
Returns
the molecule index and the atom cid. On failure (no molecules with atoms in them) then return -1 and a blank string.

◆ get_atom_differences()

std::vector< positioned_atom_spec_t > molecules_container_t::get_atom_differences ( int imol1,
int imol2 )

Get the atom differences between two molecules typically after refinement

Parameters
imol1is the first model molecule index
imol2is the second model molecule index
Returns
a vector/list of positioned_atom_spec_t

◆ get_atom_overlap_score()

float molecules_container_t::get_atom_overlap_score ( int imol)

Get the atom overlap score

Parameters
imolthe model molecule index
Returns
the overlap score - a negative number indicates failure

◆ get_atom_overlaps()

std::vector< coot::plain_atom_overlap_t > molecules_container_t::get_atom_overlaps ( int imol)

Get Atom Overlaps.

This function used to be called get_overlaps()

Parameters
imolis the model molecule index
Returns
a vector of atom overlap objects

◆ get_atom_using_cid()

mmdb::Atom * molecules_container_t::get_atom_using_cid ( int imol,
const std::string & cid ) const

get an (mmdb-style) atom

If more than one atom is selected by the selection cid, then the first atom is returned.

Don't use this in emscript.

Parameters
imolis the model molecule index
cidis the coordinate-id for the atom.
Returns
either the specified atom or nullopt (None) if not found

◆ get_bonds_mesh()

coot::simple_mesh_t molecules_container_t::get_bonds_mesh ( int imol,
const std::string & mode,
bool against_a_dark_background,
float bond_width,
float atom_radius_to_bond_width_ratio,
int smoothness_factor )

Get the bonds mesh

Parameters
modeis "COLOUR-BY-CHAIN-AND-DICTIONARY", "CA+LIGANDS" or "VDW-BALLS"
against_a_dark_backgroundallows the bond colours to be relevant for the background. When the background is dark, the colours should (as a rule) be bright and pastelly. When the background is light/white, the colour are darker and more saturated.
smoothness_factorcontrols the number of triangles used to make the bond cylinders and spheres for the atoms - it rises in powers of 4. 1 is the smallest smoothness_factor, 2 looks nice and 3 is best.
bond_widthis the bond width in Angstroms. 0.12 is a reasonable default value.
atom_radius_to_bond_width_ratioallows the representation of "ball and stick". To do so use a value between 1.5 and 3.0. The ratio for "liquorice" representation is 1.0.
Returns
a simple_mesh_t

◆ get_bonds_mesh_for_selection_instanced()

coot::instanced_mesh_t molecules_container_t::get_bonds_mesh_for_selection_instanced ( int imol,
const std::string & atom_selection_cid,
const std::string & mode,
bool against_a_dark_background,
float bond_width,
float atom_radius_to_bond_width_ratio,
bool show_atoms_as_aniso_flag,
bool show_aniso_atoms_as_ortep_flag,
bool draw_hydrogen_atoms_flag,
int smoothness_factor )

As get_bonds_mesh_instanced above, but only return the bonds for the atom selection. Typically one would call this with a wider bond width than one would use for standards atoms (all molecule)

Parameters
atom_selection_cide.g. "//A/15" (all the atoms in residue 15 of chain A)
Returns
a instanced_mesh_t

◆ get_bonds_mesh_instanced()

coot::instanced_mesh_t molecules_container_t::get_bonds_mesh_instanced ( int imol,
const std::string & mode,
bool against_a_dark_background,
float bond_width,
float atom_radius_to_bond_width_ratio,
bool show_atoms_as_aniso_flag,
bool show_aniso_atoms_as_ortep_flag,
bool draw_hydrogen_atoms_flag,
int smoothness_factor )

Get the instanced bonds mesh.

Parameters
modeis "COLOUR-BY-CHAIN-AND-DICTIONARY" - more modes to follow
against_a_dark_backgroundallows the bond colours to be relevant for the background. When the background is dark, the colours should (as a rule) be bright and pastelly. When the background is light/white, the colour are darker and more saturated.
bond_widthis the bond width in Angstroms. 0.12 is a reasonable default value.
atom_radius_to_bond_width_ratioallows the representation of "ball and stick". To do so use a value between 1.5 and 3.0. The ratio for "liquorice" representation is 1.0.
show_atoms_as_aniso_flagif true, if possible, show the atoms with thermal ellipsoids.
show_aniso_atoms_as_ortep_flagif true, show any anisotropic atoms with ortep style.
draw_hydrogen_atoms_flagif true, bonds to hydrogen atoms should be added.
smoothness_factorcontrols the number of triangles used to make the bond cylinders and spheres for the atoms - it rises in powers of 4. 1 is the smallest smoothness_factor, 2 looks nice and 3 is best. Instancing may mean that smoothness factor 3 should be used by default.
Returns
a instanced_mesh_t

◆ get_cell()

::api::cell_t molecules_container_t::get_cell ( int imol) const

Get the cell

Check that is_set is true before use.

Parameters
imolis the model molecule index
Returns
a cell_t

◆ get_chains_in_model()

std::vector< std::string > molecules_container_t::get_chains_in_model ( int imol) const

Get the chain IDs in the given molecule

Parameters
imolis the model molecule index
Returns
vector/list of chain-ids for the given molecule

◆ get_chemical_features_mesh()

coot::simple_mesh_t molecules_container_t::get_chemical_features_mesh ( int imol,
const std::string & cid ) const

Get chemical features for the specified residue

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
Returns
a simple_mesh_t

◆ get_cif_file_name()

std::string molecules_container_t::get_cif_file_name ( const std::string & comp_id,
int imol_enc ) const

Get the cif file name

Parameters
comp_idis the 3-letter code for the residue/ligand, e.g. "ALA" for alanine
imol_encis the molecule index for the residue type/compound_id
Returns
the dictionary read for the given residue type, return an empty string on failure

◆ get_cif_restraints_as_string()

std::string molecules_container_t::get_cif_restraints_as_string ( const std::string & comp_id,
int imol_enc ) const

Get the cif restraints as a string

Parameters
comp_idis the 3-letter code for the residue/ligand, e.g. "ALA" for alanine
imol_encis the molecule index for the residue type/compound_id
Returns
a string that is the contents of a dictionary cif file

◆ get_colour_rules()

std::vector< std::pair< std::string, std::string > > molecules_container_t::get_colour_rules ( int imol) const

Get the colour rules

Parameters
imolis the model molecule index

◆ get_colour_table()

std::vector< glm::vec4 > molecules_container_t::get_colour_table ( int imol,
bool against_a_dark_background ) const

Get colour table (for testing)

Parameters
imolis the model molecule index
against_a_dark_backgroundallows the bond colours to be relevant for the background.
Returns
the colour table

◆ get_contouring_time()

double molecules_container_t::get_contouring_time ( ) const
inline

Testing function

get the time for contouring in milliseconds

◆ get_data_set_file_name()

std::string molecules_container_t::get_data_set_file_name ( int imol) const

Get the stored data set file name

Parameters
imolis the model molecule index

◆ get_density_at_position()

float molecules_container_t::get_density_at_position ( int imol_map,
float x,
float y,
float z ) const

Get density at position

Parameters
imol_mapis the map molecule index
xis the x coordinate of the target position
yis the y coordinate of the target position
zis the z coordinate of the target position
Returns
the density value

◆ get_dictionary_conformers()

std::vector< int > molecules_container_t::get_dictionary_conformers ( const std::string & comp_id,
int imol_enc,
bool remove_internal_clash_conformers )

Get the conformers that can be generated by variation around rotatable bonds as described in the dictionary.

Torsions that are marked as "const" are excluded from the variation, as are pyranose ring torsions and torsions that rotate hydrogen atoms

Parameters
comp_idis the 3-letter code for the residue/ligand, e.g. "ALA" for alanine
imol_encis the molecule index for the residue type/compound_id
remove_internal_clash_conformersis the flag for removing internal clash
Returns
a vector/list of indices of the new molecules

◆ get_diff_diff_map_peaks()

std::vector< std::pair< clipper::Coord_orth, float > > molecules_container_t::get_diff_diff_map_peaks ( int imol_diff_map,
float screen_centre_x,
float screen_centre_y,
float screen_centre_z ) const
Parameters
imol_diff_mapis the map molecule index of the difference map
screen_centre_xis the position x of the center of the screen
screen_centre_yis the position y of the center of the screen
screen_centre_zis the position z of the center of the screen
Returns
a vector of the position where the difference map has been flattened. The associated float value is the amount that the map has been flattened.

◆ get_distances_between_atoms_of_residues()

std::vector< coot::atom_distance_t > molecules_container_t::get_distances_between_atoms_of_residues ( int imol,
const std::string & cid_res_1,
const std::string & cid_res_2,
float dist_max ) const

Get atom distances

Parameters
imolis the model molecule index
cid_res_1is the first atom selection CID e.g "//A/15/OH" (atom OH in residue 15 of chain A)
cid_res_2is the second atom selection CID e.g "//A/17/NH" (atom NH in residue 17 of chain A)
distis the distance in Angstrom

◆ get_eigenvalues()

std::vector< double > molecules_container_t::get_eigenvalues ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code )

Get the eigenvalues of the specified residue

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
Returns
the eigenvalues of the atoms in the specified residue

◆ get_extra_restraints_mesh()

coot::instanced_mesh_t molecules_container_t::get_extra_restraints_mesh ( int imol,
int mode )

Get the mesh for extra restraints

Parameters
imolis the model molecule index
modeis currently unused

◆ get_gaussian_surface()

coot::simple_mesh_t molecules_container_t::get_gaussian_surface ( int imol,
float sigma,
float contour_level,
float box_radius,
float grid_scale,
float b_factor ) const

Get a Gaussian surface representation

Parameters
imolis the model molecule index
sigmadefault 4.4
contour_leveldefault 4.0
box_radiusdefault 5.0
grid_scaledefault 0.7
b_factordefault 100.0 (use 0.0 for no FFT-B-factor smoothing)
Returns
a simple_mesh_t composed of a number of Gaussian surfaces (one for each chain)

◆ get_geman_mcclure_alpha()

float molecules_container_t::get_geman_mcclure_alpha ( ) const
inline

Get the refinement Geman-McClure alpha

Returns
the Geman-McClure alpha

◆ get_goodsell_style_mesh_instanced()

coot::instanced_mesh_t molecules_container_t::get_goodsell_style_mesh_instanced ( int imol,
float colour_wheel_rotation_step,
float saturation,
float goodselliness )

Get the Goodsell style mesh

Parameters
colour_wheel_rotation_step'the amount, in degrees, that the colour wheel advances between different chains. 97 degrees is a reasonable starting value
saturation'a number between 0 and 1, where 0 is grey and 1 is "lego-like" colour scheme. 0.5 is a nice middle value
goodsellinessis the degree to which the C-atoms are desaturated, 0.3 is a reasonable value
Returns
a instanced_mesh_t

◆ get_gphl_chem_comp_info()

std::vector< std::pair< std::string, std::string > > molecules_container_t::get_gphl_chem_comp_info ( const std::string & compound_id,
int imol_enc )

Get the GPhL extra restraint information (from the input cif file)

Parameters
compound_idis the 3-letter code for the residue/ligand in the first model, e.g. "TYR" for tyrosine
imol_encis the molecule index for the residue type/compound_id
Returns
a vector/list of string pairs that were part of a gphl_chem_comp_info. return an empty vector/list on failure to find any such info.

◆ get_group_for_monomer()

std::string molecules_container_t::get_group_for_monomer ( const std::string & residue_name) const

Get the group for a particular monomer

e.g. "NON POLYMER", "PEPTIDE", etc

Parameters
residue_nameis the is the 3-letter code for the residue, e.g. "ALA" for alanine
Returns
the group for the given residue name

◆ get_groups_for_monomers()

std::vector< std::string > molecules_container_t::get_groups_for_monomers ( const std::vector< std::string > & residue_names) const

Get the groups for a vector/list of monomers

e.g. "NON POLYMER", "PEPTIDE", etc

Parameters
residue_namesis a list of residue names, e.g. ["ALA", "TRP"]
Returns
the group for the given list of residue names

◆ get_h_bonds()

std::vector< moorhen::h_bond > molecules_container_t::get_h_bonds ( int imol,
const std::string & cid_str,
bool mcdonald_and_thornton_mode ) const

Get hydrogen bonds

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
mcdonald_and_thornton_modeturns on the McDonald & Thornton algorithm - using explicit hydrogen atoms
Returns
a vector of hydrogen bonds around the specified residue (typically a ligand)

◆ get_hb_type()

std::string molecules_container_t::get_hb_type ( const std::string & compound_id,
int imol_enc,
const std::string & atom_name ) const

Get the hydrogen bond type of a particular atom in a given residue type

Parameters
compound_idis the 3-letter code for the residue/ligand in the first model, e.g. "TYR" for tyrosine
imol_encis the molecule index for the residue type/compound_id
atom_nameis the name of the atom, e.g. "OH"
Returns
the hb_type for the given atom. On failure return an empty string. Valid types are: "HB_UNASSIGNED" ,"HB_NEITHER", "HB_DONOR", "HB_ACCEPTOR", "HB_BOTH", "HB_HYDROGEN".

◆ get_header_info()

moorhen::header_info_t molecules_container_t::get_header_info ( int imol) const

Get header info

(the header info is sparce at the moment)

Parameters
imolis the model molecule index
Returns
an object with header info.

◆ get_HOLE()

coot::instanced_mesh_t molecules_container_t::get_HOLE ( int imol,
float start_pos_x,
float start_pos_y,
float start_pos_z,
float end_pos_x,
float end_pos_y,
float end_pos_z ) const

Get HOLE

HOLE is a program for the analysis of the pore dimesions of ion channels. See Smart et al., 1996.

Returns
a list of spheres on the surface of the pore

◆ get_imol_enc_any()

int molecules_container_t::get_imol_enc_any ( ) const

Get imol_enc_any (enc: encoded)

imol_enc_any refers to the molecule number for dictionary that can be used with any molecule

Returns
the value of imol_enc_any

◆ get_interesting_places()

std::vector< coot::molecule_t::interesting_place_t > molecules_container_t::get_interesting_places ( int imol,
const std::string & mode ) const

Get interesting places

This function does not work yet

Returns
a vector/list of validation_information_t

◆ get_latest_sfcalc_stats()

coot::util::sfcalc_genmap_stats_t molecules_container_t::get_latest_sfcalc_stats ( ) const
inline

Get the latest sfcalc stats

Returns
a sfcalc_genmap_stats_t object

◆ get_ligand_distortion()

std::pair< int, double > molecules_container_t::get_ligand_distortion ( int imol,
const std::string & ligand_cid,
bool include_non_bonded_contacts )

Get ligand distortion

a more simple interface to the above

Parameters
imolis the model molecule index
selection_cidis the selection CID e.g "//A/15-23"
include_non_bonded_contactsis the flag to include non bonded contacts
Returns
a pair: the first is the status (1 for OK, 0 for failed to determine the distortion)

◆ get_ligand_validation_vs_dictionary()

std::vector< coot::geometry_distortion_info_container_t > molecules_container_t::get_ligand_validation_vs_dictionary ( int imol,
const std::string & ligand_cid,
bool include_non_bonded_contacts )

Ligand validation

Parameters
imolis the model molecule index
ligand_cidis the ligand selection CID e.g "//A/15" (ligand 15 of chain A)
include_non_bonded_contactsis the flag to include non bonded contacts
Returns
a vector/list of interesting geometry - one for each chain involved

◆ get_lsq_matrix()

lsq_results_t molecules_container_t::get_lsq_matrix ( int imol_ref,
int imol_mov,
bool summary_to_screen ) const

Get LSQ matrix

don't apply it to the coordinates

Parameters
imol_refthe reference model molecule index
imol_movthe moving model molecule index
summary_to_screenif True, write a summary of the statistics to the output
Returns
the transformation matrix in a simple class

◆ get_make_backups()

bool molecules_container_t::get_make_backups ( ) const
inline

Get the state of the backups

Returns
the backup-enabled state

◆ get_map_contours_mesh()

coot::simple_mesh_t molecules_container_t::get_map_contours_mesh ( int imol,
double position_x,
double position_y,
double position_z,
float radius,
float contour_level )

Get the mesh for the map contours

This function is not const because the internal state of a coot_molecule_t is changed.

Parameters
imolis the model molecule index
position_xis the x coordinate of the target position
position_yis the y coordinate of the target position
position_zis the z coordinate of the target position
radiusis the radius of the map, e.g. 12.0 for X-ray map and 100.0 for Cryo-EM map
contour_levele.g. 1.5 sd for X-ray, 5.0 sd for cryo-EM
Returns
a simple_mesh_t for the map contours of the specified map

◆ get_map_contours_mesh_using_other_map_for_colours()

coot::simple_mesh_t molecules_container_t::get_map_contours_mesh_using_other_map_for_colours ( int imol_ref,
int imol_map_for_colouring,
double position_x,
double position_y,
double position_z,
float radius,
float contour_level,
float other_map_for_colouring_min_value,
float other_map_for_colouring_max_value,
bool invert_colour_ramp )

Get the mesh for the map contours using another map for colouring

Parameters
imol_refis the reference map index
imol_map_for_coloringis the target map index
position_xis the x coordinate of the target position
position_yis the y coordinate of the target position
position_zis the z coordinate of the target position
radiusis the radius of the map, e.g. 12.0 for X-ray map and 100.0 for Cryo-EM map
contour_levele.g. 1.5 sd for X-ray, 5.0 sd for cryo-EM
other_map_for_colouring_min_valuee.g. -1.0 in the case of correlation map
other_map_for_colouring_max_valuee.g. 1.0 in the case of correlation map
invert_colour_rampe.g. red to blue rather than blue to red
Returns
a simple_mesh_t for the map contours of the specified map

◆ get_map_histogram()

coot::molecule_t::histogram_info_t molecules_container_t::get_map_histogram ( int imol,
unsigned int n_bins,
float zoom_factor ) const

Get map histogram

Parameters
imolis the map molecule index
n_binsis the number of bins - 200 is a reasonable default.
zoom_factor(reduces the range by the given factor) centred around the median (typically 1.0 but usefully can vary until ~20.0).
Returns
the map histogram

◆ get_map_mean()

float molecules_container_t::get_map_mean ( int imol) const

Get map mean

Parameters
imolis the map molecule index
Returns
the mean of the map or -1 if imol is not a valid map molecule index

◆ get_map_molecule_centre()

coot::util::map_molecule_centre_info_t molecules_container_t::get_map_molecule_centre ( int imol) const

Get the middle of the "molecule blob" in cryo-EM reconstruction maps

Parameters
imolis the map molecule index
Returns
a coot::util::map_molecule_centre_info_t

◆ get_map_rmsd_approx()

float molecules_container_t::get_map_rmsd_approx ( int imol_map) const

Get map rmsd approx

the function is approximate because the epsilon factor is not taken into account

Parameters
imol_mapis the map molecule index
Returns
the map rmsd. -1 is returned if imol_map is not a valid map molecule index.

◆ get_map_sampling_rate()

float molecules_container_t::get_map_sampling_rate ( )
inline

Get map sampling rate

Returns
the map sampling rate, the default is 1.8

◆ get_map_section_texture()

texture_as_floats_t molecules_container_t::get_map_section_texture ( int imol,
int section_id,
int axis,
float data_value_for_bottom,
float data_value_for_top ) const
Parameters
imolis the map molecule index
section_ide.g. 2
axise.g. 0 for X-axis, 1 for Y-axis, 2 for Z-axis

The new arguments, data_value_for_bottom, data_value_for_top should be pre-calculated (don't calculate them for every call to this function).

Returns
a texture_as_floats_t object for the given section. On failure, the image_data vector is empty.

◆ get_map_vertices_histogram()

coot::molecule_t::histogram_info_t molecules_container_t::get_map_vertices_histogram ( int imol,
int imol_map_for_sampling,
double position_x,
double position_y,
double position_z,
float radius,
float contour_level,
unsigned int n_bins )

Get map vertices histogram

Note not const because get_map_contours_mesh() is not const

Parameters
imolis the map molecule index
n_binsis the number of bins - 40 is a reasonable default.
Returns
the map vertices histogram

◆ get_map_weight()

float molecules_container_t::get_map_weight ( ) const
inline

Get the map weight

Returns
the map weight

◆ get_mean_and_variance_of_density_for_non_water_atoms()

std::pair< float, float > molecules_container_t::get_mean_and_variance_of_density_for_non_water_atoms ( int imol_coords,
int imol_map ) const

get mean and variance of map at non-waters

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
Returns
the mean and variance or a negative number on failure

◆ get_median_temperature_factor()

float molecules_container_t::get_median_temperature_factor ( int imol) const

Get the median temperature factor for the model

Parameters
imolis the model molecule index
Returns
a negative number on failure

◆ get_mesh_for_ligand_validation_vs_dictionary()

coot::simple_mesh_t molecules_container_t::get_mesh_for_ligand_validation_vs_dictionary ( int imol,
const std::string & ligand_cid )

Get the mesh for ligand validation vs dictionary, coloured by badness

Greater then 3 standard deviations is fully red. Less than 0.5 standard deviations is fully green

Parameters
imolis the model molecule index
ligand_cidis the ligand selection CID e.g "//A/15" (ligand 15 of chain A)

◆ get_missing_residue_ranges()

std::vector< coot::residue_range_t > molecules_container_t::get_missing_residue_ranges ( int imol) const

Get missing residue ranges

Parameters
imolis the model molecule index
Returns
missing residue ranges

◆ get_mmrrcc()

std::pair< std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t >, std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t > > molecules_container_t::get_mmrrcc ( int imol,
const std::string & chain_id,
unsigned int n_residue_per_residue_range,
int imol_map ) const

Calculate the MMRRCC for the residues in the chain

Multi Masked Residue Range Corellation Coefficient

Parameters
imolis the model molecule index
chain_idis the model chain_id
n_residue_per_residue_rangeis the number of residues in the residue range. 11 is a reasonable number for a smooth plot
imol_mapis the map molecule index

◆ get_molecular_representation_mesh()

coot::simple_mesh_t molecules_container_t::get_molecular_representation_mesh ( int imol,
const std::string & cid,
const std::string & colour_scheme,
const std::string & style,
int secondary_structure_usage_flag )

Get ribbon and molecular surface representation

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
colour_schemeshould be one of "colorRampChainsScheme", "colorBySecondaryScheme", "Chain"
style"Ribbon" or "MolecularSurface"
secondary_structure_usage_flag0 (USE_HEADER), 1 (DONT_USE) or 2 (CALC_SECONDARY_STRUCTURE).
Returns
a simple_mesh_t

◆ get_molecule_centre()

coot::Cartesian molecules_container_t::get_molecule_centre ( int imol) const

Get molecule centre

Parameters
imolis the model molecule index
Returns
the molecule centre

◆ get_molecule_diameter()

float molecules_container_t::get_molecule_diameter ( int imol) const

Get molecule diameter

Parameters
imolis the model molecule index
Returns
an estimate of the diameter of the model molecule (-1 on failure)

◆ get_molecule_name()

std::string molecules_container_t::get_molecule_name ( int imol) const

Get the molecule name

Parameters
imolis the model molecule index
Returns
the name of the molecule

◆ get_molecule_selection_as_json()

std::string molecules_container_t::get_molecule_selection_as_json ( int imol,
const std::string & cid ) const

Get atom selection as json

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15/OH" (atom OH in residue 15 of chain A)

◆ get_monomer()

int molecules_container_t::get_monomer ( const std::string & monomer_name)

Get a monomer

Parameters
monomer_nameis the 3-letter code of the monomer in the dictionary, e.g. "ALA" for alanine
Returns
the new molecule index on success and -1 on failure

◆ get_monomer_and_position_at()

int molecules_container_t::get_monomer_and_position_at ( const std::string & comp_id,
int imol,
float x,
float y,
float z )

Get monomer and place it at the given position for a particular molecule

Parameters
comp_idis the 3-letter code for the residue/ligand, e.g. "ALA" for alanine
imolis the model molecule index, use -999999 (IMOL_ENC_ANY) if no molecule-specific dictionary is needed
xis the x value of the target position
yis the y value of the target position
zis the z value of the target position
Returns
the new molecule index on success and -1 on failure

◆ get_monomer_from_dictionary()

int molecules_container_t::get_monomer_from_dictionary ( const std::string & comp_id,
int imol,
bool idealised_flag )

Get a monomer for a particular molecule

Parameters
comp_idis the 3-letter code for the residue/ligand, e.g. "ALA" for alanine
imolis the model molecule index, use -999999 (IMOL_ENC_ANY) if no molecule-specific dictionary is needed
idealised_flagmeans that the coordinates have been minimised with a molecular modelling minimisation algo, usually the value is True
Returns
the new molecule index on success and -1 on failure

◆ get_mutation_info()

coot::chain_mutation_info_container_t molecules_container_t::get_mutation_info ( int imol) const

Get mutation information

The reference sequece is that which has been provided using the associate_sequence() function

Parameters
imolis the model molecule index
Returns
the mismatches/mutations as insertions, deletions or mutations

◆ get_ncs_related_chains()

std::vector< std::vector< std::string > > molecules_container_t::get_ncs_related_chains ( int imol) const

Get the chains that are related by NCS or molecular symmetry

Parameters
imolis the model molecule index
Returns
a vector/list of vector/list of chain ids, e.g. [[A,C], [B,D]] (for hemoglobin).

◆ get_non_standard_residues_in_molecule()

std::vector< coot::residue_spec_t > molecules_container_t::get_non_standard_residues_in_molecule ( int imol) const

Get non-standard residues in a model

Parameters
imolis the model molecule index
Returns
a vector/list of residue specifiers - the residue name is encoded in the string_user_data data item of the residue specifier

◆ get_number_of_atoms()

unsigned int molecules_container_t::get_number_of_atoms ( int imol) const

Get number of atoms

Parameters
imolis the model molecule index
Returns
the number of atoms in the specified model, or 0 on error

◆ get_number_of_atoms_in_residue()

int molecules_container_t::get_number_of_atoms_in_residue ( int imol,
const std::string & residue_cid ) const

get the number of atoms in a given residue

Parameters
imolis the model molecule index
residue_cidis the selection CID e.g "//A/15" (residue 15 of chain A)
Returns
the number of atoms in the residue, or -1 on failure

◆ get_number_of_hydrogen_atoms()

int molecules_container_t::get_number_of_hydrogen_atoms ( int imol) const

Get number of hydrogen atoms

Parameters
imolis the model molecule index
Returns
the number of hydrogen atoms in the specified model, or -1 on error

◆ get_number_of_map_sections()

int molecules_container_t::get_number_of_map_sections ( int imol_map,
int axis_id ) const
Parameters
imol_mapis the map molecule index
axis_idis 0 for X-axis, 1 for Y-axis, 2 for Z-axis
Returns
the number of sections in the map along the given axis, -1 on failure.

◆ get_number_of_molecules()

unsigned int molecules_container_t::get_number_of_molecules ( ) const
inline

Get the number of molecules (either map or model)

Returns
the number of molecules

◆ get_octahemisphere()

coot::simple_mesh_t molecules_container_t::get_octahemisphere ( unsigned int n_divisions) const

Get octahemisphere

Parameters
n_divisionsis a number divisible by 2, at least 4 (typically 16)
Returns
a unit-vector end-cap octohemisphere mesh

◆ get_overlap_dots()

coot::atom_overlaps_dots_container_t molecules_container_t::get_overlap_dots ( int imol)
Parameters
imolis the model molecule index

◆ get_overlap_dots_for_ligand()

coot::atom_overlaps_dots_container_t molecules_container_t::get_overlap_dots_for_ligand ( int imol,
const std::string & cid_ligand )

This function not const because it can dynamically add dictionaries

Parameters
imolis the model molecule index
cid_ligandis the ligand selection CID e.g "//A/15" (ligand 15 of chain A)

◆ get_overlaps_for_ligand()

std::vector< coot::plain_atom_overlap_t > molecules_container_t::get_overlaps_for_ligand ( int imol,
const std::string & cid_ligand )

Gat Atom Overlaps for a ligand or residue.

Parameters
imolis the model molecule index
cid_ligandis the ligand selection CID e.g "//A/15" (ligand 15 of chain A)
Returns
a vector of atom overlap objects

◆ get_pucker_analysis_info()

std::string molecules_container_t::get_pucker_analysis_info ( int imol) const

get pucker info

Parameters
imolis the model molecule index
Returns
a json string or an empty string on failure

◆ get_q_score()

coot::validation_information_t molecules_container_t::get_q_score ( int imol_model,
int imol_map ) const

Get the Q Score (Pintilie et al.)

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
Returns
a validation_information_t object

◆ get_q_score_for_cid()

coot::validation_information_t molecules_container_t::get_q_score_for_cid ( int imol_model,
const std::string & cid,
int imol_map ) const

Get the Pintile et al. Q Score for a particular residue (typically a ligand)

Parameters
cidIf the cid matches more than one residue the score will be returned for all of the residues covered in the cid. Typically, of course the cid will be something like "//A/301".
Returns
a validation_information_t object

◆ get_r_factor_stats()

r_factor_stats molecules_container_t::get_r_factor_stats ( )

Get the R-factors

Returns
an object r_factor_stats

◆ get_radius_of_gyration()

double molecules_container_t::get_radius_of_gyration ( int imol) const

Get Radius of Gyration

Parameters
imolis the model molecule index
Returns
the molecule centre. If the number is less than zero, there was a problem finding the molecule or atoms.

◆ get_rama_plot_restraints_weight()

float molecules_container_t::get_rama_plot_restraints_weight ( ) const
inline

Get the Ramachandran plot restraints weight

Returns
the Ramachandran plot restraints weight

◆ get_ramachandran_validation_markup_mesh()

coot::simple_mesh_t molecules_container_t::get_ramachandran_validation_markup_mesh ( int imol) const

Get the Ramachandran validation markup mesh

20221126-PE: the function was renamed from ramachandran_validation_markup_mesh().

Parameters
imolis the model molecule index
Returns
a simple_mesh_t

◆ get_rdkit_mol_pickle_base64()

std::string molecules_container_t::get_rdkit_mol_pickle_base64 ( const std::string & residue_name,
int imol_enc )

Extract ligand restraints from the dictionary store and make an rdkit molecule Result to be eaten by C++ only.

Parameters
residue_namethe residue name
imol_encthe molecule for the ligand (typically is imol_enc_any)
Returns
an RDKit RDMol. get the 64base-encoded pickled string that represents the given residue/ligand name
Parameters
residue_namethe residue name
imol_encthe molecule for the ligand (typically is imol_enc_any)
Returns
a pickle string, return an empty string on failure.

◆ get_residue_average_position()

std::vector< double > molecules_container_t::get_residue_average_position ( int imol,
const std::string & cid ) const

Get the average residue position

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
Returns
a vector. The length of the vector is 0 on failure, otherwise it is the x,y,z values

◆ get_residue_CA_position()

std::vector< double > molecules_container_t::get_residue_CA_position ( int imol,
const std::string & cid ) const

Get the residue CA position

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
Returns
a vector. The length of the vector is 0 on failure, otherwise it is the x,y,z values

◆ get_residue_name()

std::string molecules_container_t::get_residue_name ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code ) const

Get residue name

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
Returns
the residue name, return a blank string on residue not found.

◆ get_residue_names_with_no_dictionary()

std::vector< std::string > molecules_container_t::get_residue_names_with_no_dictionary ( int imol) const

Get a list of residues that don't have a dictionary

Parameters
imolis the model molecule index
Returns
a list of residue names (compound_ids) for which there is no dictionary in the geometry store

◆ get_residue_sidechain_average_position()

std::vector< double > molecules_container_t::get_residue_sidechain_average_position ( int imol,
const std::string & cid ) const

Get the average residue side-chain position

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
Returns
a vector. The length of the vector is 0 on failure, otherwise it is the x,y,z values

◆ get_residue_type()

std::string molecules_container_t::get_residue_type ( int imol,
const std::string & cid ) const

Get the residue type

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/16" (residue 16 of chain A)
Returns
a string. Return an empty string on failure

◆ get_residue_using_cid()

mmdb::Residue * molecules_container_t::get_residue_using_cid ( int imol,
const std::string & cid ) const

get an (mmdb-style) residue

If more than one residue is selected by the selection cid, then the first residue is returned.

Don't use this in emscript.

Parameters
imolis the model molecule index
cidis the coordinate-id for the residue
Returns
either the specified residue or nullopt (None) if not found

◆ get_residues_near_residue()

std::vector< coot::residue_spec_t > molecules_container_t::get_residues_near_residue ( int imol,
const std::string & residue_cid,
float dist ) const

Get a list of residues specs that have atoms within distance of the atoms of the specified residue

Parameters
imolis the model molecule index
residue_cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
distis the distance in Angstrom
Returns
a list of residue specs

◆ get_rotamer_dodecs()

coot::simple_mesh_t molecules_container_t::get_rotamer_dodecs ( int imol)

Get the rotamer dodecs for the model

Parameters
imolis the model molecule index
Returns
a simple_mesh_t

◆ get_rotamer_dodecs_instanced()

coot::instanced_mesh_t molecules_container_t::get_rotamer_dodecs_instanced ( int imol)

Get the rotamer dodecs for the model instanced

Parameters
imolis the model molecule index
Returns
an instanced_mesh_t

◆ get_sequence_info()

std::vector< std::pair< std::string, std::string > > molecules_container_t::get_sequence_info ( int imol) const

Get the sequence information

Parameters
imolis the molecule index
Returns
the sequence information

◆ get_simple_molecule()

coot::simple::molecule_t molecules_container_t::get_simple_molecule ( int imol,
const std::string & residue_cid,
bool draw_hydrogen_atoms_flag )

Get a simple molecule

Parameters
imolis the model molecule index
residue_cidis the selection CID e.g "//A/15" (residue 15 of chain A)
draw_hydrogen_atoms_flagis the flag for drawing H atoms
Returns
a simple::molecule_t for the specified residue.

◆ get_single_letter_codes_for_chain()

std::vector< std::pair< coot::residue_spec_t, std::string > > molecules_container_t::get_single_letter_codes_for_chain ( int imol,
const std::string & chain_id ) const

Get the single letter codes for the residues in the specified chain

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
Returns
vector/list of single letter codes - in a pair with the given residue spec

◆ get_SMILES_for_residue_type()

std::string molecules_container_t::get_SMILES_for_residue_type ( const std::string & residue_name,
int imol_enc ) const

Get the SMILES string for the give residue type

Parameters
residue3 letter-code/name of the compound-id
imol_encis the molecule index for the residue type/compound_id
Returns
the SMILES string if the residue type can be found in the dictionary store or the empty string on a failure.

◆ get_spherical_variance()

float molecules_container_t::get_spherical_variance ( int imol_map,
int imol_model,
const std::string & atom_cid,
float mean_density_other_atoms ) const

Get spherical variance - typically for water atoms

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
Returns
the variance or a negative number on failure

◆ get_suggested_initial_contour_level()

float molecules_container_t::get_suggested_initial_contour_level ( int imol) const
Parameters
imolis the map molecule index
Returns
the suggested initial contour level. Return -1 on not-a-map

◆ get_sum_density_for_atoms_in_residue()

double molecules_container_t::get_sum_density_for_atoms_in_residue ( int imol,
const std::string & cid,
const std::vector< std::string > & atom_names,
int imol_map )
Returns
the sum of the density of the given atoms in the specified CID return -1001 on failure to find the residue or any atoms in the residue or if imol_map is not a map

◆ get_svg_for_2d_ligand_environment_view()

std::string molecules_container_t::get_svg_for_2d_ligand_environment_view ( int imol,
const std::string & residue_cid,
bool add_key )

Get SVG for 2d ligand environment view (FLEV)

The caller should make sure that the dictionary for the ligand has been loaded - this function won't do that. It will add hydrogen atoms if needed.

From time to time (depending on the ligand) this function will fail to produce a result.

Not const because get_monomer_restraints_at_least_minimal() is called. Hmm.

Parameters
imolis the model molecule index
residue_cidis the cid for the residue
add_keyshould a key be added to the figure?
Returns
an svg string of the representation. On failure, return an empty string.

◆ get_svg_for_residue_type()

std::string molecules_container_t::get_svg_for_residue_type ( int imol,
const std::string & comp_id,
bool use_rdkit_svg,
const std::string & background_type )

Get svg for residue type

It won't work unless the dictionary for that ligand has been imported. The native output renderings are not very good at the moment. (The RDKit renderings are pretty good).

Parameters
imolis the model molecule index, except for unusual cases, it will be IMOL_ENC_ANY (-999999)
comp_idis the 3-letter code for the residue/ligand, e.g. "ALA" for alanine
use_rdkit_svgis the flag for using the rdkit svg renderer
background_typeis one of:
  • "light-bonds/transparent-bg"
  • "light-bonds/opaque-bg"
  • "dark-bonds/transparent-bg"
  • "dark-bonds/opaque-bg"

If you want to load them into another image, you'd typicaly want "dark-bonds/transparent-bg" If you want to see ligands, e.g. in a grid or list, you'd typically want "dark-bonds/opaque-bg" which will give you a white rectangle behind the ligand figure.

This function is not const because it caches the svgs.

Returns
the string for the SVG representation.

◆ get_symmetry()

coot::symmetry_info_t molecules_container_t::get_symmetry ( int imol,
float symmetry_search_radius,
float centre_x,
float centre_y,
float centre_z ) const

Get symmetry

now comes in a simple container that also includes the cell

◆ get_temperature_factor_of_atom()

float molecules_container_t::get_temperature_factor_of_atom ( int imol,
const std::string & atom_cid ) const

Get the atom temperature factor

Parameters
imolis the model molecule index
atom_cidis the selection cid for the atom
Returns
a negative number on failure, otherwise the temperature factor

◆ get_torsion()

std::pair< int, double > molecules_container_t::get_torsion ( int imol,
const std::string & cid,
const std::vector< std::string > & atom_names )

Get the torsion of the specified atom in the specified residue

Parameters
imolis the model molecule index
cidis the selection CID, e.g. //A/15 (residue 15 in chain A)
atom_namesis a list of atom names, e.g. [" CA ", " CB ", " CG ", " CD1"]
Returns
a pair, the first of which is a succes status (1 success, 0 failure), the second is the torsion in degrees

◆ get_torsion_restraints_weight()

float molecules_container_t::get_torsion_restraints_weight ( ) const
inline

Get the torsion restraints weight

Returns
the torsion restraints weight

◆ get_use_rama_plot_restraints()

bool molecules_container_t::get_use_rama_plot_restraints ( ) const
inline

Get the state of the rama plot restraints usage in refinement

Returns
the state

◆ get_use_torsion_restraints()

bool molecules_container_t::get_use_torsion_restraints ( ) const
inline

Get the state of the rama plot restraints usage in refinement

Returns
the state

◆ get_validation_vs_dictionary_for_selection()

std::vector< coot::geometry_distortion_info_container_t > molecules_container_t::get_validation_vs_dictionary_for_selection ( int imol,
const std::string & selection_cid,
bool include_non_bonded_contacts )

General fragment distortion analysis

Parameters
imolis the model molecule index
selection_cidis the selection CID e.g "//A/15-23"
include_non_bonded_contactsis the flag to include non bonded contacts
Returns
a vector/list of interesting geometry - one for each chain involved

◆ go_to_blob()

std::pair< bool, clipper::Coord_orth > molecules_container_t::go_to_blob ( float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float contour_level )

Given a point on the front clipping plane (x1, y1, z1) and a point on the back clipping plane (x2, y2, z2) this function searches imol_refinement_map (if set) to find a the centre of a blob above the contour level. Blobs at the "front" are selected in preference to blobs at the back. If no blob is found, then the first of the pair is false. If it is found, then the second is the centre of the blob.

In future, this function should/will be provided with a list of displayed maps and their contour levels - but for now, it uses (only) imol_refinement_map.

Use a string to pass the map information (map index and contour level), something like "0 0.45:1 1.2:2 0.1"

Parameters
x1is the x point of the front clipping plane
y1is the y point of the front clipping plane
z1is the z point of the front clipping plane
x2is the x point of the back clipping plane
y2is the y point of the back clipping plane
z2is the z point of the back clipping plane

◆ import_cif_dictionary()

int molecules_container_t::import_cif_dictionary ( const std::string & cif_file_name,
int imol_enc )

Import a dictionary cif

Parameters
imol_encis used to specify to which molecule this dictionary should apply. Use IMOL_ENC_ANY to mean "it applies to all molecules." IMOL_ENC_ANY = -999999
Returns
1 on success and 0 on failure

◆ init_refinement_of_molecule_as_fragment_based_on_reference()

void molecules_container_t::init_refinement_of_molecule_as_fragment_based_on_reference ( int imol_frag,
int imol_ref,
int imol_map )

Initialise the refinement of (all of) molecule imol_frag

Parameters
imol_fragis the model molecule index of the fragment
imol_refis the model molecule index of the reference
imol_mapis the map molecule index

◆ is_a_difference_map()

bool molecules_container_t::is_a_difference_map ( int imol_map) const

Check if it the map is a difference map

Parameters
imol_mapis the map molecule index
Returns
True or False

◆ is_EM_map()

bool molecules_container_t::is_EM_map ( int imol) const

Check if a map is an EM map or not

Parameters
imolis the map molecule index
Returns
the "EM" status of this molecule. Return false on not-a-map.

◆ is_valid_map_molecule()

bool molecules_container_t::is_valid_map_molecule ( int imol_map) const

Check if the map index is valid

e.g. if the map is a model you will have an invalid map

Parameters
imol_mapis the map molecule index
Returns
True or False

◆ is_valid_model_molecule()

bool molecules_container_t::is_valid_model_molecule ( int imol) const

Check if the model index is valid

e.g. if the molecule is a map you will have an invalid model

Parameters
imolis the model molecule index
Returns
True or False

◆ jed_flip()

std::string molecules_container_t::jed_flip ( int imol,
const std::string & atom_cid,
bool invert_selection )

JED-Flip the ligand (or residue) at the specified atom

Parameters
imolis the model molecule index
atom_cidis the residue selection CID e.g "//A/15" (residue 15 of chain A)
invert_selectionis True if you want to use the larger fragment
Returns
a non-blank message if there is a problem

◆ lsq_superpose()

bool molecules_container_t::lsq_superpose ( int imol_ref,
int imol_mov )

Apply the superposition using LSQ

Parameters
imol_refthe reference model molecule index
imol_movthe moving model molecule index
Returns
the success status, i.e. whether or not there were enough atoms to superpose

◆ make_ensemble()

int molecules_container_t::make_ensemble ( const std::string & model_molecules_list)

Make a multi-model molecule given the input molecules

Parameters
model_molecules_listis a colon-separated list of molecules, (e.g. "2:3:4")
Returns
the new molecule index, -1 if no models were found in the model molecules list

◆ make_exportable_environment_bond_box()

generic_3d_lines_bonds_box_t molecules_container_t::make_exportable_environment_bond_box ( int imol,
coot::residue_spec_t & spec,
float max_dist )
Parameters
imolis the model molecule index
specis the residue specifier, e.g. residue_spec_t("A", 10, "")
max_distspecifies the maximum distance of the interaction, typically 3.8
Returns
a vector of lines for non-bonded contacts and hydrogen bonds

◆ make_mask()

int molecules_container_t::make_mask ( int imol_map_ref,
int imol_model,
const std::string & atom_selection_cid,
float radius )

Make a masked map

Parameters
imol_map_refis the map molecule index
imol_modelis the model molecule index
atom_selection_cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
radiusis the radius of the map, e.g. 12.0 for X-ray map and 100.0 for Cryo-EM map
Returns
the index of the newly created mask. Return -1 on failure.

◆ make_masked_maps_split_by_chain()

std::vector< int > molecules_container_t::make_masked_maps_split_by_chain ( int imol,
int imol_map )

Make a vector/list of maps that are split by chain-id of the input imol

Parameters
imolis the model molecule index
imol_mapis the map molecule index
Returns
a vector/list of the map molecule indices.

◆ make_mesh_for_goodsell_style_for_blender()

void molecules_container_t::make_mesh_for_goodsell_style_for_blender ( int imol,
float colour_wheel_rotation_step,
float saturation,
float goodselliness )

blender

Function for Blender interface

◆ make_mesh_for_molecular_representation_for_blender()

void molecules_container_t::make_mesh_for_molecular_representation_for_blender ( int imol,
const std::string & cid,
const std::string & colour_scheme,
const std::string & style,
int secondary_structure_usage_flag )

Function for Blender interface

Make an (internal) mesh

This function doesn't return a value, instead it stores a blender_mesh_t blender_mesh in this model. One then (shortly later) uses get_triangles_for_blender(imol) (etc) to import this mesh into blender.

@modifies internal state to fill the internal blender_mesh object

◆ make_mesh_from_gltf_file()

coot::simple_mesh_t molecules_container_t::make_mesh_from_gltf_file ( const std::string & file_name)
Parameters
file_nameis the glTF file name
Returns
a simple_mesh_t from the given file.

◆ make_power_scaled_map()

int molecules_container_t::make_power_scaled_map ( int imol_ref,
int imol_map_for_scaling )

Make a FSC-scaled map

Parameters
imol_refis the reference map molecule index
imol_map_for_scalingis the second map molecule index
Returns
the molecule index of the new map

◆ mask_map_by_atom_selection()

int molecules_container_t::mask_map_by_atom_selection ( int imol_coords,
int imol_map,
const std::string & cid,
float atom_radius,
bool invert_flag )

Mask map by atom selection

(note the argument order is reversed compared to the coot api).

Parameters
imol_coordsis the model molecule index
imol_mapis the map molecule index
cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
atom_radiusis the atom radius. Use a negative number to mean "default".
invert_flagchanges the parts of the map that are masked, so to highlight the density for a ligand one would pass the cid for the ligand and invert_flag as true, so that the parts of the map that are not the ligand are suppressed.
Returns
the index of the new map or -1 on failure

◆ match_ligand_position()

bool molecules_container_t::match_ligand_position ( int imol_ligand,
int imol_ref,
const std::string & chain_id_ref,
int resno_ref )

Match ligand positions

i.e. do a least-squares superposition of the atoms that match in the graphs of the two specified ligands - typically one would use this function after matching ligand torsions.

Parameters
imol_ligandis the ligand molecule index
imol_refis the reference model molecule index
chain_id_refis the reference chain, e.g. "A"
resno_refis the reference residue number, e.g. 12
Returns
the success status

◆ match_ligand_torsions()

bool molecules_container_t::match_ligand_torsions ( int imol_ligand,
int imol_ref,
const std::string & chain_id_ref,
int resno_ref )

Match ligand torsions

Parameters
imol_ligandis the ligand molecule index
imol_refis the reference model molecule index
chain_id_refis the reference chain, e.g. "A"
resno_refis the reference residue number, e.g. 12
Returns
the success status

◆ match_ligand_torsions_and_position()

bool molecules_container_t::match_ligand_torsions_and_position ( int imol_ligand,
int imol_ref,
const std::string & chain_id_ref,
int resno_ref )

Match ligand torsions and positions

Parameters
imol_ligandis the ligand molecule index
imol_refis the reference model molecule index
chain_id_refis the reference chain, e.g. "A"
resno_refis the reference residue number, e.g. 12
Returns
the success status.

◆ match_ligand_torsions_and_position_using_cid()

bool molecules_container_t::match_ligand_torsions_and_position_using_cid ( int imol_ligand,
int imol_ref,
const std::string & cid )

Match ligand torsions and positions using cid

Parameters
imol_ligandis the ligand molecule index
imol_refis the reference model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)

◆ merge_molecules()

std::pair< int, std::vector< merge_molecule_results_info_t > > molecules_container_t::merge_molecules ( int imol,
const std::string & list_of_other_molecules )

Merge molecules

Parameters
imolis the model molecule index
list_of_other_moleculesis a colon-separated list of molecules, e.g. "2:3:4"
Returns
the first is a flag set to 1 if a merge occurred (and 0 if it did not) the second is a vector of merge results, i.e. if you merged a ligand, what is the new residue spec of the ligand, and if you merged a (polymer) chain, what is the new chain-id of that chain.

◆ minimize()

float molecules_container_t::minimize ( int imol,
const std::string & atom_selection_cid,
int n_cycles,
bool do_rama_plot_restraints,
float rama_plot_weight,
bool do_torsion_restraints,
float torsion_weight,
bool refinement_is_quiet )
Parameters
imolis the model molecule index
atom_selection_cidis the selection CID e.g. "//A/15" (residue 15 of chain A)
n_cyclesis the number of refinement cycles. If you pass n_cycles = 100 (or some such) then you can get the mesh for the partially optimized ligand/residues
do_rama_plot_restraintsis the flag for the usage of Ramachandran plot restraints
rama_plot_weightis the flag to set the Ramachandran plot restraints weight
do_torsion_restraintsis the flag for the usage of torsion restraints
torsion_weightis the flag to set the torsion restraints weight
refinement_is_quietis used to reduce the amount of diagnostic text written to the output
Returns
the function value at termination

◆ minimize_energy()

std::pair< int, coot::instanced_mesh_t > molecules_container_t::minimize_energy ( int imol,
const std::string & atom_selection_cid,
int n_cycles,
bool do_rama_plot_restraints,
float rama_plot_weight,
bool do_torsion_restraints,
float torsion_weight,
bool refinement_is_quiet )

Minimise/optimise the geometry of the specified residue(s)

The use of "energy" should not be taken literally here

Parameters
imolis the model molecule index
atom_selection_cidis the selection CID e.g. "//A/15" (residue 15 of chain A)
n_cyclesis the number of refinement cycles. If you pass n_cycles = 100 (or some such) then you can get the mesh for the partially optimized ligand/residues
do_rama_plot_restraintsis the flag for the usage of Ramachandran plot restraints
rama_plot_weightis the flag to set the Ramachandran plot restraints weight
do_torsion_restraintsis the flag for the usage of torsion restraints
torsion_weightis the flag to set the torsion restraints weight
refinement_is_quietis used to reduce the amount of diagnostic text written to the output
Returns
the success status 1 if the minimization was performed and 0 if it was not.

◆ mmcif_tests()

int molecules_container_t::mmcif_tests ( bool last_test_only)

Testing function

a test for mmdb/gemmi/mmcif functionality

Parameters
last_test_onlyis True to mean that only that last test should be run. The default is False. This is useful to set to True while a test is being developed.
Returns
the success status: 1 means that all the tests passed.

◆ mmrrcc()

std::pair< std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t >, std::map< coot::residue_spec_t, coot::util::density_correlation_stats_info_t > > molecules_container_t::mmrrcc ( int imol,
const std::string & chain_id,
int imol_map ) const

This is a wrapper for get_mmrrcc(), using 11 for the n_residue_per_residue_range.

Multi Masked Residue Range Corellation Coefficient

Parameters
imolis the model molecule index
chain_idis the model chain_id
imol_mapis the map molecule index

◆ molecule_to_mmCIF_string()

std::string molecules_container_t::molecule_to_mmCIF_string ( int imol) const

Get the molecule as an mmCIF string

Parameters
imolis the model molecule index
Returns
the model molecule imol as a string. Return emtpy string on error

◆ molecule_to_PDB_string()

std::string molecules_container_t::molecule_to_PDB_string ( int imol) const

Get the molecule as a PDB string

Parameters
imolis the model molecule index
Returns
the model molecule imol as a string. Return emtpy string on error

◆ move_molecule_to_new_centre()

int molecules_container_t::move_molecule_to_new_centre ( int imol,
float x,
float y,
float z )

Move the molecule to the given centre

Parameters
imolis the model molecule index
xis the x coordinate of the new centre of the screen
yis the y coordinate of the new centre of the screen
zis the z coordinate of the new centre of the screen
Returns
1 on a successful move, 0 on failure.

◆ multiply_residue_temperature_factors()

void molecules_container_t::multiply_residue_temperature_factors ( int imol,
const std::string & cid,
float factor )

Interactive B-factor refinement

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
factormight typically be 0.9 or 1.1

◆ mutate()

int molecules_container_t::mutate ( int imol,
const std::string & cid,
const std::string & new_residue_type )

Mutate residue

Parameters
imolis the model molecule index
residue_cidis the residue selection CID e.g "//A/15" (residue 15 of chain A)
new_residue_typeis the 3-letter code of the new residue, e.g. "TYR" for tyrosine
Returns
1 on a successful move, 0 on failure.

◆ new_molecule()

int molecules_container_t::new_molecule ( const std::string & name)

Create an empty molecule

Returns
the index of the new molecule

◆ new_positions_for_atoms_in_residues()

int molecules_container_t::new_positions_for_atoms_in_residues ( int imol,
const std::vector< coot::api::moved_residue_t > & moved_residues )

Update the positions of the atoms in the residues

Parameters
imolis the model molecule index
moved_residueis a list of the residues with moved atoms, e.g. moved_residue_t("A", 10, "")

◆ new_positions_for_residue_atoms()

int molecules_container_t::new_positions_for_residue_atoms ( int imol,
const std::string & residue_cid,
std::vector< coot::api::moved_atom_t > & moved_atoms )

Update the positions of the atoms in the residue

Parameters
imolis the model molecule index
residue_cidis the residue selection CID e.g "//A/15" (residue 15 of chain A)
moved_atomsis a list of the atoms moved in the specified residue, e.g. moved_atom_t(" CA ", 1, 2, 3)

◆ non_standard_residue_types_in_model()

std::vector< std::string > molecules_container_t::non_standard_residue_types_in_model ( int imol) const

Get a list of non-standard residues in the given molecule

Parameters
imolis the model molecule index
Returns
a vector/list of non-standard residues

◆ package_version()

std::string molecules_container_t::package_version ( ) const

Get the package version

Returns
the package version, e.g. "1.1.11" - if this is a not yet a release version the version will end in a "+", such as "1.1.11+"

◆ pae_png()

std::string molecules_container_t::pae_png ( const std::string & pae_file_name) const

Predicted alignment error (AlphaFold)

Returns
a string of a png

◆ partition_map_by_chain()

std::vector< int > molecules_container_t::partition_map_by_chain ( int imol_map,
int imol_model )

Partition the input map

Each voxel in the map is assigned to the chain to which it is nearest. Unlike masking, the generated maps are not restricted to be "close" to the atoms in the atom selection.

e.g. maskChains for ChimeraX - JiangLab

Parameters
imol_mapis the map molecule index
imol_modelis the model molecule index
Returns
a vector/list of the molecules indices of the newly created maps

◆ pepflips_using_difference_map()

std::vector< coot::molecule_t::interesting_place_t > molecules_container_t::pepflips_using_difference_map ( int imol_coords,
int imol_difference_map,
float n_sigma ) const

Get pepflips based on the difference map

Parameters
imol_coordsis the model molecule index
imol_difference_mapis the difference map molecule index
n_sigmanumber of sd, e.g. 4.8
Returns
a vector/list of validation_information_t

◆ peptide_omega_analysis()

coot::validation_information_t molecules_container_t::peptide_omega_analysis ( int imol_model) const

Peptide omega validation information

Parameters
imol_modelis the model molecule index
Returns
an object validation_information_t

◆ print_colour_rules()

void molecules_container_t::print_colour_rules ( int imol) const

Print the colour rules

Parameters
imolis the model molecule index

◆ print_non_drawn_bonds()

void molecules_container_t::print_non_drawn_bonds ( int imol) const

Print non-drawn bonds

Parameters
imolis the model molecule index

◆ print_secondary_structure_info()

void molecules_container_t::print_secondary_structure_info ( int imol) const

Print the secondary structure information

Parameters
imolis the model molecule index

◆ r_factor_stats_as_string()

std::string molecules_container_t::r_factor_stats_as_string ( const r_factor_stats & rfs) const

Get the R factor stats as a string

Parameters
rfsis the name of the string
Returns
a string with the R-factor stats

◆ rail_points_total()

int molecules_container_t::rail_points_total ( ) const

The total rail points

Returns
the sum of all rail points accumulated since the maps were connected.

◆ ramachandran_analysis()

coot::validation_information_t molecules_container_t::ramachandran_analysis ( int imol_model) const

Get the ramachandran validation information (formatted for a graph, not 3D)

Parameters
imol_modelis the model molecule index
Returns
an object validation_information_t

◆ ramachandran_analysis_for_chain()

coot::validation_information_t molecules_container_t::ramachandran_analysis_for_chain ( int imol_model,
const std::string & chain_id ) const

Get the ramachandran validation information (formatted for a graph, not 3D) for a given chain in a given molecule

This function does not exist yet (20230127-PE)

Parameters
imol_modelis the model molecule index
chain_ide.g. "A"
Returns
an object validation_information_t

◆ ramachandran_validation()

std::vector< coot::phi_psi_prob_t > molecules_container_t::ramachandran_validation ( int imol) const

Get the data for Ramachandran validation, which importantly contains probability information

Parameters
imolis the model molecule index
Returns
a vector/list of phi_psi_prob_t

◆ read_ccp4_map()

int molecules_container_t::read_ccp4_map ( const std::string & file_name,
bool is_a_difference_map )

Read a CCP4 (or MRC) map

There is currently a size limit of 1000 pixels per edge.

Parameters
file_nameis the name of the map file
is_a_difference_mapFalse
Returns
the new molecule number or -1 on failure

◆ read_coordinates()

int molecules_container_t::read_coordinates ( const std::string & file_name)

Read a coordinates file (mmcif or PDB)

Parameters
file_nameis the name of the coordinates file
Returns
the new molecule index on success and -1 on failure

◆ read_extra_restraints()

int molecules_container_t::read_extra_restraints ( int imol,
const std::string & file_name )

Read extra restraints (e.g. from ProSMART)

Parameters
imolis the model molecule index

◆ read_mtz()

int molecules_container_t::read_mtz ( const std::string & file_name,
const std::string & f,
const std::string & phi,
const std::string & weight,
bool use_weight,
bool is_a_difference_map )

Read the given mtz file

Parameters
file_nameis the name of the MTZ file
fF column, "FWT"
phiphi column, "PHWT"
weightweight column, "W"
use_weightflag for weights usage, False
is_a_difference_mapFalse
Returns
the new molecule number or -1 on failure

◆ read_pdb()

int molecules_container_t::read_pdb ( const std::string & file_name)

Read a PDB file (or mmcif coordinates file, despite the name)

It does the same job as read_coordinates but has (perhaps) a more familiar name

Parameters
file_nameis the name of the coordinates file
Returns
the new molecule index on success and -1 on failure

◆ read_small_molecule_cif()

int molecules_container_t::read_small_molecule_cif ( const std::string & file_name)

Read a small molecule CIF file

Parameters
file_nameis the cif file-name
Returns
the new molecule index on success and -1 on failure

◆ redo()

int molecules_container_t::redo ( int imol)

Redo

Parameters
imolis the model molecule index
Returns
1 on successful redo, return 0 on failure

◆ refine()

std::pair< int, coot::instanced_mesh_t > molecules_container_t::refine ( int imol,
int n_cycles )

Run some cycles of refinement and return a mesh

That way we can see the molecule animate as it refines

Parameters
imolis the model molecule index
n_cyclesis the number of refinement cycles
Returns
a pair: the first of which is the status of the refinement: GSL_CONTINUE, GSL_SUCCESS, GSL_ENOPROG (no progress). i.e. don't call this function again unless the status is GSL_CONTINUE (-2); The second is a coot::instanced_mesh_t

◆ refine_residue_range()

int molecules_container_t::refine_residue_range ( int imol,
const std::string & chain_id,
int res_no_start,
int res_no_end,
int n_cycles )

Refine residue range

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_no_startthe starting residue number
res_no_ref_endthe ending residue number
n_cyclesis the number of refinement cycles
Returns
a value of 1 if the refinement was performed and 0 if it was not.

◆ refine_residues()

int molecules_container_t::refine_residues ( int imol,
const std::string & chain_id,
int res_no,
const std::string & ins_code,
const std::string & alt_conf,
const std::string & mode,
int n_cycles )

Refine the residues

Parameters
imolis the model molecule index
chain_ide.g. "A" for chain A
res_nois the residue number, e.g. 12
ins_codeis the insertion code, e.g. "A"
alt_confis the alternate conformation, e.g. "A" or "B"
modeis the mode of real space refinement e.g. "SINGLE", "TRIPLE", "QUINTUPLE", "HEPTUPLE", "SPHERE", "BIG_SPHERE", "CHAIN", "ALL"
n_cyclesis the number of refinement cycles
Returns
a value of 1 if the refinement was performed and 0 if it was not.

◆ refine_residues_using_atom_cid()

int molecules_container_t::refine_residues_using_atom_cid ( int imol,
const std::string & cid,
const std::string & mode,
int n_cycles )

Refine the residues using cid

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
modeis the mode of real space refinement e.g. "SINGLE", "TRIPLE", "QUINTUPLE", "HEPTUPLE", "SPHERE", "BIG_SPHERE", "CHAIN", "ALL"
n_cyclesis the number of refinement cycles
Returns
a value of 1 if the refinement was performed and 0 if it was not.

◆ regen_map()

bool molecules_container_t::regen_map ( int imol_map,
const std::string & imol_maps,
const std::vector< float > & scales )

This function does no normalisation of the scales, presuming that they are pre-normalized.

The number of maps in imol_maps should match the size of the scale vector. If not, nothing will happen and False will be returned

Parameters
imol_mapis the map molecule index
imol_mapsis a colon-separated list of map indices e.g. "2:3:4"
scalesis the list of weights corresponding to the list of maps
Returns
the success status

◆ replace_fragment()

int molecules_container_t::replace_fragment ( int imol_base,
int imol_reference,
const std::string & atom_selection )

Replace a fragment

Parameters
imol_baseis the base model index
imol_referenceis the reference model index
atom_selectionis the selection CID e.g "//A/15-17" (residue 15, 16 and 17 of chain A)
Returns
the success status

◆ replace_map_by_mtz_from_file()

int molecules_container_t::replace_map_by_mtz_from_file ( int imol,
const std::string & file_name,
const std::string & f,
const std::string & phi,
const std::string & weight,
bool use_weight )

Replace map by mtz

Parameters
imolis the map molecule index
fF column, "FWT"
phiphi column, "PHWT"
weightweight column, "W"
use_weightflag for weights usage, False

◆ replace_molecule_by_model_from_file()

void molecules_container_t::replace_molecule_by_model_from_file ( int imol,
const std::string & pdb_file_name )

Read a PDB file (or mmcif coordinates file, despite the name) to replace the current molecule

This will only work if the molecules is already a model molecule

Parameters
imolis the model molecule index
file_nameis the name of the coordinates file

◆ replace_residue()

void molecules_container_t::replace_residue ( int imol,
const std::string & residue_cid,
const std::string & new_residue_type,
int imol_enc )

Replace a residue

This has a different meaning of "replace" to replace_fragment(). In this function the atoms are not merely moved/"slotted in to place", but the residue type is changed - new atoms are introduce and others are deleted (typically).

Change the type of a residue (for example, "TYR" to "CYS") The algorithm will superpose the mainchain CA, C and N and try to set matching torsion to the angle that they were in the reference structure.

Parameters
imolis the model molecule index
residue_cidis the residue selection CID e.g "//A/15" (residue 15 of chain A)
new_residue_typeis the 3-letter code of the new residue, e.g "CYS"
imol_encis the molecule index for the residue type/compound_id

◆ residue_cid_to_residue_spec()

coot::residue_spec_t molecules_container_t::residue_cid_to_residue_spec ( int imol,
const std::string & cid ) const

Convert residue cid string to a coot residue specifier

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
Returns
the residues spec., spec.empty() is true on failure.

◆ residue_is_nucleic_acid()

bool molecules_container_t::residue_is_nucleic_acid ( int imol,
const std::string & cid ) const

Residue is nucleic acid?

Every residue in the selection is checked

Parameters
imolis the model molecule index
cidis the selection CID e.g "//A/15" (residue 15 of chain A)
Returns
a bool

◆ residues_with_missing_atoms()

std::vector< coot::residue_spec_t > molecules_container_t::residues_with_missing_atoms ( int imol)

Get residues with missing atoms

Parameters
imolis the model molecule index
Returns
an object that has information about residues without dictionaries and residues with missing atom in the the specified molecule

◆ rigid_body_fit()

int molecules_container_t::rigid_body_fit ( int imol,
const std::string & multi_cid,
int imol_map )

Rigid-body fitting

Parameters
imolis the model molecule index
multi_cidsis a "||"-separated list of residues CIDs, e.g. "//A/12-52||//A/14-15||/B/56-66"
imol_mapis the map molecule index

◆ rotamer_analysis()

coot::validation_information_t molecules_container_t::rotamer_analysis ( int imol_model) const

Get the rotamer validation information

Parameters
imol_modelis the model molecule index
Returns
an object validation_information_t

◆ rotate_around_bond()

int molecules_container_t::rotate_around_bond ( int imol,
const std::string & residue_cid,
const std::string & atom_name_1,
const std::string & atom_name_2,
const std::string & atom_name_3,
const std::string & atom_name_4,
double torsion_angle )

Rotate atoms around torsion

the bond is presumed to be between atom-2 and atom-3. Atom-1 and atom-4 are used to define the absolute torsion angle.

Parameters
imolis the model molecule index
residue_cidis the residue selection CID e.g "//A/15" (residue 15 of chain A)
atom_name_1e.g. " CA "
atom_name_2e.g. " CB "
atom_name_3e.g. " CG "
atom_name_4e.g. " CD1"
torsion_anglee.g. 12.3 degrees
Returns
status 1 if successful, 0 if not.

◆ scale_map()

void molecules_container_t::scale_map ( int imol_map,
float scale_factor )

Scale map

Parameters
imolis the model molecule index
scale_factoris the scale factor

◆ servalcat_refine_xray()

int molecules_container_t::servalcat_refine_xray ( int imol,
int imol_map,
const std::string & output_prefix )

External refinement using servalcat, using data that has already been associated.

Parameters
imolis the model molecule index
imol_mapis the map molecule index
output_prefixis the prefix of the output filename, e.g. "ref-1"
Returns
the imol of the refined model.

◆ servalcat_refine_xray_with_keywords()

int molecules_container_t::servalcat_refine_xray_with_keywords ( int imol,
int imol_map,
const std::string & output_prefix,
const nanobind::dict & key_value_pairs )

Use servalcat keywords

Parameters
imolis the model molecule index
imol_mapis the map molecule index
output_prefixis the prefix of the output filename, e.g. "ref-1"
key_value_pairsis a dictionary of key-value pairs for the servalcat keywords, e.g. resolution: 2.05
Returns
the imol of the refined model.

◆ set_add_waters_sigma_cutoff()

void molecules_container_t::set_add_waters_sigma_cutoff ( float d)
inline

Parameter for add_waters function

Parameters
dis the sigma cutoff, default is 1.75

◆ set_add_waters_variance_limit()

void molecules_container_t::set_add_waters_variance_limit ( float d)
inline

Parameter for add_waters function

Parameters
dis the variance limit, default is 0.1

◆ set_add_waters_water_to_protein_distance_lim_max()

void molecules_container_t::set_add_waters_water_to_protein_distance_lim_max ( float d)
inline

Parameter for add_waters function

Parameters
dis the max distance, default 3.4

◆ set_add_waters_water_to_protein_distance_lim_min()

void molecules_container_t::set_add_waters_water_to_protein_distance_lim_min ( float d)
inline

Parameter for add_waters function

Parameters
dis the min distance, default 2.4

◆ set_base_colour_for_bonds()

void molecules_container_t::set_base_colour_for_bonds ( int imol,
float r,
float g,
float b )

Set the base colour - to be used as a base for colour wheel rotation

RGB colour codes, e.g. green is r:0, g: 255, b:0

Parameters
imolis the model molecule index

◆ set_bespoke_carbon_atom_colour()

void molecules_container_t::set_bespoke_carbon_atom_colour ( int imol,
const coot::colour_t & col )

Set bespoke carbon atom colour

Parameters
imolis the model molecule index

◆ set_colour_wheel_rotation_base()

void molecules_container_t::set_colour_wheel_rotation_base ( int imol,
float r )

Set the colour wheel rotation base for the specified molecule (in degrees)

Parameters
imolis the model molecule index
ris the rotation angle in degrees

◆ set_draw_missing_residue_loops()

void molecules_container_t::set_draw_missing_residue_loops ( bool state)

Set the state for drawing missing loops

By default missing loops are drawn. This function allows missing loops to not be drawn. Sometimes that can clarify the representation. This is a lightweight function that sets a flag that is used by subsequent calls to get_bonds_mesh()

Parameters
stateis True to mean it is enabled

◆ set_gltf_pbr_metalicity_factor()

void molecules_container_t::set_gltf_pbr_metalicity_factor ( int imol,
float metalicity )

set the gltf PBR metalicity factor

Parameters
imolis the model molecule index
metalicityis the factor for the roughness (0.0 to 1.0)

◆ set_gltf_pbr_roughness_factor()

void molecules_container_t::set_gltf_pbr_roughness_factor ( int imol,
float roughness_factor )

set the gltf PBR roughness factor

Parameters
imolis the model molecule index
roughness_factoris the factor for the roughness (0.0 to 1.0)

◆ set_imol_refinement_map()

void molecules_container_t::set_imol_refinement_map ( int i)
inline

Set the map used for refinement and fitting

Parameters
ithe map molecule index used for refinement and fitting

◆ set_logging_file()

void molecules_container_t::set_logging_file ( const std::string & file_name)

make the logging output go to a file

Parameters
file_namethe looging file name

◆ set_logging_level()

void molecules_container_t::set_logging_level ( const std::string & level)

Control the logging

Parameters
levelis the logging level, level is either "LOW" or "HIGH" or "DEBUGGING"

◆ set_make_backups()

void molecules_container_t::set_make_backups ( bool state)
inline

Allow the user to disable/enable backups

Parameters
stateis True to mean that it is enabled. The default is True.

◆ set_map_colour()

void molecules_container_t::set_map_colour ( int imol,
float r,
float g,
float b )

Set the map colour

The next time a map mesh is requested, it will have this colour. This does not apply to/affect the colour of the difference maps.

RGB colour codes, e.g. green is r:0, g: 255, b:0

Parameters
imolis the model molecule index

◆ set_map_colour_saturation()

void molecules_container_t::set_map_colour_saturation ( int imol,
float s )

Set the map saturation

Parameters
sis the map saturation, e.g. a number between 0 and 1, where 0 is grey and 1 is "lego-like" colour scheme. 0.5 is a nice middle value

◆ set_map_is_contoured_with_thread_pool()

void molecules_container_t::set_map_is_contoured_with_thread_pool ( bool state)

Set the state of the mode of the threading in map contouring

Parameters
stateis True to mean that it is enabled. The default is True.

◆ set_map_sampling_rate()

void molecules_container_t::set_map_sampling_rate ( float msr)
inline

Set the map sampling rate

Higher numbers mean smoother maps, but they take longer to generate, longer to transfer, longer to parse and longer to draw

Parameters
msris the map sampling rate to set, the default is 1.8

◆ set_map_weight()

void molecules_container_t::set_map_weight ( float w)
inline

Set the map weight

Parameters
wthe map weight to be used for refinement, e.g. 50.0

◆ set_max_number_of_threads()

void molecules_container_t::set_max_number_of_threads ( unsigned int n_threads)

Testing function

set the maximum number of threads for both the thread pool and the vector of threads

Parameters
n_threadsis the number of threads

◆ set_max_number_of_threads_in_thread_pool()

void molecules_container_t::set_max_number_of_threads_in_thread_pool ( unsigned int n_threads)

Testing function

Deprecated name for the "set_max_number_of_threads()" function

◆ set_molecule_name()

void molecules_container_t::set_molecule_name ( int imol,
const std::string & new_name )

Set the molecule name

Parameters
imolis the model or map molecule index
new_nameis the new name of the model or map

◆ set_occupancy()

void molecules_container_t::set_occupancy ( int imol,
const std::string & cid,
float occ_new )

Set the occupancy for the given atom selection

Parameters
imolis the model molecule index
cidis the atom selection CID e.g "//A/15/OH" (atom OH in residue 15 of chain A)
occ_newis the new occupancy

◆ set_rama_plot_restraints_weight()

void molecules_container_t::set_rama_plot_restraints_weight ( float f)
inline

Set the Ramachandran plot restraints weight

Parameters
fis the weight to set, default 1.0

◆ set_refinement_geman_mcclure_alpha()

void molecules_container_t::set_refinement_geman_mcclure_alpha ( float a)
inline

Set the refinement Geman-McClure alpha

Parameters
ais the Geman-McClure alpha, e.g. 0.01

◆ set_refinement_is_verbose()

void molecules_container_t::set_refinement_is_verbose ( bool state)
inline

For debugging the refinement - write out some diagnositics - some might be useful.

API change 20240226 - this function now takes a boolean argument

Parameters
stateis True to mean that it is enabled

◆ set_residue_to_rotamer_number()

int molecules_container_t::set_residue_to_rotamer_number ( int imol,
const std::string & residue_cid,
const std::string & alt_conf,
int rotamer_number )

Change to the nth rotamer

Parameters
imolis the model molecule index
residue_cidis the atom selection CID e.g "//A/15" (all the atoms in residue 15 of chain A)
alt_confis the alternate conformation, e.g. "A" or "B"
Returns
the state of the change.

◆ set_show_timings()

void molecules_container_t::set_show_timings ( bool s)
inline

Set the show_timings flag

Various (not all) functions in this class can calculate how long they took to run. Setting this will write the time to taken (in milliseconds) to stdout.

Parameters
sis True to mean that it is enabled. The default is True.

◆ set_temperature_factors_using_cid()

void molecules_container_t::set_temperature_factors_using_cid ( int imol,
const std::string & cid,
float temp_fact )

Change the B factors

Parameters
imolis the model molecule index
cidis the selection CID, e.g. //A/15 (residue 15 in chain A)
temp_factis the isotropic ADP/temperature factor, e.g., 22

◆ set_torsion_restraints_weight()

void molecules_container_t::set_torsion_restraints_weight ( float f)
inline

Set the torsiont restraints weight

Parameters
fis the weight to set, default value is 1.0

◆ set_use_bespoke_carbon_atom_colour()

void molecules_container_t::set_use_bespoke_carbon_atom_colour ( int imol,
bool state )

Use bespoke carbon atom colour

Parameters
imolis the model molecule index

◆ set_use_gemmi()

void molecules_container_t::set_use_gemmi ( bool state)
inline

Set the state of using GEMMI for coordinates parsing

Parameters
stateis True to mean that it is enabled. The default is True.

◆ set_use_rama_plot_restraints()

void molecules_container_t::set_use_rama_plot_restraints ( bool state)
inline

Turn on or off ramachandran restraints

Parameters
stateis True to mean that it is enabled

◆ set_use_torsion_restraints()

void molecules_container_t::set_use_torsion_restraints ( bool state)
inline

Turn on or off torsion restraints

Parameters
stateis True to mean that it is enabled

◆ set_user_defined_atom_colour_by_selection()

void molecules_container_t::set_user_defined_atom_colour_by_selection ( int imol,
const std::vector< std::pair< std::string, unsigned int > > & indexed_residues_cids,
bool colour_applies_to_non_carbon_atoms_also )

Set the user-defined residue selections (CIDs) to colour index

Parameters
imolis the model molecule index

◆ sfcalc_genmap()

void molecules_container_t::sfcalc_genmap ( int imol_model,
int imol_map_with_data_attached,
int imol_updating_difference_map )

Calculate SF and re-generate maps

This is a low-level function - generally one would use the updating maps method rather than this

Parameters
imol_modelis the model molecule index
imol_map_with_data_attachedis the map index with the data have been attached by the previous function (associate_data_mtz_file_with_map)
imol_updating_difference_mapis the index of the difference map that you want to update when the model updates

◆ sfcalc_genmaps_using_bulk_solvent()

coot::util::sfcalc_genmap_stats_t molecules_container_t::sfcalc_genmaps_using_bulk_solvent ( int imol_model,
int imol_2fofc_map,
int imol_updating_difference_map,
int imol_map_with_data_attached )

Calculate SF and re-generate maps using bulk solvent

This is a low-level function. Call this function after connecting maps for updating maps to set the initial R-factor and store the initial map flatness.

Parameters
imol_modelis the model molecule index
imol_2fofc_mapis the map molecule index of the 2FO-FC map
imol_updating_difference_mapis the index of the difference map that you want to update when the model updates
imol_map_with_data_attachedis the map index with the data have been attached by the previous function (associate_data_mtz_file_with_map)
Returns
a class of interesting statistics. On failure to calculate SFs and generate the maps the returned r_factor in the returned stats will be set to -1.

◆ sharpen_blur_map()

int molecules_container_t::sharpen_blur_map ( int imol_map,
float b_factor,
bool in_place_flag )

Create a new map that is blurred/sharpened

Parameters
imolis the map molecule index
b_factore.g. 100.0
in_place_flagTrue if you want to replace the current map, False if you want to create a new map
Returns
the molecule index of the new map or -1 on failure or if in_place_flag was true.

◆ sharpen_blur_map_with_resample()

int molecules_container_t::sharpen_blur_map_with_resample ( int imol_map,
float b_factor,
float resample_factor,
bool in_place_flag )

Create a new map that is blurred/sharpened and resampling

Note that resampling can be slow, a resample_factor of 1.5 is about the limit of the trade of of prettiness for speed.

Parameters
imol_mapis the map molecule index
b_factore.g. 100.0
resample_factore.g. 1.4
in_place_flagTrue if you want to replace the current map, False if you want to create a new map
Returns
the molecule index of the new map or -1 on failure or if in_place_flag was true.

◆ shift_field_b_factor_refinement()

bool molecules_container_t::shift_field_b_factor_refinement ( int imol,
int imol_with_data_attached )

Shift-field B-factor refinement

This function presumes that the Fobs, sigFobs and RFree data have been filled in the imol_map_with_data_attached molecule

Parameters
imolis the model molecule index
imol_map_with_data_attachedis the map index with the data have been attached by the previous function (associate_data_mtz_file_with_map)
Returns
success status

◆ side_chain_180()

int molecules_container_t::side_chain_180 ( int imol,
const std::string & atom_cid )

Rotate last chi angle of the side chain by 180 degrees

Parameters
imolis the model molecule index
atom_cidis the atom selection CID e.g "//A/15/OH" (atom OH of residue 15 of chain A)
Returns
1 on a successful move, 0 on failure.

◆ split_multi_model_molecule()

std::vector< int > molecules_container_t::split_multi_model_molecule ( int imol)

Split an NMR model into multiple models

Parameters
imolis the model molecule index
Returns
the vector/list of new molecule indices

◆ split_residue_using_map()

int molecules_container_t::split_residue_using_map ( int imol,
const std::string & residue_cid,
int imol_diff_map )

Split a residue into alt-confs

do nothing if the residue already has alt-confs.

Parameters
imolthe modified model
residue_cidthe modified residue, the residue selection CID e.g "//A/15" (residue 15 of chain A)
imol_diff_mapis the difference map that is used to determine the residue split
Returns
split success status

◆ SSM_superpose()

superpose_results_t molecules_container_t::SSM_superpose ( int imol_ref,
const std::string & chain_id_ref,
int imol_mov,
const std::string & chain_id_mov )

Superposition (using SSM)

The specified chain of the moving molecule is superposed onto the chain in the reference molecule (if possible).

Parameters
imol_refthe reference model molecule index
chain_id_refthe chain ID for the reference chain
imol_movthe moving model molecule index
chain_id_movthe chain ID for the moving chain

◆ test_launching_threads()

double molecules_container_t::test_launching_threads ( unsigned int n_threads_per_batch,
unsigned int n_batches ) const

Testing function

Parameters
n_threads_per_batchis the number of threads per batch
n_batchesis the number batches
Returns
the time per batch in microseconds

◆ test_origin_cube()

coot::simple_mesh_t molecules_container_t::test_origin_cube ( ) const

Get a simple test mesh

Returns
the mesh of a unit solid cube at the origin

◆ test_the_threading()

double molecules_container_t::test_the_threading ( int n_threads)

Testing function

get the time to run a test function in milliseconds

Parameters
n_threadsis the number of threads

◆ test_thread_pool_threads()

double molecules_container_t::test_thread_pool_threads ( unsigned int n_threads)

Testing function

Parameters
n_threadsis the number of threads
Returns
time in microseconds

◆ testing_interrogate_long_term_job()

ltj_stats_t molecules_container_t::testing_interrogate_long_term_job ( )
inline

Testing function

get the stats for the long-term job

◆ testing_start_long_term_job()

void molecules_container_t::testing_start_long_term_job ( unsigned int n_seconds)

Testing function

start a long-term job.

Parameters
n_secondsis the number of seconds, if is 0, then run forever (or until interrupted)

◆ testing_stop_long_term_job()

void molecules_container_t::testing_stop_long_term_job ( )

Testing function

stop the long-term job runnning

◆ transform_map_using_lsq_matrix()

int molecules_container_t::transform_map_using_lsq_matrix ( int imol_map,
lsq_results_t lsq_matrix,
float x,
float y,
float z,
float radius )

Transform a map and create a new map

Parameters
imol_mapmap molecule index
lsq_matrixis an object of type lsq_results_t, is the object returned by get_lsq_matrix()
xis the point in the map about which the map is transformed
yis the point in the map about which the map is transformed
zis the point in the map about which the map is transformed
radiusthe radius of the transformed map, typically between 10 and 100 A
Returns
the molecule index of the new map, -1 for failure

◆ try_read_dictionaries_for_new_residue_types()

bool molecules_container_t::try_read_dictionaries_for_new_residue_types ( int imol)

Try to read the dictionaries for any residue type in imol that as yet does not have a dictionary

Parameters
imolis the model molecule index
Returns
true if there were no dictionary for new types that couldn't be read.

◆ turn_off_when_close_target_position_restraint()

void molecules_container_t::turn_off_when_close_target_position_restraint ( int imol)

Clear target_position restraint if it is (or they are) close to their target position

Parameters
imolis the model molecule index

◆ undo()

int molecules_container_t::undo ( int imol)

Undo

Parameters
imolis the model molecule index
Returns
1 on successful undo, return 0 on failure

◆ unmodelled_blobs()

std::vector< coot::molecule_t::interesting_place_t > molecules_container_t::unmodelled_blobs ( int imol_model,
int imol_map,
float rmsd_cut_off ) const

Unmodelled blobs

Parameters
imol_modelis the model molecule index
imol_mapis the map molecule index
rmsd_cut_offis the low map limit for cluster generation 1.4 is a reasonable value.
Returns
a vector/list of validation_information_t

◆ write_coordinates()

int molecules_container_t::write_coordinates ( int imol,
const std::string & file_name ) const

Write the coordinates to the given file name

Parameters
imolis the model molecule index
file_nameis the name of the new model
Returns
1 on success and 0 on failure

◆ write_map()

int molecules_container_t::write_map ( int imol,
const std::string & file_name ) const

Write a map

Parameters
imolis the map molecule index
file_nameis the name of the new map file
Returns
1 on a successful write, return 0 on failure.

◆ write_png()

void molecules_container_t::write_png ( const std::string & compound_id,
int imol,
const std::string & file_name ) const

Write a PNG for the given compound_id.

Currently this function does nothing (drawing is done with the not-allowed cairo)

Parameters
compound_idis the 3-letter code for the residue/ligand in the first model, e.g. "TYR" for tyrosine
imolis the model molecule index

Member Data Documentation

◆ imol_difference_map

int molecules_container_t::imol_difference_map

the difference map - direct access

I am not sure that this is needed - or will ever be.

◆ imol_refinement_map

int molecules_container_t::imol_refinement_map

the refinement map - direct access. When refinement is performed, this is the map that will be used. Many (indeed most) of thesee functions explicity take a map. If the map is not known by the calling function then this map can be used as the map molecule index


The documentation for this class was generated from the following file: