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
85d7b1d5
Unverified
Commit
85d7b1d5
authored
Jun 08, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial optimisation in writeSheets
parent
e3923f46
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
src/dssp-io.cpp
+11
-20
No files found.
src/dssp-io.cpp
View file @
85d7b1d5
...
...
@@ -396,27 +396,17 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
// Each residue resides in a single strand which is part of a single sheet
// this function returns the sequence number inside the sheet for the strand
// containing res
auto
strandNrForResidue
=
[
&
strands
,
&
sheetMap
](
dssp
::
residue_info
const
&
res
)
{
for
(
const
auto
&
[
k
,
iSheet
]
:
sheetMap
)
{
int
result
=
0
;
std
::
map
<
int
,
int
>
strandMap
;
int
strandNr
=
0
;
for
(
auto
&&
[
sheet
,
strand
]
:
strands
)
{
if
(
sheet
!=
iSheet
)
continue
;
for
(
auto
&
r
:
strand
)
strandMap
[
r
.
nr
()]
=
strandNr
;
if
(
std
::
find
(
strand
.
begin
(),
strand
.
end
(),
res
)
!=
strand
.
end
())
return
result
;
++
result
;
}
++
strandNr
;
}
assert
(
false
);
return
-
1
;
};
// This map is used to record the sense of a ladder, and can be used
// to detect ladders already seen.
std
::
map
<
std
::
tuple
<
int
,
int
,
int
>
,
std
::
tuple
<
int
,
bool
>>
ladderSense
;
...
...
@@ -426,7 +416,7 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
if
(
res
.
type
()
!=
ss_type
::
Strand
)
continue
;
int
s1
=
strand
NrForResidue
(
res
)
;
int
s1
=
strand
Map
[
res
.
nr
()]
;
for
(
int
i
:
{
0
,
1
})
{
...
...
@@ -434,7 +424,7 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
if
(
not
p
or
p
.
asym_id
()
!=
res
.
asym_id
()
or
p
.
sheet
()
!=
res
.
sheet
()
or
p
.
type
()
!=
ss_type
::
Strand
)
continue
;
int
s2
=
strand
NrForResidue
(
p
)
;
int
s2
=
strand
Map
[
p
.
nr
()]
;
// assert(s1 != s2);
if
(
s2
==
s1
)
continue
;
...
...
@@ -767,8 +757,9 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
auto
&
beg
=
strand
.
front
();
auto
&
end
=
strand
.
back
();
struct_sheet_range
.
emplace
({
{
"sheet_id"
,
cif
::
cif_id_for_number
(
sheet
)
},
{
"id"
,
strandNrForResidue
(
strand
.
front
())
+
1
},
struct_sheet_range
.
emplace
({
{
"sheet_id"
,
cif
::
cif_id_for_number
(
sheet
)
},
{
"id"
,
strandMap
[
strand
.
front
().
nr
()]
+
1
},
{
"beg_label_comp_id"
,
beg
.
compound_id
()
},
{
"beg_label_asym_id"
,
beg
.
asym_id
()
},
{
"beg_label_seq_id"
,
beg
.
seq_id
()
},
...
...
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