Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dssp
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
dssp
Commits
f69c8c2b
Unverified
Commit
f69c8c2b
authored
Jun 07, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid writing duplicate sheets
parent
c37975ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/dssp-io.cpp
+8
-3
No files found.
src/dssp-io.cpp
View file @
f69c8c2b
...
@@ -359,7 +359,7 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
...
@@ -359,7 +359,7 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
if
(
not
sheetMap
.
count
(
sheetID
))
if
(
not
sheetMap
.
count
(
sheetID
))
sheetMap
[
sheetID
]
=
static_cast
<
int
>
(
sheetMap
.
size
());
sheetMap
[
sheetID
]
=
static_cast
<
int
>
(
sheetMap
.
size
());
strands
.
emplace_back
(
s
td
::
make_tuple
(
sheetMap
[
sheetID
],
res_list
{
res
})
);
strands
.
emplace_back
(
s
heetMap
[
sheetID
],
res_list
{
res
}
);
}
}
// sort the strands vector
// sort the strands vector
...
@@ -379,10 +379,15 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
...
@@ -379,10 +379,15 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
int
lastSheet
=
-
1
;
int
lastSheet
=
-
1
;
for
(
const
auto
&
[
sheetNr
,
strand
]
:
strands
)
for
(
const
auto
&
[
sheetNr
,
strand
]
:
strands
)
{
{
if
(
sheetNr
!=
lastSheet
)
if
(
sheetNr
==
lastSheet
)
continue
;
auto
id
=
cif
::
cif_id_for_number
(
sheetNr
);
if
(
not
struct_sheet
.
exists
(
cif
::
key
(
"id"
)
==
id
))
{
{
struct_sheet
.
emplace
({
struct_sheet
.
emplace
({
{
"id"
,
cif
::
cif_id_for_number
(
sheetNr
)
},
{
"id"
,
id
},
{
"number_strands"
,
{
"number_strands"
,
std
::
count_if
(
strands
.
begin
(),
strands
.
end
(),
[
nr
=
sheetNr
](
std
::
tuple
<
int
,
res_list
>
const
&
s
)
std
::
count_if
(
strands
.
begin
(),
strands
.
end
(),
[
nr
=
sheetNr
](
std
::
tuple
<
int
,
res_list
>
const
&
s
)
{
return
std
::
get
<
0
>
(
s
)
==
nr
;
})
{
return
std
::
get
<
0
>
(
s
)
==
nr
;
})
...
...
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