Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
4097891f
Commit
4097891f
authored
1 year ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Ignore invalid atoms in brnach links of the mmCIF foemat.
parent
ebf924d9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/io/src/mol/mmcif_info.cc
+6
-0
6 additions, 0 deletions
modules/io/src/mol/mmcif_info.cc
modules/io/tests/test_mmcif_info.cc
+11
-4
11 additions, 4 deletions
modules/io/tests/test_mmcif_info.cc
with
17 additions
and
4 deletions
modules/io/src/mol/mmcif_info.cc
+
6
−
0
View file @
4097891f
...
...
@@ -207,6 +207,12 @@ void MMCifInfo::AddEntityBranchLink(String chain_name,
mol
::
AtomHandle
atom2
,
unsigned
char
bond_order
)
{
if
(
!
atom1
.
IsValid
()
||
!
atom2
.
IsValid
())
{
/* Would love to give details about the atoms... but atom names are not
available at this point. */
LOG_WARNING
(
"Invalid branch link found in chain '"
+
chain_name
+
"'."
);
return
;
}
// check if element already exists
MMCifInfoEntityBranchLinkMap
::
iterator
blm_it
=
entity_branches_
.
find
(
chain_name
);
...
...
This diff is collapsed.
Click to expand it.
modules/io/tests/test_mmcif_info.cc
+
11
−
4
View file @
4097891f
...
...
@@ -341,16 +341,23 @@ BOOST_AUTO_TEST_CASE(mmcif_info)
mol
::
ResidueHandle
res11
=
editor
.
AppendResidue
(
ch1
,
"NAG"
);
mol
::
ResidueHandle
res12
=
editor
.
AppendResidue
(
ch1
,
"NAG"
);
// create AtomHandles for testing
mol
::
AtomHandle
atom11
=
editor
.
InsertAtom
(
res12
,
"C1"
,
geom
::
Vec3
());
mol
::
AtomHandle
atom12
=
editor
.
InsertAtom
(
res11
,
"O4"
,
geom
::
Vec3
());
mol
::
AtomHandle
atom11
=
editor
.
InsertAtom
(
res12
,
"C1"
,
geom
::
Vec3
());
mol
::
AtomHandle
atom12
=
editor
.
InsertAtom
(
res11
,
"O4"
,
geom
::
Vec3
());
mol
::
ChainHandle
ch2
=
editor
.
InsertChain
(
"B"
);
mol
::
ResidueHandle
res21
=
editor
.
AppendResidue
(
ch2
,
"BMA"
);
mol
::
ResidueHandle
res22
=
editor
.
AppendResidue
(
ch2
,
"MAN"
);
// create AtomHandles for testing
mol
::
AtomHandle
atom21
=
editor
.
InsertAtom
(
res22
,
"C1"
,
geom
::
Vec3
());
mol
::
AtomHandle
atom22
=
editor
.
InsertAtom
(
res21
,
"O3"
,
geom
::
Vec3
());
mol
::
AtomHandle
atom21
=
editor
.
InsertAtom
(
res22
,
"C1"
,
geom
::
Vec3
());
mol
::
AtomHandle
atom22
=
editor
.
InsertAtom
(
res21
,
"O3"
,
geom
::
Vec3
());
// create invalid AtomHandle pairs for testing
mol
::
AtomHandle
atom_invalid
;
info
.
AddEntityBranchLink
(
ch1
.
GetName
(),
atom11
,
atom12
,
1
);
info
.
AddEntityBranchLink
(
ch2
.
GetName
(),
atom21
,
atom22
,
1
);
/* Sometimes branched PDB entries link two atoms which are available in the
compound's definition but not resolved (missing) in the coordinates, e.g.
RCSB entry 7zim. Check that in case of invalid atom, no link is created. */
info
.
AddEntityBranchLink
(
ch2
.
GetName
(),
atom11
,
atom_invalid
,
1
);
info
.
AddEntityBranchLink
(
ch2
.
GetName
(),
atom_invalid
,
atom12
,
1
);
std
::
vector
<
MMCifInfoEntityBranchLink
>
blinks
=
info
.
GetEntityBranchLinks
();
BOOST_CHECK
(
blinks
.
size
()
==
2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment