Commit 557a1c2d by Maarten L. Hekkelman

Reactivated several structure methods

parent f77bbfed
...@@ -12,5 +12,3 @@ CMakeSettings.json ...@@ -12,5 +12,3 @@ CMakeSettings.json
msvc/ msvc/
Testing/ Testing/
rsrc/feature-request.txt rsrc/feature-request.txt
test/*.cif*
test/*.ent*
...@@ -114,9 +114,6 @@ class compound ...@@ -114,9 +114,6 @@ class compound
compound_atom get_atom_by_atom_id(const std::string &atom_id) const; compound_atom get_atom_by_atom_id(const std::string &atom_id) const;
bool atoms_bonded(const std::string &atomId_1, const std::string &atomId_2) const; bool atoms_bonded(const std::string &atomId_1, const std::string &atomId_2) const;
// float atomBondValue(const std::string &atomId_1, const std::string &atomId_2) const;
// float bondAngle(const std::string &atomId_1, const std::string &atomId_2, const std::string &atomId_3) const;
// float chiralVolume(const std::string &centreID) const;
bool is_water() const bool is_water() const
{ {
......
...@@ -303,7 +303,7 @@ class atom ...@@ -303,7 +303,7 @@ class atom
// std::string symmetry() const { return impl().mSymmetryOperator; } // std::string symmetry() const { return impl().mSymmetryOperator; }
// const compound &compound() const; // const compound &compound() const;
// bool isWater() const { return impl().mCompID == "HOH" or impl().mCompID == "H2O" or impl().mCompID == "WAT"; } // bool is_water() const { return impl().mCompID == "HOH" or impl().mCompID == "H2O" or impl().mCompID == "WAT"; }
int get_charge() const; int get_charge() const;
// float uIso() const; // float uIso() const;
...@@ -473,6 +473,10 @@ class residue ...@@ -473,6 +473,10 @@ class residue
virtual ~residue() = default; virtual ~residue() = default;
std::string get_entity_id() const;
EntityType entity_type() const;
const std::string &get_asym_id() const { return m_asym_id; } const std::string &get_asym_id() const { return m_asym_id; }
int get_seq_id() const { return m_seq_id; } int get_seq_id() const { return m_seq_id; }
...@@ -509,47 +513,29 @@ class residue ...@@ -509,47 +513,29 @@ class residue
/// \brief Unique atoms returns only the atoms without alternates and the first of each alternate atom id. /// \brief Unique atoms returns only the atoms without alternates and the first of each alternate atom id.
std::vector<atom> unique_atoms() const; std::vector<atom> unique_atoms() const;
// /// \brief The alt ID used for the unique atoms /// \brief The alt ID used for the unique atoms
// std::string unique_alt_id() const; std::string unique_alt_id() const;
atom get_atom_by_atom_id(const std::string &atomID) const; atom get_atom_by_atom_id(const std::string &atomID) const;
// const std::string &asymID() const { return m_asym_id; }
// int seqID() const { return m_seq_id; }
std::string get_entity_id() const;
EntityType entity_type() const;
// std::string authAsymID() const;
// std::string authSeqID() const;
// std::string authInsCode() const;
// // return a human readable PDB-like auth id (chain+seqnr+iCode)
// std::string authID() const;
// // similar for mmCIF space
// std::string labelID() const;
// Is this residue a single entity? // Is this residue a single entity?
bool is_entity() const; bool is_entity() const;
bool is_water() const { return m_compound_id == "HOH"; }
// bool isWater() const { return m_compound_id == "HOH"; }
// bool empty() const { return m_structure == nullptr; } // bool empty() const { return m_structure == nullptr; }
// bool hasAlternateAtoms() const; bool has_alternate_atoms() const;
// /// \brief Return the list of unique alt ID's present in this residue /// \brief Return the list of unique alt ID's present in this residue
// std::set<std::string> getAlternateIDs() const; std::set<std::string> get_alternate_ids() const;
// /// \brief Return the list of unique atom ID's /// \brief Return the list of unique atom ID's
// std::set<std::string> getAtomIDs() const; std::set<std::string> get_atom_ids() const;
// /// \brief Return the list of atoms having ID \a atomID /// \brief Return the list of atoms having ID \a atomID
// std::vector<atom> getAtomsByID(const std::string &atomID) const; std::vector<atom> get_atoms_by_id(const std::string &atomID) const;
// // some routines for 3d work // some routines for 3d work
// std::tuple<point, float> centerAndRadius() const; std::tuple<point, float> center_and_radius() const;
friend std::ostream &operator<<(std::ostream &os, const residue &res); friend std::ostream &operator<<(std::ostream &os, const residue &res);
...@@ -588,51 +574,51 @@ class monomer : public residue ...@@ -588,51 +574,51 @@ class monomer : public residue
monomer(const polymer &polymer, size_t index, int seqID, const std::string &authSeqID, monomer(const polymer &polymer, size_t index, int seqID, const std::string &authSeqID,
const std::string &compoundID); const std::string &compoundID);
// bool is_first_in_chain() const; bool is_first_in_chain() const;
// bool is_last_in_chain() const; bool is_last_in_chain() const;
// // convenience // convenience
// bool has_alpha() const; bool has_alpha() const;
// bool has_kappa() const; bool has_kappa() const;
// // Assuming this is really an amino acid... // Assuming this is really an amino acid...
// float phi() const; float phi() const;
// float psi() const; float psi() const;
// float alpha() const; float alpha() const;
// float kappa() const; float kappa() const;
// float tco() const; float tco() const;
// float omega() const; float omega() const;
// // torsion angles // torsion angles
// size_t nrOfChis() const; size_t nr_of_chis() const;
// float chi(size_t i) const; float chi(size_t i) const;
// bool isCis() const; bool is_cis() const;
// /// \brief Returns true if the four atoms C, CA, N and O are present /// \brief Returns true if the four atoms C, CA, N and O are present
// bool isComplete() const; bool is_complete() const;
// /// \brief Returns true if any of the backbone atoms has an alternate /// \brief Returns true if any of the backbone atoms has an alternate
// bool hasAlternateBackboneAtoms() const; bool has_alternate_backbone_atoms() const;
// atom CAlpha() const { return get_atom_by_atom_id("CA"); } atom CAlpha() const { return get_atom_by_atom_id("CA"); }
// atom C() const { return get_atom_by_atom_id("C"); } atom C() const { return get_atom_by_atom_id("C"); }
// atom N() const { return get_atom_by_atom_id("N"); } atom N() const { return get_atom_by_atom_id("N"); }
// atom O() const { return get_atom_by_atom_id("O"); } atom O() const { return get_atom_by_atom_id("O"); }
// atom H() const { return get_atom_by_atom_id("H"); } atom H() const { return get_atom_by_atom_id("H"); }
// bool isBondedTo(const monomer &rhs) const bool is_bonded_to(const monomer &rhs) const
// { {
// return this != &rhs and areBonded(*this, rhs); return this != &rhs and are_bonded(*this, rhs);
// } }
// static bool areBonded(const monomer &a, const monomer &b, float errorMargin = 0.5f); static bool are_bonded(const monomer &a, const monomer &b, float errorMargin = 0.5f);
// static bool isCis(const monomer &a, const monomer &b); static bool is_cis(const monomer &a, const monomer &b);
// static float omega(const monomer &a, const monomer &b); static float omega(const monomer &a, const monomer &b);
// // for LEU and VAL // for LEU and VAL
// float chiralVolume() const; float chiral_volume() const;
bool operator==(const monomer &rhs) const bool operator==(const monomer &rhs) const
{ {
...@@ -821,11 +807,11 @@ class structure ...@@ -821,11 +807,11 @@ class structure
atom get_atom_by_id(const std::string &id) const; atom get_atom_by_id(const std::string &id) const;
// atom getAtomByLocation(point pt, float maxDistance) const; // atom getAtomByLocation(point pt, float maxDistance) const;
// atom getAtomByLabel(const std::string &atomID, const std::string &asymID, atom get_atom_by_label(const std::string &atomID, const std::string &asymID,
// const std::string &compID, int seqID, const std::string &altID = ""); const std::string &compID, int seqID, const std::string &altID = "");
// /// \brief Return the atom closest to point \a p // /// \brief Return the atom closest to point \a p
// atom getAtomByPosition(point p) const; atom get_atom_by_position(point p) const;
/// \brief Return the atom closest to point \a p with atom type \a type in a residue of type \a res_type /// \brief Return the atom closest to point \a p with atom type \a type in a residue of type \a res_type
atom get_atom_by_position_and_type(point p, std::string_view type, std::string_view res_type) const; atom get_atom_by_position_and_type(point p, std::string_view type, std::string_view res_type) const;
...@@ -968,7 +954,7 @@ class structure ...@@ -968,7 +954,7 @@ class structure
std::string create_entity_for_branch(branch &branch); std::string create_entity_for_branch(branch &branch);
void loadData(); void load_data();
void load_atoms_for_model(StructureOpenOptions options); void load_atoms_for_model(StructureOpenOptions options);
......
This diff is collapsed. Click to expand it.
...@@ -190,27 +190,6 @@ _struct_asym.details ? ...@@ -190,27 +190,6 @@ _struct_asym.details ?
} }
} }
// // --------------------------------------------------------------------
// BOOST_AUTO_TEST_CASE(test_load_1)
// {
// cif::file cf(gTestDir / "5v3g.cif.gz");
// cif::mm::structure s(cf);
// for (auto &poly : s.polymers())
// {
// std::cout << std::string(80, '=') << std::endl;
// for (auto &res : poly)
// {
// std::cout << res << std::endl;
// for (auto &atom : res.atoms())
// std::cout << " " << atom << std::endl;
// }
// }
// }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(test_atom_id) BOOST_AUTO_TEST_CASE(test_atom_id)
...@@ -323,7 +302,7 @@ BOOST_AUTO_TEST_CASE(atom_numbers_1) ...@@ -323,7 +302,7 @@ BOOST_AUTO_TEST_CASE(atom_numbers_1)
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
BOOST_AUTO_TEST_CASE(test_load_1) BOOST_AUTO_TEST_CASE(test_load_2)
{ {
using namespace cif::literals; using namespace cif::literals;
......
...@@ -1672,7 +1672,7 @@ _cat_2.parent_id_2 ...@@ -1672,7 +1672,7 @@ _cat_2.parent_id_2
BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 2))); BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 2)));
BOOST_CHECK(not cat2.has_parents(cat2.find1("id"_key == 3))); BOOST_CHECK(not cat2.has_parents(cat2.find1("id"_key == 3)));
BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 4))); BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 4)));
BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 5))); BOOST_CHECK(not cat2.has_parents(cat2.find1("id"_key == 5)));
BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 6))); BOOST_CHECK( cat2.has_parents(cat2.find1("id"_key == 6)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment