[lammps-users] display the centro symmetry parameter?

Hello Damien,
I also had this problem. It turns out that VMD along with the PDB format can be used to store an arbitrary parameter like the CSP. There is a simple tcl script found somewhere on the VMD site to load ( I can't remember where) to load the parameter into VMD's 'user' variable which is located in the 'color atoms by ...' drop-down box. I have attached the script below. However, before you can use this script you must convert LAMMPS's CSP format to the PDB format. My CSP output from LAMMPS looks like:

dump 0dumpCSP all custom 1000 indent-step_3-4.csp tag type x y z c_CSP

Once the output is created, I use an AWK script that I wrote to get my custom CSP format into PDB:

#!/usr/bin/awk -f
# AWK Script to convert one multi-frame dump file into one multi-frame PDB file
BEGIN { nskip = 9}
NR <= nskip
{ next}
/^ITEM/ { for (j=1; j<nskip; j++) {
getline }
print "END"
next
}
{
printf("%-4s 5i -3s %3s %4i %8.3f%8.3f%8.3f%6.2f%6.2f\n", "ATOM", $1, "Au", "grp", $2, $3, $4, $5, $6, 0.00);
}
END{print "END";}

Once you create the PDB file, invoke the pdbofactor.tcl script from the tcl counsole (found in the VMD) 'Tools' menu. The script follows:

# load multi-frame pdb file, storing occupancy factors 'my scripts store centro-symmetry parameter in occupancy slot' from each frame in user.
# usage: pdbbfactor <filename>
#
# Justin Gullingsrud & Modified by cjo to take input from occupancy field
# 3 September 2004 & 1/2007

proc pdbofactor { fname } {
mol new $fname waitfor all
set all [atomselect top all]
set frame 0
set in [open $fname r]
set occupancy {}
while { [gets $in line] != -1 } {
   switch -- [string range $line 0 3] {
     END {
       $all frame $frame
       $all set user $occupancy
       set occupancy {}
       incr frame
     }
     ATOM -
     HETA {
       lappend occupancy [string range $line 55 60]; #column numbers changed to reflect occupancy column
     }
   }
}
}

Please let me know if you have any questions. Something like this should really be put on the LAMMPS or VMD website, since the CSP so very useful.

Hope this helps.
Regards,
Chris O'Brien

Pizza.py will convert LAMMPS dump files to PDB files.
It would be easy to add an option to fill in the optional
PDB field with a column from the dump file, so that
VMD can do this. I take it from this email that
it is columns 55-60 in the PDB file that are the optional
field?

Steve