Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
557a1c2d
Unverified
Commit
557a1c2d
authored
Oct 03, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reactivated several structure methods
parent
f77bbfed
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
97 deletions
+57
-97
.gitignore
+0
-2
include/cif++/compound.hpp
+0
-3
include/cif++/model.hpp
+55
-69
src/model.cpp
+0
-0
test/HEM.cif
+0
-0
test/model-test.cpp
+1
-22
test/unit-v2-test.cpp
+1
-1
No files found.
.gitignore
View file @
557a1c2d
...
@@ -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*
include/cif++/compound.hpp
View file @
557a1c2d
...
@@ -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 ¢reID) const;
bool
is_water
()
const
bool
is_water
()
const
{
{
...
...
include/cif++/model.hpp
View file @
557a1c2d
...
@@ -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 is
W
ater() const { return impl().mCompID == "HOH" or impl().mCompID == "H2O" or impl().mCompID == "WAT"; }
// bool is
_w
ater() 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 hasAlternateA
toms() const;
bool
has_alternate_a
toms
()
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> getAlternateID
s() const;
std
::
set
<
std
::
string
>
get_alternate_id
s
()
const
;
//
//
/ \brief Return the list of unique atom ID's
/// \brief Return the list of unique atom ID's
// std::set<std::string> getAtomID
s() const;
std
::
set
<
std
::
string
>
get_atom_id
s
()
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> centerAndR
adius() const;
std
::
tuple
<
point
,
float
>
center_and_r
adius
()
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 nrOfC
his() const;
size_t
nr_of_c
his
()
const
;
//
float chi(size_t i) const;
float
chi
(
size_t
i
)
const
;
// bool isC
is() const;
bool
is_c
is
()
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 isC
omplete() const;
bool
is_c
omplete
()
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 hasAlternateBackboneA
toms() const;
bool
has_alternate_backbone_a
toms
()
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 isBondedT
o(const monomer &rhs) const
bool
is_bonded_t
o
(
const
monomer
&
rhs
)
const
//
{
{
// return this != &rhs and areB
onded(*this, rhs);
return
this
!=
&
rhs
and
are_b
onded
(
*
this
,
rhs
);
//
}
}
// static bool areB
onded(const monomer &a, const monomer &b, float errorMargin = 0.5f);
static
bool
are_b
onded
(
const
monomer
&
a
,
const
monomer
&
b
,
float
errorMargin
=
0.5
f
);
// static bool isC
is(const monomer &a, const monomer &b);
static
bool
is_c
is
(
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 chiralV
olume() const;
float
chiral_v
olume
()
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 getAtomByL
abel(const std::string &atomID, const std::string &asymID,
atom
get_atom_by_l
abel
(
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 getAtomByP
osition(point p) const;
atom
get_atom_by_p
osition
(
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
load
D
ata
();
void
load
_d
ata
();
void
load_atoms_for_model
(
StructureOpenOptions
options
);
void
load_atoms_for_model
(
StructureOpenOptions
options
);
...
...
src/model.cpp
View file @
557a1c2d
This diff is collapsed.
Click to expand it.
test/HEM.cif
0 → 100644
View file @
557a1c2d
This diff is collapsed.
Click to expand it.
test/model-test.cpp
View file @
557a1c2d
...
@@ -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
;
...
...
test/unit-v2-test.cpp
View file @
557a1c2d
...
@@ -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
)));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment