6#ifndef GEMMI_POLYHEUR_HPP_
7#define GEMMI_POLYHEUR_HPP_
24 return ent->polymer_type;
40 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(1.341 * 1.5);
48 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(1.6 * 1.5);
66 if (a ||
r.atoms.empty())
68 if (
const Atom* b =
r.find_by_element(el))
70 return &
r.atoms.front();
75 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(5.0);
80 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(7.5);
90 return a1->pos.dist_sq(
a2->pos) <
sq(1.341 * 1.5);
93 return a1->pos.dist_sq(
a2->pos) <
sq(5.0);
95 if (
const Atom*
a1 =
r1.get_o3prim())
97 return a1->pos.dist_sq(
a2->pos) <
sq(1.6 * 1.5);
100 return a1->pos.dist_sq(
a2->pos) <
sq(7.5);
156 if (flag !=
'R' && flag !=
'\0' && flag !=
'A' && flag !=
'H')
157 fail(
"assign_het_flags(): the only allowed values are A, H, ' ' and R");
168 [](
const Residue& res) { return res.is_water(); });
178 if (res.entity_type == EntityType::Unknown)
179 fail(
"remove_ligands_and_waters(): missing entity_type in chain ", ch.name);
180 return res.entity_type != EntityType::Polymer;
Data structures to store macromolecular structure models.
GEMMI_DLL bool trim_to_alanine(Residue &res)
GEMMI_DLL void add_microhetero_to_sequences(Structure &st, bool overwrite=false)
Modifies Entity::full_sequence. Uses only the first chain for each Entity.
GEMMI_DLL void add_entity_types(Chain &chain, bool overwrite)
Assigns entity_type=Polymer|NonPolymer|Water for each Residue (only for residues with entity_type==Un...
GEMMI_DLL void assign_subchain_names(Chain &chain, int &nonpolymer_counter)
The subchain field in the residue is where we store_atom_site.label_asym_id from mmCIF files.
void vector_remove_if(std::vector< T > &v, F &&condition)
bool have_nucleotide_bond(const Residue &r1, const Residue &r2)
bool are_connected(const Residue &r1, const Residue &r2, PolymerType ptype)
check C-N or O3'-P distance
std::vector< AtomNameElement > get_mainchain_atoms(PolymerType ptype)
GEMMI_DLL std::string make_one_letter_sequence(const ConstResidueSpan &polymer)
void remove_ligands_and_waters(T &obj)
bool in_nucleotide_bond_distance(const Atom *a1, const Atom *a2)
distance-based check for phosphodiester bond between nucleotide
bool is_polypeptide(PolymerType pt)
GEMMI_DLL PolymerType check_polymer_type(const ConstResidueSpan &span, bool ignore_entity_type=false)
void remove_waters(T &obj)
GEMMI_DLL void add_entity_ids(Structure &st, bool overwrite)
Assigns Residue::entity_id based on Residue::subchain and Entity::subchains.
PolymerType get_or_check_polymer_type(const Entity *ent, const ConstResidueSpan &polymer)
GEMMI_DLL void shorten_ccd_codes(Structure &st)
GEMMI_DLL void assign_subchains(Structure &st, bool force, bool fail_if_unknown=true)
bool in_peptide_bond_distance(const Atom *a1, const Atom *a2)
distance-based check for peptide bond
GEMMI_DLL void add_tls_group_ids(Structure &st)
bool are_connected2(const Residue &r1, const Residue &r2, PolymerType ptype)
are_connected2() is less exact, but requires only CA (or P) atoms.
GEMMI_DLL void remove_entity_types(Structure &st)
Assigns entity_type=Unknown for all residues.
bool is_polynucleotide(PolymerType pt)
constexpr float sq(float x)
bool have_peptide_bond(const Residue &r1, const Residue &r2)
bool are_connected3(const Residue &r1, const Residue &r2, PolymerType ptype)
are_connected3() = are_connected() + fallback to are_connected2()
GEMMI_DLL char recommended_het_flag(const Residue &res)
Determine ATOM/HETATM record type, based on Residue::entity_type.
void fail(const std::string &msg)
void assign_het_flags(T &obj, char flag='R')
R = recommended_het_flag(), other valid values are A, H and '\0'.
GEMMI_DLL void deduplicate_entities(Structure &st)
GEMMI_DLL void ensure_entities(Structure &st)
void setup_entities(Structure &st)
GEMMI_DLL void restore_full_ccd_codes(Structure &st)
Represents atom site in macromolecular structure (~100 bytes).
std::vector< Residue > residues
Utilities. Mostly for working with strings and vectors.