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
6c65a3dd
Commit
6c65a3dd
authored
11 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Write ***** in TER records in case serial number > 99999
parent
5ad3bb38
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/io/src/mol/pdb_writer.cc
+14
-7
14 additions, 7 deletions
modules/io/src/mol/pdb_writer.cc
with
14 additions
and
7 deletions
modules/io/src/mol/pdb_writer.cc
+
14
−
7
View file @
6c65a3dd
...
...
@@ -78,6 +78,18 @@ bool atom_pos_ok(geom::Vec3 p) {
}
return
true
;
}
// write the serial field for ATOM and TER records, use '*****' for
// indexes > 99999 (borrowed from charmm)
void
write_serial
(
int
serial
,
FormattedLine
&
line
)
{
// Avoid writing out atomnumbers larger than 5 digits
if
(
serial
>
99999
)
{
line
(
6
,
5
)
=
fmt
::
LPadded
(
"*****"
);
}
else
{
line
(
6
,
5
)
=
fmt
::
LPaddedInt
(
serial
);
}
}
void
write_atom
(
std
::
ostream
&
ostr
,
FormattedLine
&
line
,
const
mol
::
AtomHandle
&
atom
,
int
atomnum
,
bool
is_pqr
,
bool
charmm_style
)
...
...
@@ -89,12 +101,7 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
geom
::
Vec3
p
=
atom
.
GetPos
();
line
(
0
,
6
)
=
record_name
;
// Avoid writing out atomnumbers larger than 5 digits
if
(
atomnum
>
99999
)
{
line
(
6
,
5
)
=
fmt
::
LPadded
(
"*****"
);
}
else
{
line
(
6
,
5
)
=
fmt
::
LPaddedInt
(
atomnum
);
}
write_serial
(
atomnum
,
line
);
String
atom_name
=
atom
.
GetName
();
if
(
atom_name
.
size
()
>
4
)
{
throw
IOException
(
"Atom name '"
+
atom
.
GetQualifiedName
()
+
...
...
@@ -282,7 +289,7 @@ public:
{
counter_
++
;
line_
(
0
,
6
)
=
StringRef
(
"TER "
,
6
);
line_
(
6
,
5
)
=
fmt
::
LPaddedInt
(
counter_
);
write_serial
(
counter_
,
line_
);
line_
(
17
,
3
)
=
fmt
::
LPadded
(
res
.
GetKey
());
if
(
!
res
.
GetChain
().
GetName
().
empty
()
&&
!
charmm_style_
)
{
line_
[
21
]
=
res
.
GetChain
().
GetName
()[
0
];
...
...
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