From: Akshay Bhatnagar (
Date: Sat Apr 09 2016 - 04:22:08 CDT

Hello everyone

I am creating psf using psfgen package using the tcl script:

package require psfgen
psfcontext reset
topology top_all27_prot_na.inp
set filelist [glob *.PDB]
  foreach file $filelist {
    mol new $file
    set name [file rootname $file]
    set selp [atomselect top "not hetero"]
set chains [lsort -unique -decreasing [$selp get pfrag]]
echo $chains
foreach chain $chains {
for {set i 0} {$i <= $chain} {incr i} {
set sel [atomselect top "pfrag $chain"]
$sel writepdb $name-$chain.pdb
pdbalias residue HIS HSP
pdbalias atom ILE CD1 CD
pdbalias atom LYS 1HZ HZ1
pdbalias atom LYS 2HZ HZ2
pdbalias atom LYS 3HZ HZ3
pdbalias atom ARG 1HH1 HH11
pdbalias atom ARG 2HH1 HH12
pdbalias atom ARG 1HH2 HH21
pdbalias atom ARG 2HH2 HH22
pdbalias atom ASN 1HD2 HD21
pdbalias atom ASN 2HD2 HD22
pdbalias atom SER HG HG1
segment U {pdb $name-$chain.pdb}
coordpdb $name-$chain.pdb U
writepdb $name-$chain-psf.pdb
while {$chain >= 0} {
exec cat $name-$chain-psf.pdb >> $name-final.pdb &
incr chain -1
echo $chain

using this script, the PDB files having atoms with multiple occupancies are
giving separate chains with same residue number. how can i select the atoms
with highest occupancy only?

With Regards
Akshay Bhatnagar
Ph.D. Student
BITS Pilani Hyderabad Campus