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
8fc60a0c
Commit
8fc60a0c
authored
11 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
fix rule-based conop with strict_hydrogens=false
parent
07ad0998
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/conop/src/processor.cc
+8
-19
8 additions, 19 deletions
modules/conop/src/processor.cc
modules/conop/src/rule_based.cc
+11
-1
11 additions, 1 deletion
modules/conop/src/rule_based.cc
with
19 additions
and
20 deletions
modules/conop/src/processor.cc
+
8
−
19
View file @
8fc60a0c
...
@@ -290,15 +290,6 @@ void Processor::ConnectAtomsOfResidue(mol::ResidueHandle rh,
...
@@ -290,15 +290,6 @@ void Processor::ConnectAtomsOfResidue(mol::ResidueHandle rh,
CompoundPtr
compound
,
CompoundPtr
compound
,
bool
strict_hydrogens
)
const
bool
strict_hydrogens
)
const
{
{
//if (!compound) {
// dist_connect(this, rh.GetAtomList());
// return;
//}
//if (unknown_atoms_) {
// dist_connect(this, rh.GetAtomList());
// return;
//}
mol
::
XCSEditor
e
=
rh
.
GetEntity
().
EditXCS
(
mol
::
BUFFERED_EDIT
);
mol
::
XCSEditor
e
=
rh
.
GetEntity
().
EditXCS
(
mol
::
BUFFERED_EDIT
);
BondSpecList
::
const_iterator
j
=
compound
->
GetBondSpecs
().
begin
();
BondSpecList
::
const_iterator
j
=
compound
->
GetBondSpecs
().
begin
();
mol
::
AtomHandleList
atoms
=
rh
.
GetAtomList
();
mol
::
AtomHandleList
atoms
=
rh
.
GetAtomList
();
...
@@ -307,18 +298,16 @@ void Processor::ConnectAtomsOfResidue(mol::ResidueHandle rh,
...
@@ -307,18 +298,16 @@ void Processor::ConnectAtomsOfResidue(mol::ResidueHandle rh,
mol
::
AtomHandle
a1
=
this
->
LocateAtom
(
atoms
,
bond
.
atom_one
);
mol
::
AtomHandle
a1
=
this
->
LocateAtom
(
atoms
,
bond
.
atom_one
);
mol
::
AtomHandle
a2
=
this
->
LocateAtom
(
atoms
,
bond
.
atom_two
);
mol
::
AtomHandle
a2
=
this
->
LocateAtom
(
atoms
,
bond
.
atom_two
);
if
(
a1
.
IsValid
()
&&
a2
.
IsValid
())
{
if
(
a1
.
IsValid
()
&&
a2
.
IsValid
())
{
if
(
!
strict_hydrogens
&&
(
a1
.
GetElement
()
==
"H"
||
a1
.
GetElement
()
==
"D"
||
a2
.
GetElement
()
==
"H"
||
a2
.
GetElement
()
==
"D"
))
{
continue
;
}
if
(
!
this
->
GetCheckBondFeasibility
())
{
if
(
!
this
->
GetCheckBondFeasibility
())
{
if
(
strict_hydrogens
&&
(
a1
.
GetElement
()
==
"H"
||
a2
.
GetElement
()
==
"D"
))
{
continue
;
}
e
.
Connect
(
a1
,
a2
,
bond
.
order
);
e
.
Connect
(
a1
,
a2
,
bond
.
order
);
}
else
{
}
else
{
if
(
IsBondFeasible
(
a1
,
a2
))
{
if
(
IsBondFeasible
(
a1
,
a2
))
{
if
(
strict_hydrogens
&&
(
a1
.
GetElement
()
==
"H"
||
a2
.
GetElement
()
==
"D"
))
{
continue
;
}
e
.
Connect
(
a1
,
a2
,
bond
.
order
);
e
.
Connect
(
a1
,
a2
,
bond
.
order
);
}
}
}
}
...
@@ -405,8 +394,8 @@ void Processor::DistanceBasedConnect(mol::AtomHandle atom) const
...
@@ -405,8 +394,8 @@ void Processor::DistanceBasedConnect(mol::AtomHandle atom) const
e
=
alist
.
end
();
it
!=
e
;
++
it
)
{
e
=
alist
.
end
();
it
!=
e
;
++
it
)
{
if
(
*
it
!=
atom
)
{
if
(
*
it
!=
atom
)
{
if
(
IsBondFeasible
(
atom
,
*
it
))
{
if
(
IsBondFeasible
(
atom
,
*
it
))
{
if
(
Processor
::
AreResiduesConsecutive
(
res_a
,
it
->
GetResidue
()
)
||
if
(
it
->
GetResidue
()
==
res_a
||
it
->
GetResidue
()
==
res_a
)
{
Processor
::
AreResiduesConsecutive
(
res_a
,
it
->
GetResidue
()))
{
editor
.
Connect
(
*
it
,
atom
);
editor
.
Connect
(
*
it
,
atom
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
modules/conop/src/rule_based.cc
+
11
−
1
View file @
8fc60a0c
...
@@ -47,7 +47,7 @@ void RuleBasedProcessor::DoProcess(DiagnosticsPtr diags,
...
@@ -47,7 +47,7 @@ void RuleBasedProcessor::DoProcess(DiagnosticsPtr diags,
mol
::
ResidueHandle
residue
=
*
j
;
mol
::
ResidueHandle
residue
=
*
j
;
mol
::
AtomHandleList
atoms_to_connect
;
mol
::
AtomHandleList
atoms_to_connect
;
CompoundPtr
compound
=
lib_
->
FindCompound
(
residue
.
GetName
(),
Compound
::
PDB
);
CompoundPtr
compound
=
lib_
->
FindCompound
(
residue
.
GetName
(),
Compound
::
PDB
);
if
(
!
compound
)
{
if
(
!
compound
&&
this
->
GetConnect
()
)
{
// process unknown residue...
// process unknown residue...
this
->
ProcessUnkResidue
(
diags
,
residue
,
atoms_to_connect
);
this
->
ProcessUnkResidue
(
diags
,
residue
,
atoms_to_connect
);
for
(
mol
::
AtomHandleList
::
iterator
k
=
atoms_to_connect
.
begin
(),
for
(
mol
::
AtomHandleList
::
iterator
k
=
atoms_to_connect
.
begin
(),
...
@@ -79,6 +79,16 @@ void RuleBasedProcessor::DoProcess(DiagnosticsPtr diags,
...
@@ -79,6 +79,16 @@ void RuleBasedProcessor::DoProcess(DiagnosticsPtr diags,
e3
=
atoms_to_connect
.
end
();
k
!=
e3
;
++
k
)
{
e3
=
atoms_to_connect
.
end
();
k
!=
e3
;
++
k
)
{
this
->
DistanceBasedConnect
(
*
k
);
this
->
DistanceBasedConnect
(
*
k
);
}
}
if
(
!
this
->
GetStrictHydrogens
())
{
mol
::
AtomHandleList
atoms
=
residue
.
GetAtomList
();
for
(
mol
::
AtomHandleList
::
iterator
k
=
atoms
.
begin
(),
e3
=
atoms
.
end
();
k
!=
e3
;
++
k
)
{
const
String
&
ele
=
k
->
GetElement
();
if
((
ele
==
"D"
||
ele
==
"H"
)
&&
k
->
GetBondCount
()
==
0
)
{
this
->
DistanceBasedConnect
(
*
k
);
}
}
}
}
}
prev
=
residue
;
prev
=
residue
;
}
}
...
...
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