I think you could use an awk script:
awk '
FILENAME==datafile {bfac[$1]=$2}
FILENAME==pdbfile {if ($1=="ATOM") {printf "%61s %5.4f\n", substr($0,1,61), bfac[$2]} else {printf "%s\n",$0}}
' datafile=$1 pdbfile=$2 $1 $2
Works for me. Save the above as insert_bfactors.awk or some such, make executable and then use:
./insert_bfactors.awk datafile input.pdb > output.pdb
Where datafile contains two columns, the first being the atom number from your pdb, the second being the value you want in the bfactor column. Any atoms not listed in your datafile will be set as 0.0000.
Cheers,
Jan
________________________________________
From: CcpNmr software mailing list [[log in to unmask]] On Behalf Of Paul Driscoll [[log in to unmask]]
Sent: 31 March 2010 17:10
To: [log in to unmask]
Subject: Re: General parameter into b-factor field question
To (partly) answer my own question, there is some help in respect of this
problem here:
http://pymolwiki.org/index.php/Color#Reassigning_B-Factors_and_Coloring
Paul
Quoting Paul Driscoll <[log in to unmask]>:
> Hi,
>
> This is not specifically a CCPN question though it just might have a solution
> in
> Analysis. Any help would be greatly appreciated:
>
> Problem:
> To get a by-atom parameter (S*2, R1, R2, Rex, Delta-chemical shift), often
> sitting in an Excel spreadsheet or similar, into the B-factor field of a PDB
> file for molecule display purposes (e.g. in MolMol as 'sausage tube'
> thickness).
>
> i.e. having computed some property is there a way to get that into the PDB
> file
> and maintaining proper PDB format? No doubt this is a problem solved before
> in
> my group, but has been lost, our perl-scripters are on vacation, and I just
> wonder if someone knows a particularly easy way to this.
>
> As I say, any help would be great.
>
> Cheers,
> Paul
>
>
>
> --
> Paul C. Driscoll
> Honorary Professor of Structural Biology
> Structural and Molecular Biology
> University College London
> Gower Street
> London WC1E 6BT, UK
> Tel.: 44-20 7679 7035
> Mobile: 07876 777937
>
> -------------------------------------------------
> This mail sent through UCL Biochemistry's Webmail:
> http://webmail.biochem.ucl.ac.uk/ (unsecured)
> https://webmail.biochem.ucl.ac.uk/ (secured)
>
--
Paul C. Driscoll
Honorary Professor of Structural Biology
Structural and Molecular Biology
University College London
Gower Street
London WC1E 6BT, UK
Tel.: 44-20 7679 7035
Mobile: 07876 777937
-------------------------------------------------
This mail sent through UCL Biochemistry's Webmail:
http://webmail.biochem.ucl.ac.uk/ (unsecured)
https://webmail.biochem.ucl.ac.uk/ (secured)
|