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
e939008d
Commit
e939008d
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
also read element column in charmm pdb import mode
parent
27553450
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/io/src/mol/pdb_reader.cc
+17
-19
17 additions, 19 deletions
modules/io/src/mol/pdb_reader.cc
with
17 additions
and
19 deletions
modules/io/src/mol/pdb_reader.cc
+
17
−
19
View file @
e939008d
...
...
@@ -456,26 +456,24 @@ void PDBReader::ParseAndAddAtom(const StringRef& line, int line_num,
}
LOG_TRACE
(
"line: ["
<<
line
<<
"]"
);
String
s_ele
;
if
(
!
(
PDB
::
Flags
()
&
PDB
::
CHARMM_FORMAT
))
{
// determine element from element column (77-78, right justified) if
// present otherwise set to empty String. It is up to the builder to
// determine the correct element in that case.
if
(
line
.
length
()
>=
78
)
{
// element column present
if
(
line
[
76
]
==
' '
&&
line
[
77
]
==
' '
)
{
// both characters are empty
s_ele
=
""
;
}
else
if
(
line
[
76
]
!=
' '
||
line
[
77
]
!=
' '
)
{
// at least one character not
// empty
if
(
line
[
76
]
==
' '
&&
line
[
77
]
!=
' '
)
{
// single character element,
// right justified
s_ele
=
line
.
substr
(
77
,
1
).
str
();
}
else
if
(
line
[
76
]
!=
' '
&&
line
[
77
]
==
' '
)
{
// single character element,
// left justified
s_ele
=
line
.
substr
(
76
,
1
).
str
();
}
else
{
// Real character element
s_ele
=
line
.
substr
(
76
,
2
).
str
();
}
// determine element from element column (77-78, right justified) if
// present otherwise set to empty String. It is up to the builder to
// determine the correct element in that case.
if
(
line
.
length
()
>=
78
)
{
// element column present
if
(
line
[
76
]
==
' '
&&
line
[
77
]
==
' '
)
{
// both characters are empty
s_ele
=
""
;
}
else
if
(
line
[
76
]
!=
' '
||
line
[
77
]
!=
' '
)
{
// at least one character not
// empty
if
(
line
[
76
]
==
' '
&&
line
[
77
]
!=
' '
)
{
// single character element,
// right justified
s_ele
=
line
.
substr
(
77
,
1
).
str
();
}
else
if
(
line
[
76
]
!=
' '
&&
line
[
77
]
==
' '
)
{
// single character element,
// left justified
s_ele
=
line
.
substr
(
76
,
1
).
str
();
}
else
{
// Real character element
s_ele
=
line
.
substr
(
76
,
2
).
str
();
}
}
}
}
String
aname
(
atom_name
.
str
());
// some postprocessing
...
...
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