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
62cd2585
Commit
62cd2585
authored
9 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
make sure, that disulfid bridge is only built to ONE other sulfur
parent
173c8fd6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/mol/mm/src/modeller.cc
+47
-31
47 additions, 31 deletions
modules/mol/mm/src/modeller.cc
with
47 additions
and
31 deletions
modules/mol/mm/src/modeller.cc
+
47
−
31
View file @
62cd2585
...
@@ -19,6 +19,32 @@
...
@@ -19,6 +19,32 @@
#include
<ost/mol/mm/modeller.hh>
#include
<ost/mol/mm/modeller.hh>
namespace
{
bool
IsCysteine
(
const
ost
::
mol
::
ResidueHandle
&
res
){
String
res_name
=
res
.
GetName
();
if
(
res_name
[
0
]
==
'C'
){
if
(
res_name
==
"CYS"
||
res_name
==
"CYX"
||
res_name
==
"CYS2"
||
res_name
==
"CYM"
){
return
true
;
}
}
return
false
;
}
bool
BoundToSG
(
const
ost
::
mol
::
AtomHandle
&
atom
){
ost
::
mol
::
AtomHandleList
bound_atoms
=
atom
.
GetBondPartners
();
for
(
ost
::
mol
::
AtomHandleList
::
iterator
i
=
bound_atoms
.
begin
();
i
!=
bound_atoms
.
end
();
++
i
){
if
(
i
->
GetResidue
()
!=
atom
.
GetResidue
())
continue
;
if
(
i
->
GetName
()
!=
"SG"
)
continue
;
if
(
IsCysteine
(
i
->
GetResidue
()))
return
true
;
}
return
false
;
}
}
namespace
ost
{
namespace
mol
{
namespace
mm
{
namespace
ost
{
namespace
mol
{
namespace
mm
{
...
@@ -29,39 +55,29 @@ void Modeller::GenerateDisulfidBonds(ost::mol::EntityHandle& handle){
...
@@ -29,39 +55,29 @@ void Modeller::GenerateDisulfidBonds(ost::mol::EntityHandle& handle){
for
(
ost
::
mol
::
ResidueHandleList
::
iterator
i
=
res_list
.
begin
();
for
(
ost
::
mol
::
ResidueHandleList
::
iterator
i
=
res_list
.
begin
();
i
!=
res_list
.
end
();
++
i
){
i
!=
res_list
.
end
();
++
i
){
if
(
i
->
GetName
()
==
"CYS"
||
i
->
GetName
()
==
"CYX"
||
i
->
GetName
()
==
"CYS2"
||
i
->
GetName
()
==
"CYM"
){
ost
::
mol
::
AtomHandle
s
=
i
->
FindAtom
(
"SG"
);
if
(
!
IsCysteine
(
*
i
))
continue
;
if
(
s
.
IsValid
()){
ost
::
mol
::
AtomHandle
s
=
i
->
FindAtom
(
"SG"
);
//quick check, whether max bond partners is already reached
if
(
!
s
.
IsValid
())
continue
;
if
(
s
.
GetBondCount
()
>=
2
)
continue
;
if
(
BoundToSG
(
s
))
continue
;
//it's already connected to another sulfur
//check, whether SG is already bound to a SG
ost
::
mol
::
AtomHandleList
bonded_atoms
=
s
.
GetBondPartners
();
//we have now a cysteine gamma-sulfur and can look around for potential
bool
already_bound
=
false
;
//disulfid bridges...
for
(
ost
::
mol
::
AtomHandleList
::
iterator
bound_it
=
bonded_atoms
.
begin
();
ost
::
mol
::
AtomHandleList
in_reach
=
handle
.
FindWithin
(
s
.
GetPos
(),
2.5
);
bound_it
!=
bonded_atoms
.
end
();
++
bound_it
){
for
(
ost
::
mol
::
AtomHandleList
::
iterator
j
=
in_reach
.
begin
();
if
(
bound_it
->
GetName
()
==
"SG"
){
j
!=
in_reach
.
end
();
++
j
){
if
(
bound_it
->
GetResidue
().
GetName
()
==
"CYS"
||
bound_it
->
GetResidue
().
GetName
()
==
"CYX"
||
if
(
j
->
GetResidue
()
!=
*
i
&&
j
->
GetName
()
==
"SG"
&&
bound_it
->
GetResidue
().
GetName
()
==
"CYS2"
||
bound_it
->
GetResidue
().
GetName
()
==
"CYM"
){
IsCysteine
(
j
->
GetResidue
())){
already_bound
=
true
;
//the other atom is a gamma-sulfur as well!
break
;
if
(
BoundToSG
(
*
j
))
continue
;
//it's already connected to another sulfur
}
if
(
!
ost
::
mol
::
BondExists
(
s
,
*
j
)){
}
ed
.
Connect
(
s
,
*
j
);
}
if
(
already_bound
)
continue
;
ost
::
mol
::
AtomHandleList
in_reach
=
handle
.
FindWithin
(
s
.
GetPos
(),
2.5
);
for
(
ost
::
mol
::
AtomHandleList
::
iterator
j
=
in_reach
.
begin
();
j
!=
in_reach
.
end
();
++
j
){
if
(
j
->
GetName
()
==
"SG"
&&
j
->
GetResidue
()
!=
*
i
){
if
(
j
->
GetBondCount
()
>=
2
)
continue
;
if
(
!
ost
::
mol
::
BondExists
(
s
,
*
j
)){
ed
.
Connect
(
s
,
*
j
);
}
ed
.
RenameResidue
(
*
i
,
"CYS2"
);
ed
.
RenameResidue
(
j
->
GetResidue
(),
"CYS2"
);
}
}
}
ed
.
RenameResidue
(
*
i
,
"CYS2"
);
ed
.
RenameResidue
(
j
->
GetResidue
(),
"CYS2"
);
break
;
//sg can only be bound to one other sg
}
}
}
}
}
}
}
}
...
...
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