Below is a horrible hack awk script which patches a file of "scores" into
a PDB file. I'm sure these a nicer way of doing this!
Phil
> Is there a program in CCP4 with a command to change
> the B-factor of a single residue? I checked the
> documentation for pdbset and it seems to assign
> B-factors only for the whole molecule.
>
> What I'd like to do is plot a given residue property
> in a graphic software using the "color by b-factor"
> feature. I could write a script to directly parse and
> modify the PDB file, but things would be easier if I
> could just generate a script that used some program
> which would handle the B-factor assignment.
>
> Lucas
>
> __________________________________________________
> Fale com seus amigos de graça com o novo Yahoo! Messenger
> http://br.messenger.yahoo.com/
>
#!/bin/csh -f
# Fudge conservation score into B-factor column of PDB file
# Reads a file called "conservation.dat" containing a list of conservation
# scores (from residue 1) and uses it to replace the B-factor column
# in a PDB file read from stdin
cat > q.tmp << 'eof-q'
BEGIN{ n = 0; nr = 0; nlast = -1000
while (getline < "conservation.dat" > 0)
{n = n+1
csc[n] = $1
## print " n = ",n, $1
}
}
{if ($1 == "ATOM")
{nres = $6
if (nres > nlast)
{nlast = nres
# nr = nr + 1
nr = nres
if (nr > n)
{print "nres too large:", nr, n
exit}
}
line = $0
printf("%s%6.2f\n",substr($0,1,60),csc[nr])
}
else
print
}
'eof-q'
awk -f q.tmp
\rm q.tmp
|