Skip to content
Snippets Groups Projects
Commit fa854e3c authored by Niklaus Johner's avatar Niklaus Johner
Browse files

In the pdb_writer, changed the way atom numbers

with more than 5 digits are handled.

In 'CHARMM' mode, "*****" are output
whereas in pdb mode, an exception is thrown.
parent 562dc014
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line, ...@@ -80,7 +80,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
line( 0, 6)=record_name; line( 0, 6)=record_name;
// Avoid writing out atomnumbers larger than 5 digits // Avoid writing out atomnumbers larger than 5 digits
if (atomnum > 99999) { if (atomnum > 99999) {
line( 6, 5)=fmt::LPaddedInt(atomnum - 100000 * (atomnum / 100000)); if (charmm_style) {
line( 6, 5)=fmt::LPadded("*****");
} else {
throw IOException("Atom number is too long for PDB output."
" At most 5 digits are allowed");
}
} else { } else {
line( 6, 5)=fmt::LPaddedInt(atomnum); line( 6, 5)=fmt::LPaddedInt(atomnum);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment