Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-14T10:52:50.807Z
Answers.Text: Could you explain how this program solves the question? Adding an example will be helpful to all users
Answers.UserDisplayName: llrs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-13T06:25:38.967Z
Answers.LastActivityDate: 2018-12-15T13:54:16.693Z
Answers.LastEditDate: 2018-12-15T13:54:16.693Z
Answers.UserDisplayName: Sergey Mitrofanov
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-17T11:29:50.523Z
Answers.LastActivityDate: 2019-09-17T11:29:50.523Z
Answers.UserDisplayName: jgreener
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-09-17T11:24:09.947Z
Comments.Text: 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.
Comments.UserDisplayName: jgreener
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-01T17:26:26.557Z
Comments.Text: "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.
Comments.UserDisplayName: marcin
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-01T17:54:01.117Z
Comments.Text: @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.
Comments.UserDisplayName: TW93
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-05T05:58:40.210Z
Comments.Text: @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!
Comments.UserDisplayName: Aalawlx
Tags: <python><protein-structure><pdb>
Title: Is there a standard way to clean a PDB file and re-number its residues?
ThreadText: # 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**: @username_2 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**: @username_0 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](https://github.com/haddocking/pdb-tools/) suite has `pdb_delinsertion` and `pdb_reres` for this task. Something like:
  
  ```
  pdb_delinsertion 1CTF.pdb | pdb_reres > out.pdb
  
  ```
  
  should work.
  
  
  ---
  
  