Skip to content

Commit

Permalink
residue::create_new_atom
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Apr 23, 2024
1 parent 996f1e4 commit cd1e952
Show file tree
Hide file tree
Showing 2 changed files with 357 additions and 266 deletions.
16 changes: 15 additions & 1 deletion include/cif++/model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,12 @@ class atom
std::string get_pdb_ins_code() const { return get_property("pdbx_PDB_ins_code"); } ///< Return the pdb_ins_code property

/// Return true if this atom is an alternate
bool is_alternate() const { return not get_label_alt_id().empty(); }
bool is_alternate() const
{
if (auto alt_id = get_label_alt_id(); alt_id.empty() or alt_id == ".")
return false;
return true;
}

/// Convenience method to return a string that might be ID in PDB space
std::string pdb_id() const
Expand Down Expand Up @@ -575,6 +580,10 @@ class residue
m_auth_seq_id == rhs.m_auth_seq_id);
}

/// @brief Create a new atom and add it to the list
/// @return newly created atom
virtual atom create_new_atom(atom_type inType, const std::string &inAtomID, point inLocation);

protected:
/** @cond */
residue() {}
Expand Down Expand Up @@ -675,6 +684,8 @@ class monomer : public residue
return m_polymer == rhs.m_polymer and m_index == rhs.m_index;
}

atom create_new_atom(atom_type inType, const std::string &inAtomID, point inLocation) override;

private:
const polymer *m_polymer;
std::size_t m_index;
Expand Down Expand Up @@ -1094,6 +1105,9 @@ class structure
/// \brief emplace the moved atom @a atom
atom &emplace_atom(atom &&atom);

/// \brief Reorder atom_site atoms based on 'natural' ordering
void reorder_atoms();

private:
friend polymer;
friend residue;
Expand Down
Loading

0 comments on commit cd1e952

Please sign in to comment.