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
e6b1cf9f
Commit
e6b1cf9f
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
rule-based-builder: override the atom element, if it is bogus
parent
b34a477e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/conop/src/conop.cc
+9
-0
9 additions, 0 deletions
modules/conop/src/conop.cc
modules/conop/src/conop.hh
+2
-0
2 additions, 0 deletions
modules/conop/src/conop.hh
modules/conop/src/rule_based_builder.cc
+4
-4
4 additions, 4 deletions
modules/conop/src/rule_based_builder.cc
with
15 additions
and
4 deletions
modules/conop/src/conop.cc
+
9
−
0
View file @
e6b1cf9f
...
...
@@ -318,6 +318,15 @@ Real Conopology::GetDefaultAtomRadius(const String& element) const
return
it
==
ele_rad_map_
.
end
()
?
1.5
:
it
->
second
;
}
bool
Conopology
::
IsValidElement
(
const
String
&
element
)
const
{
String
upper_ele
=
element
;
std
::
transform
(
upper_ele
.
begin
(),
upper_ele
.
end
(),
upper_ele
.
begin
(),
toupper
);
std
::
map
<
String
,
Real
>::
const_iterator
it
=
ele_mass_map_
.
find
(
upper_ele
);
return
it
!=
ele_mass_map_
.
end
();
}
Real
Conopology
::
GetDefaultAtomMass
(
const
String
&
element
)
const
{
String
upper_ele
=
element
;
...
...
This diff is collapsed.
Click to expand it.
modules/conop/src/conop.hh
+
2
−
0
View file @
e6b1cf9f
...
...
@@ -53,6 +53,8 @@ public:
void
RegisterBuilder
(
const
BuilderP
&
b
,
const
String
&
name
);
void
SetDefaultBuilder
(
const
String
&
default_name
);
bool
IsValidElement
(
const
String
&
element
)
const
;
private:
Conopology
();
Conopology
(
const
Conopology
&
)
{}
...
...
This diff is collapsed.
Click to expand it.
modules/conop/src/rule_based_builder.cc
+
4
−
4
View file @
e6b1cf9f
...
...
@@ -83,11 +83,11 @@ bool RuleBasedBuilder::HasUnknownAtoms(mol::ResidueHandle res)
void
RuleBasedBuilder
::
FillAtomProps
(
mol
::
AtomHandle
atom
,
const
AtomSpec
&
spec
)
{
Conopology
&
conop_inst
=
Conopology
::
Instance
();
mol
::
AtomProp
props
=
atom
.
GetAtomProps
();
if
(
props
.
element
==
""
)
{
if
(
!
conop_inst
.
IsValidElement
(
props
.
element
)
)
{
props
.
element
=
spec
.
element
;
}
Conopology
&
conop_inst
=
Conopology
::
Instance
();
if
(
props
.
radius
==
0.0
)
{
props
.
radius
=
conop_inst
.
GetDefaultAtomRadius
(
spec
.
element
);
}
...
...
@@ -331,10 +331,10 @@ void RuleBasedBuilder::FillAtomProps(mol::AtomHandle atom)
bool
RuleBasedBuilder
::
OnUnknownAtom
(
mol
::
AtomHandle
atom
)
{
mol
::
AtomProp
props
=
atom
.
GetAtomProps
();
if
(
props
.
element
==
""
)
{
Conopology
&
conop_inst
=
Conopology
::
Instance
();
if
(
!
conop_inst
.
IsValidElement
(
props
.
element
))
{
props
.
element
=
Builder
::
GuessAtomElement
(
atom
.
GetName
(),
props
.
is_hetatm
);
}
Conopology
&
conop_inst
=
Conopology
::
Instance
();
if
(
props
.
radius
==
0.0
)
{
props
.
radius
=
conop_inst
.
GetDefaultAtomRadius
(
props
.
element
);
}
...
...
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