If you create a file (e.g. "resb.dat") where each line has
(space-separated) the chain, residue number and value:

 A 1 7.5
 A 2 5.4
 B 1 11.9
 B 2 0.4

/and/ you use PDB format:

  awk -v f=resb.dat 'BEGIN{
    while(getline<f) b[$1,$2]=$3-0.0
  }
  /^ATOM|^HETATM/{
    c=substr($0,22,1)
    r=substr($0,23,4)-0
    if(b[c,r]!=""){
      printf("%s%6.2f%s\n",substr($0,1,60),b[c,r],substr($0,67))
      next
    }
  }
  {print}' your.pdb > new.pdb

(could be a "one-liner", but easier to read this way)

Cheers

Clemens


On Mon, Jan 13, 2025 at 03:51:11PM +0000, Hui YAN wrote:
> Thanks Peter. Given there are only 150 residues in my PDB file, it is
> doable (if I can't work out a script)!
> 
> Kind regards,
> Yahui
> 
> 
> 
> 
> On Mon, Jan 13, 2025 at 3:16 PM Peter Smyth <peter.sm...@xfel.eu> wrote:
> 
> > Dear Yahui,
> >
> > It is possible to set the B-factor (temperature factor) for all atoms in a
> > residue at once using the residue info dialogue in Coot (Measures>Residue
> > Info... in Coot 0.9). You would still have to go through residue by
> > residue, though.
> >
> > For something more automated, you could look into scripting changes using
> > command line text editing of the PDB files.
> >
> > Cheers,
> >
> > Peter Smyth
> > Postdoc scientist, SEC Group
> > European XFEL
> >
> >
> > ------------------------------
> > *From: *Hui <butterflycam...@gmail.com>
> > *To: *CCP4BB <CCP4BB@JISCMAIL.AC.UK>
> > *Date: *Monday, 13 January 2025 16:02 CET
> > *Subject: *[ccp4bb] replacing B-factor column and color accordingly
> >
> > Happy New Year, everyone!
> >
> > I am looking for a PDB editing tool to replace the B-factors numbers with
> > another column of numbers, then color the structure by pseudo-B-factors in
> > ChimeraX. All the atoms of one individual residue will have the same number
> > at the B-factor column. I can possibly edit the coordinate manually atom by
> > atom, which is not very fun to do. Does anybody know of any programme doing
> > this process?
> >
> > Thanks a lot!
> >
> > Kind regards,
> > Yahui
> >
> >
> > ------------------------------
> >
> > To unsubscribe from the CCP4BB list, click the following link:
> > https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1
> >
> >
> 
> ########################################################################
> 
> To unsubscribe from the CCP4BB list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1
> 
> This message was issued to members of www.jiscmail.ac.uk/CCP4BB, a mailing 
> list hosted by www.jiscmail.ac.uk, terms & conditions are available at 
> https://www.jiscmail.ac.uk/policyandsecurity/

-- 

*--------------------------------------------------------------
* Clemens Vonrhein, Ph.D.     vonrhein AT GlobalPhasing DOT com
* Global Phasing Ltd., Sheraton House, Castle Park 
* Cambridge CB3 0AX, UK                   www.globalphasing.com
*--------------------------------------------------------------

########################################################################

To unsubscribe from the CCP4BB list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1

This message was issued to members of www.jiscmail.ac.uk/CCP4BB, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/

Reply via email to