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

Allows to write out pdbs with more than 99999 atoms

This fix simply keeps the last 5 digits of the atom numbers
parent 54decf4b
Branches
Tags
No related merge requests found
......@@ -78,7 +78,12 @@ void write_atom(std::ostream& ostr, FormattedLine& line,
geom::Vec3 p=atom.GetPos();
line( 0, 6)=record_name;
line( 6, 5)=fmt::LPaddedInt(atomnum);
// Avoid writing out atomnumbers larger than 5 digits
if (atomnum > 99999) {
line( 6, 5)=fmt::LPaddedInt(atomnum - 100000 * (atomnum / 100000));
} else {
line( 6, 5)=fmt::LPaddedInt(atomnum);
}
String atom_name=atom.GetName();
if (atom_name.size()>4) {
throw IOException("Atom name '"+atom.GetQualifiedName()+
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment