Thanks to everyone for the suggestions. It appears that just adding a
bfactor and occupancy flag is the way to go (eg - there's no way to make
lsqkab less finicky). Since I'm just hacking this together and
grep/sedding out the pairwise rmsds to pipe to another program, I'd
prefer to use the easy stdout of lsqkab.
For those interested, a for-wrapped version of Christian's awk script is
below
#!/bin/bash
for file in *.pdb ; do
echo $file
awk -v pdbfile=$file '
BEGIN{
gsub(".pdb","",pdbfile)
pdbin=sprintf("%s.pdb",pdbfile)
pdbout=sprintf("%s_fake_occ_bf.pdb",pdbfile)
while (getline < pdbin >0){
if ($1 ~ "ATOM"){
printf("%-6s %4d %-3s %3s %1s%4d %7.3f %7.3f %7.3f %5.2f
%5.2f \n", $1, $2, $3, $4, $5, $6, $7, $8, $9, 1, 20) > pdbout
}
else print $0 > pdbout
}
}'
done
Jacob
Christian Schleberger wrote:
> Dear Jacob,
>
> you can replace the bfactors and occupancies with a simple awk script
> like the attached one.
>
> just make the file executable with chmod +x and use it with
> ./overwrite_occ.awk your_pdbfile.pdb
> and it will spit out a pdb file named your_pdbfile_fake_occ_bf.pdb
>
> HTH
> Christian
>
>
>
> Jacob Corn schrieb:
>
>> Dear everyone,
>> I'm attempting to do a large scripted pairwise alignment of
>> theoretical models to calculate rmsd over a pre-determined residue
>> range, but the PDBs that I'm using have neither B-factor nor occupancy
>> fields. Lsqkab is unhappy about this fact (see below), and I'm
>> wondering if there's a way of getting around this short of inserting
>> dummy occupancies and B-factors in several thousand PDBs. At the
>> moment I'm just using superpose, but would rather perform the match
>> over a constant set of atoms.
>>
>> The script I'm using is
>>
>> lsqkab xyzinf $file1 xyzinm $file2 << END
>> OUTPUT RMS
>> FIT residue CA 1 TO 105
>> MATCH 1 to 105
>> end
>> END
>>
>> and the error is
>> (lots of the following)
>>
>> *** Warning(s): point code unit function
>> *** 1 17920 1 MMDB_F_Coord
>> *** file : qa1aa2001-low.pdb
>> *** warning: occupancy was not set
>> *** warning: temperature factor was not set
>>
>> (finished with)
>>
>> ** ZERO OCCUPANCIES IN WORKING SET ** 861.0
>> ** ZERO OCCUPANCIES IN REFERENCE SET ** 861.0
>> <B><FONT COLOR="#FF0000"><!--SUMMARY_BEGIN-->
>> LSQKAB: *** ERROR - YOU HAVE FAILED TO FIND ANY ATOMS TO FIT ***
>> LSQKAB: *** ERROR - YOU HAVE FAILED TO FIND ANY ATOMS TO FIT ***
>> Times: User: 0.0s System: 0.0s Elapsed: 0:00
>>
>>
>> Any help would be appreciated.
>> Jacob
>>
>
>
> ------------------------------------------------------------------------
>
> awk -v pdbfile=$1 '
> BEGIN{
> gsub(".pdb","",pdbfile)
> pdbin=sprintf("%s.pdb",pdbfile)
> pdbout=sprintf("%s_fake_occ_bf.pdb",pdbfile)
> while (getline < pdbin >0){
> if ($1 ~ "ATOM"){
> printf("%-6s %4d %-3s %3s %1s%4d %7.3f %7.3f %7.3f %5.2f %5.2f \n", $1, $2, $3, $4, $5, $6, $7, $8, $9, 1, 20) > pdbout
> }
> else print $0 > pdbout
> }
> }'
>
|