Re: [ccp4bb] sequential renumbering of a messed up pdb file

2008-08-01 Thread William G. Scott

Dear Martin et al:

This, along with some scripting in coot and my favorite shell (zsh),  
did the trick.


Many thanks to all who replied, and apologizes for what in retrospect  
must have been a very poorly-worded question.


Maybe this functionality can be incorporated in the next release of  
perlmole.


Bill Scott

On Jul 31, 2008, at 9:05 PM, Martin.Laurberg wrote:


Bill,
Almost there then (I wrote the line without checking)..

I moved the 'P' one position to the left and now it works, provided  
first

atom record of every atom record is the phosphor (/ P  /) atom :


perl -ne 'BEGIN{$i=0}if (/^ATOM/) \
{if (substr($_,12,4) =~ / P  /){$i++}; \
substr($_,22,4,sprintf(%4.0f,$i))}{print}'  file.pdb





On Thu, 31 Jul 2008, William G. Scott wrote:


turned them all to zeros


William G. Scott

Contact info:
http://chemistry.ucsc.edu/~wgscott/


On Jul 31, 2008, at 5:03 PM, Martin.Laurberg wrote:

Bill, if each residue starts at the same atom name, something  
close to

this might work:

perl -ne 'BEGIN{$i=0}if (/^ATOM/){if (substr($_,12,4) =~ /  P /){$i+
+};
substr($_,22,4,sprintf(%4.0f,$i))}{print}' file.pdb


/Martin


--
Martin Laurberg, PhD
Noller Laboratory
225 Sinsheimer Laboratories
University of California at Santa Cruz
CA-95064 Santa Cruz
USA

Tel +1 (831) 459 35 84
Fax +1 (831) 459 37 37


On Thu, 31 Jul 2008, William Scott wrote:


Hi folks:

I am hoping there is a simple answer I have overlooked to the
following question.  I have a pdb file in it that has multiple
residues that have the same number and chain ID, and I want to  
force

them to be renumbered sequentially.  Is there a simple way to do so
(eg, pdbset) or am I doomed to fixing it manually?

Thanks.

Bill Scott


William G. Scott

Contact info:
http://chemistry.ucsc.edu/~wgscott/






Re: [ccp4bb] sequential renumbering of a messed up pdb file

2008-07-31 Thread Abhinav Kumar
I have a program that can fix it provided the residues with same  
number are not adjacent in the pdb file.

Please  let me know and I can send you the program.

Thanks
Abhinav

Abhinav Kumar
JCSG @ SSRL, MS 99
2575 Sand Hill Road
Menlo Park, CA 945025-7015

Phone: 650 926 2992
Fax: 650 926 3292



On Jul 31, 2008, at 4:09 PM, William Scott wrote:


Hi folks:

I am hoping there is a simple answer I have overlooked to the  
following question.  I have a pdb file in it that has multiple  
residues that have the same number and chain ID, and I want to  
force them to be renumbered sequentially.  Is there a simple way to  
do so (eg, pdbset) or am I doomed to fixing it manually?


Thanks.

Bill Scott


William G. Scott

Contact info:
http://chemistry.ucsc.edu/~wgscott/




Re: [ccp4bb] sequential renumbering of a messed up pdb file

2008-07-31 Thread William Scott

They are adjacent.




On Jul 31, 2008, at 4:47 PM, Abhinav Kumar wrote:

I have a program that can fix it provided the residues with same  
number are not adjacent in the pdb file.

Please  let me know and I can send you the program.

Thanks
Abhinav

Abhinav Kumar
JCSG @ SSRL, MS 99
2575 Sand Hill Road
Menlo Park, CA 945025-7015

Phone: 650 926 2992
Fax: 650 926 3292



On Jul 31, 2008, at 4:09 PM, William Scott wrote:


Hi folks:

I am hoping there is a simple answer I have overlooked to the  
following question.  I have a pdb file in it that has multiple  
residues that have the same number and chain ID, and I want to  
force them to be renumbered sequentially.  Is there a simple way to  
do so (eg, pdbset) or am I doomed to fixing it manually?


Thanks.

Bill Scott


William G. Scott

Contact info:
http://chemistry.ucsc.edu/~wgscott/




Re: [ccp4bb] sequential renumbering of a messed up pdb file

2008-07-31 Thread Ralf W. Grosse-Kunstleve
Yet another alternative: you can do this with iotbx.pdb. Loop over the 
hierarchy in the
standard manner (http://cctbx.sourceforge.net/sbgrid2008/tutorial.html, 
v1_loop_over_atoms.py)
and insert chain.id = new_chain_id, rg.resseq = new_resseq into the loops. The 
only trick is
to add the bookkeeping for new_chain_id and new_resseq.
Ralf



- Original Message 
From: William Scott [EMAIL PROTECTED]
To: CCP4BB@JISCMAIL.AC.UK
Sent: Thursday, July 31, 2008 4:09:11 PM
Subject: [ccp4bb] sequential renumbering of a messed up pdb file

Hi folks:

I am hoping there is a simple answer I have overlooked to the  
following question.  I have a pdb file in it that has multiple  
residues that have the same number and chain ID, and I want to force  
them to be renumbered sequentially.  Is there a simple way to do so  
(eg, pdbset) or am I doomed to fixing it manually?

Thanks.

Bill Scott


William G. Scott

Contact info:
http://chemistry.ucsc.edu/~wgscott/