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
7460007b
Unverified
Commit
7460007b
authored
Jun 14, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New strand calculations
parent
2f352826
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
0 deletions
+90
-0
include/dssp.hpp
+1
-0
src/dssp-io.cpp
+0
-0
src/dssp.cpp
+89
-0
No files found.
include/dssp.hpp
View file @
7460007b
...
@@ -172,6 +172,7 @@ class dssp
...
@@ -172,6 +172,7 @@ class dssp
std
::
tuple
<
residue_info
,
int
,
bool
>
bridge_partner
(
int
i
)
const
;
std
::
tuple
<
residue_info
,
int
,
bool
>
bridge_partner
(
int
i
)
const
;
int
sheet
()
const
;
int
sheet
()
const
;
int
strand
()
const
;
/// \brief return resinfo and the energy of the bond
/// \brief return resinfo and the energy of the bond
std
::
tuple
<
residue_info
,
double
>
acceptor
(
int
i
)
const
;
std
::
tuple
<
residue_info
,
double
>
acceptor
(
int
i
)
const
;
...
...
src/dssp-io.cpp
View file @
7460007b
This diff is collapsed.
Click to expand it.
src/dssp.cpp
View file @
7460007b
...
@@ -421,6 +421,9 @@ struct dssp::residue
...
@@ -421,6 +421,9 @@ struct dssp::residue
void
SetSheet
(
uint32_t
inSheet
)
{
mSheet
=
inSheet
;
}
void
SetSheet
(
uint32_t
inSheet
)
{
mSheet
=
inSheet
;
}
uint32_t
GetSheet
()
const
{
return
mSheet
;
}
uint32_t
GetSheet
()
const
{
return
mSheet
;
}
void
SetStrand
(
uint32_t
inStrand
)
{
mStrand
=
inStrand
;
}
uint32_t
GetStrand
()
const
{
return
mStrand
;
}
bool
IsBend
()
const
{
return
mBend
;
}
bool
IsBend
()
const
{
return
mBend
;
}
void
SetBend
(
bool
inBend
)
{
mBend
=
inBend
;
}
void
SetBend
(
bool
inBend
)
{
mBend
=
inBend
;
}
...
@@ -548,6 +551,7 @@ struct dssp::residue
...
@@ -548,6 +551,7 @@ struct dssp::residue
HBond
mHBondDonor
[
2
]
=
{},
mHBondAcceptor
[
2
]
=
{};
HBond
mHBondDonor
[
2
]
=
{},
mHBondAcceptor
[
2
]
=
{};
bridge_partner
mBetaPartner
[
2
]
=
{};
bridge_partner
mBetaPartner
[
2
]
=
{};
uint32_t
mSheet
=
0
;
uint32_t
mSheet
=
0
;
uint32_t
mStrand
=
0
;
// Added to ease the writing of mmCIF's struct_sheet and friends
helix_position_type
mHelixFlags
[
4
]
=
{
helix_position_type
::
None
,
helix_position_type
::
None
,
helix_position_type
::
None
,
helix_position_type
::
None
};
//
helix_position_type
mHelixFlags
[
4
]
=
{
helix_position_type
::
None
,
helix_position_type
::
None
,
helix_position_type
::
None
,
helix_position_type
::
None
};
//
bool
mBend
=
false
;
bool
mBend
=
false
;
chain_break_type
mChainBreak
=
chain_break_type
::
None
;
chain_break_type
mChainBreak
=
chain_break_type
::
None
;
...
@@ -1099,6 +1103,86 @@ void CalculateBetaSheets(std::vector<residue> &inResidues, statistics &stats, st
...
@@ -1099,6 +1103,86 @@ void CalculateBetaSheets(std::vector<residue> &inResidues, statistics &stats, st
inResidues
[
i
].
SetSheet
(
bridge
.
sheet
);
inResidues
[
i
].
SetSheet
(
bridge
.
sheet
);
}
}
}
}
// Construct the 'strands'
// For mmCIF output, this is needed and since we now have the information available
// it is best to do the calculation here.
// strands are ranges of residues of length > 1 that form beta bridges in a sheet.
for
(
uint32_t
iSheet
=
1
;
iSheet
<
sheet
;
++
iSheet
)
{
std
::
vector
<
std
::
tuple
<
uint32_t
,
uint32_t
>>
strands
;
for
(
auto
&
bridge
:
bridges
)
{
if
(
bridge
.
sheet
!=
iSheet
)
continue
;
for
(
auto
&
range
:
{
bridge
.
i
,
bridge
.
j
})
{
auto
imin
=
range
.
front
();
auto
imax
=
range
.
back
();
if
(
imin
==
imax
)
continue
;
if
(
imin
>
imax
)
std
::
swap
(
imin
,
imax
);
auto
ii
=
find_if
(
strands
.
begin
(),
strands
.
end
(),
[
a
=
imin
,
b
=
imax
]
(
std
::
tuple
<
uint32_t
,
uint32_t
>
&
t
)
{
auto
&&
[
start
,
end
]
=
t
;
bool
result
=
false
;
if
(
start
<=
b
and
end
>=
a
)
{
result
=
true
;
if
(
start
>
a
)
start
=
a
;
if
(
end
<
b
)
end
=
b
;
}
return
result
;
});
if
(
ii
==
strands
.
end
())
strands
.
emplace_back
(
imin
,
imax
);
}
}
std
::
sort
(
strands
.
begin
(),
strands
.
end
());
// collapse ranges that overlap
if
(
strands
.
size
()
>
1
)
{
auto
si
=
strands
.
begin
();
while
(
std
::
next
(
si
)
!=
strands
.
end
())
{
auto
&&
[
afirst
,
alast
]
=
*
si
;
auto
&&
[
bfirst
,
blast
]
=
*
(
std
::
next
(
si
));
if
(
alast
>=
bfirst
)
{
bfirst
=
afirst
;
si
=
strands
.
erase
(
si
);
continue
;
}
++
si
;
}
}
for
(
size_t
i
=
0
;
i
<
strands
.
size
();
++
i
)
{
const
auto
&
[
first
,
last
]
=
strands
[
i
];
for
(
auto
nr
=
first
;
nr
<=
last
;
++
nr
)
{
assert
(
inResidues
[
nr
].
mStrand
==
0
);
inResidues
[
nr
].
SetStrand
(
i
+
1
);
}
}
}
}
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
...
@@ -2138,6 +2222,11 @@ int dssp::residue_info::sheet() const
...
@@ -2138,6 +2222,11 @@ int dssp::residue_info::sheet() const
return
m_impl
->
GetSheet
();
return
m_impl
->
GetSheet
();
}
}
int
dssp
::
residue_info
::
strand
()
const
{
return
m_impl
->
GetStrand
();
}
std
::
tuple
<
dssp
::
residue_info
,
double
>
dssp
::
residue_info
::
acceptor
(
int
i
)
const
std
::
tuple
<
dssp
::
residue_info
,
double
>
dssp
::
residue_info
::
acceptor
(
int
i
)
const
{
{
auto
&
a
=
m_impl
->
mHBondAcceptor
[
i
];
auto
&
a
=
m_impl
->
mHBondAcceptor
[
i
];
...
...
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