6#ifndef GEMMI_POLYHEUR_HPP_
7#define GEMMI_POLYHEUR_HPP_
25 return ent->polymer_type;
41 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(1.341 * 1.5);
49 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(1.6 * 1.5);
67 if (a ||
r.atoms.empty())
69 if (
const Atom* b =
r.find_by_element(el))
71 return &
r.atoms.front();
76 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(5.0);
81 return a1 &&
a2 &&
a1->pos.dist_sq(
a2->pos) <
sq(7.5);
91 return a1->pos.dist_sq(
a2->pos) <
sq(1.341 * 1.5);
94 return a1->pos.dist_sq(
a2->pos) <
sq(5.0);
96 if (
const Atom*
a1 =
r1.get_o3prim())
98 return a1->pos.dist_sq(
a2->pos) <
sq(1.6 * 1.5);
101 return a1->pos.dist_sq(
a2->pos) <
sq(7.5);
167 [](
const Residue& res) { return res.is_water(); });
177 if (res.entity_type == EntityType::Unknown)
178 fail(
"remove_ligands_and_waters(): missing entity_type in chain ", ch.name);
179 return res.entity_type != EntityType::Polymer;
185 static const std::pair<std::string, El>
ala_atoms[6] = {
186 {
"N",
El::N}, {
"CA",
El::C}, {
"C",
El::C}, {
"O",
El::O}, {
"CB",
El::C},
189 if (res.
get_ca() ==
nullptr)
192 for (const auto& name_el : ala_atoms)
193 if (a.name == name_el.first && a.element == name_el.second)
213 for (
const OldToNew& item :
st.shortened_ccd_codes)
215 st.shortened_ccd_codes.clear();
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)
std::string make_one_letter_sequence(const ConstResidueSpan &polymer)
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)
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
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 trim_to_alanine(Residue &res)
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 void change_ccd_code(Structure &st, const std::string &old, const std::string &new_)
GEMMI_DLL ResidueInfo find_tabulated_residue(const std::string &name)
GEMMI_DLL void deduplicate_entities(Structure &st)
GEMMI_DLL void ensure_entities(Structure &st)
void setup_entities(Structure &st)
void restore_full_ccd_codes(Structure &st)
Represents atom site in macromolecular structure (~100 bytes).
std::vector< Residue > residues
ConstUniqProxy< Residue, ConstResidueSpan > first_conformer() const
helper type used for Structure::shortened_ccd_codes
const Atom * get_ca() const
std::vector< Atom > atoms