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
2d2b26f7
Unverified
Commit
2d2b26f7
authored
Apr 19, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix regression in bondmap calculation
parent
93b33af4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
src/BondMap.cpp
+8
-11
test/unit-test.cpp
+15
-2
No files found.
src/BondMap.cpp
View file @
2d2b26f7
...
...
@@ -264,29 +264,26 @@ BondMap::BondMap(const Structure &p)
// first link all residues in a polyseq
std
::
string
lastAsymID
;
std
::
string
lastAsymID
,
lastAuthSeqID
;
int
lastSeqID
=
0
;
for
(
auto
r
:
db
[
"pdbx_poly_seq_scheme"
]
)
for
(
const
auto
&
[
asymID
,
seqID
,
authSeqID
]
:
db
[
"pdbx_poly_seq_scheme"
].
rows
<
std
::
string
,
int
,
std
::
string
>
(
"asym_id"
,
"seq_id"
,
"pdb_seq_num"
)
)
{
std
::
string
asymID
;
int
seqID
;
cif
::
tie
(
asymID
,
seqID
)
=
r
.
get
(
"asym_id"
,
"seq_id"
);
if
(
asymID
!=
lastAsymID
)
// first in a new sequece
{
lastAsymID
=
asymID
;
lastSeqID
=
seqID
;
lastAuthSeqID
=
authSeqID
;
continue
;
}
auto
c
=
atomMapByAsymSeqAndAtom
[
make_tuple
(
asymID
,
lastSeqID
,
"C"
,
""
)]
;
auto
n
=
atomMapByAsymSeqAndAtom
[
make_tuple
(
asymID
,
seqID
,
"N"
,
""
)]
;
auto
c
=
atomMapByAsymSeqAndAtom
.
at
(
make_tuple
(
asymID
,
lastSeqID
,
"C"
,
lastAuthSeqID
))
;
auto
n
=
atomMapByAsymSeqAndAtom
.
at
(
make_tuple
(
asymID
,
seqID
,
"N"
,
authSeqID
))
;
if
(
not
(
c
.
empty
()
or
n
.
empty
()))
bindAtoms
(
c
,
n
);
lastSeqID
=
seqID
;
lastAuthSeqID
=
authSeqID
;
}
for
(
auto
l
:
db
[
"struct_conn"
])
...
...
@@ -301,8 +298,8 @@ BondMap::BondMap(const Structure &p)
"ptnr1_label_seq_id"
,
"ptnr2_label_seq_id"
,
"ptnr1_auth_seq_id"
,
"ptnr2_auth_seq_id"
);
std
::
string
a
=
atomMapByAsymSeqAndAtom
[
make_tuple
(
asym1
,
seqId1
,
atomId1
,
authSeqId1
)]
;
std
::
string
b
=
atomMapByAsymSeqAndAtom
[
make_tuple
(
asym2
,
seqId2
,
atomId2
,
authSeqId2
)]
;
std
::
string
a
=
atomMapByAsymSeqAndAtom
.
at
(
make_tuple
(
asym1
,
seqId1
,
atomId1
,
authSeqId1
))
;
std
::
string
b
=
atomMapByAsymSeqAndAtom
.
at
(
make_tuple
(
asym2
,
seqId2
,
atomId2
,
authSeqId2
))
;
if
(
not
(
a
.
empty
()
or
b
.
empty
()))
linkAtoms
(
a
,
b
);
}
...
...
test/unit-test.cpp
View file @
2d2b26f7
...
...
@@ -1674,6 +1674,19 @@ PRO OXT HXT SING N N 17
}
}
}
// And check the inter-aminoacid links
auto
&
poly
=
structure
.
polymers
().
front
();
for
(
size_t
i
=
0
;
i
+
1
<
poly
.
size
();
++
i
)
{
auto
C
=
poly
[
i
].
atomByID
(
"C"
);
auto
N
=
poly
[
i
+
1
].
atomByID
(
"N"
);
BOOST_CHECK
(
bm
(
C
,
N
));
BOOST_CHECK
(
bm
(
N
,
C
));
}
}
BOOST_AUTO_TEST_CASE
(
bondmap_2
)
...
...
@@ -1876,4 +1889,5 @@ boo.data_.whatever
const
auto
&
[
text
]
=
r
.
get
<
std
::
string
>
({
"text"
});
BOOST_CHECK_EQUAL
(
text
,
kS
[
i
++
].
s
);
}
}
\ No newline at end of file
}
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