diff --git a/prody/proteins/pdbfile.py b/prody/proteins/pdbfile.py index e716d58a1..7c352d943 100644 --- a/prody/proteins/pdbfile.py +++ b/prody/proteins/pdbfile.py @@ -1453,6 +1453,8 @@ def writePDBStream(stream, atoms, csets=None, **kwargs): anisouline = ANISOULINE_GE100K_GE10K LOGGER.warn('Indices are exceeding 99999 and hexadecimal format is being used for indices and resnums') + serial += num_ter_lines + if hybrid36: serial = decToHybrid36(serials[i]) resnum = decToHybrid36(resnums[i], resnum=True) @@ -1460,8 +1462,6 @@ def writePDBStream(stream, atoms, csets=None, **kwargs): serial = serials[i] resnum = resnums[i] - serial += num_ter_lines - if pdbline == PDBLINE_LT100K or hybrid36: if len(str(resnum)) == 5: if icodes[i] == '':