<p>Several years ago we have written a tool for this: <a href="http://kodomo.fbb.msu.ru/~avkitex/projects/pdbparser.html" rel="nofollow noreferrer">http://kodomo.fbb.msu.ru/~avkitex/projects/pdbparser.html</a>
<a href="https://github.com/avkitex/pdbparserTools" rel="nofollow noreferrer">https://github.com/avkitex/pdbparserTools</a></p>

<p>The description is only in Russian but you can contact the author.</p>

CC BY-SA 4.0
2018-12-14T10:52:50.807Z
Could you explain how this program solves the question? Adding an example will be helpful to all users
llrs
CC BY-SA 4.0
2018-12-13T06:25:38.967Z
2018-12-15T13:54:16.693Z
2018-12-15T13:54:16.693Z
Sergey Mitrofanov
<p>The <a href="https://github.com/haddocking/pdb-tools/" rel="nofollow noreferrer">pdb-tools</a> suite has <code>pdb_delinsertion</code> and <code>pdb_reres</code> for this task. Something like:</p>

<pre><code>pdb_delinsertion 1CTF.pdb | pdb_reres &gt; out.pdb
</code></pre>

<p>should work.</p>

CC BY-SA 4.0
2019-09-17T11:29:50.523Z
2019-09-17T11:29:50.523Z
jgreener
<p>Is there a pre-existing tool which will tidy up the numbering of a PDB file? </p>

<p>Firstly, I would like to re-number the residues on inserts to make the icode an actual residue in the chain (by that I mean it's own number, shifting everything after it, so 45A becomes 46). </p>

<p>Secondly, I would also like to re-number so that each residue is one after another, as there are skips in the numbering, in spite of the two residues being physically next to each other. </p>

<p>I could do this in-house with a python script, but I thought I would ask specifically if there is a library or pre-existing tool?</p>

<p>Worst case scenario I have found <a href="http://www.canoz.com/sdh/renumberpdbchain_pl.txt" rel="nofollow noreferrer">this</a> Perl script that does similar.</p>

<p>Thanks.</p>

CC BY-SA 4.0
2019-09-17T11:24:09.947Z
I think there is a confusion here between insertion code and alternative location ID. Insertion codes allow for unified numbering between proteins of slightly different sequences, but everything with a unique residue ID (residue number and insertion code) is a separate residue in the chain and cannot be ignored. The question asked by the OP is hence valid. You wouldn't want to have multiple residues with the same residue ID but different alternative location IDs renumbered, but that wasn't the question.
jgreener
CC BY-SA 3.0
2018-02-01T17:26:26.557Z
"make the icode an actual residue in the chain" -- something is confused here. Insertion code is part of the residue id, together with the sequence number.
marcin
CC BY-SA 3.0
2018-02-01T17:54:01.117Z
@marcin Yes  sorry you're right it is, but for example when using the biopython PDB to FASTA parser it is not recognized and the chain is truncated from beyond there. So either I would need to ignore it (as I am at the moment) or change it from 1, 2, 3, 3A, 4 to 1, 2, 3, 4, 5.
TW93
CC BY-SA 3.0
2018-03-05T05:58:40.210Z
@TW93 You almost certainly want to either ignore them, or deal with them separately.  They *usually* represent different wildtypes/isoforms.  E.g. the same protein within different species which contains some minor sequence alternations!  If you include the same residue twice or more, obviously, that will cause steric clashes and mess up any calculations that you run!
Aalawlx
<python><protein-structure><pdb>
Is there a standard way to clean a PDB file and re-number its residues?
# Is there a standard way to clean a PDB file and re-number its residues?

(Asked by: username_0 on 2018-02-01)

Is there a pre-existing tool which will tidy up the numbering of a PDB file?

Firstly, I would like to re-number the residues on inserts to make the icode an actual residue in the chain (by that I mean it's own number, shifting everything after it, so 45A becomes 46).

Secondly, I would also like to re-number so that each residue is one after another, as there are skips in the numbering, in spite of the two residues being physically next to each other.

I could do this in-house with a python script, but I thought I would ask specifically if there is a library or pre-existing tool?

Worst case scenario I have found [this](http://www.canoz.com/sdh/renumberpdbchain_pl.txt) Perl script that does similar.

Thanks.

**Tags:** python, protein-structure, pdb
> **Comments:**
> **username_2**: "make the icode an actual residue in the chain" -- something is confused here. Insertion code is part of the residue id, together with the sequence number.  
> **username_0**: @marcin Yes  sorry you're right it is, but for example when using the biopython PDB to FASTA parser it is not recognized and the chain is truncated from beyond there. So either I would need to ignore it (as I am at the moment) or change it from 1, 2, 3, 3A, 4 to 1, 2, 3, 4, 5.  
> **username_3**: @TW93 You almost certainly want to either ignore them, or deal with them separately.  They *usually* represent different wildtypes/isoforms.  E.g. the same protein within different species which contains some minor sequence alternations!  If you include the same residue twice or more, obviously, that will cause steric clashes and mess up any calculations that you run!  
> **username_1**: I think there is a confusion here between insertion code and alternative location ID. Insertion codes allow for unified numbering between proteins of slightly different sequences, but everything with a unique residue ID (residue number and insertion code) is a separate residue in the chain and cannot be ignored. The question asked by the OP is hence valid. You wouldn't want to have multiple residues with the same residue ID but different alternative location IDs renumbered, but that wasn't the question.  

---

## 2 answers

### Answer by username_4 on 2018-12-13. Score: 2

Several years ago we have written a tool for this: <http://kodomo.fbb.msu.ru/~avkitex/projects/pdbparser.html>
<https://github.com/avkitex/pdbparserTools>

The description is only in Russian but you can contact the author.

> **Comments:**
> **username_5**: Could you explain how this program solves the question? Adding an example will be helpful to all users  

---

### Answer by username_1 on 2019-09-17. Score: 1

The pdb-tools suite has pdb_delinsertion and pdb_reres for this task. Something like:
pdb_delinsertion 1CTF.pdb | pdb_reres > out.pdb

should work.


---

