############################################################### # # # - pbc.tcl - # # # # Andrea Minoia, March 2010 # # # # Tcl script for VMD to set the size of the unit cell for # # file formats that does not contain such information, e.g. # # XYZ and TINKER arc files. # # # # Once the unit cell has been defined, periodic images can be # # be displayed. # # # # Contacts: http://chembytes.wikidot.com # # minoiaa@gmail.com # # # ############################################################### #pick ID for current molecule set molid [molinfo top] #pick the number of frames set n [molinfo $molid get numframes] puts -nonewline "\n Set length for a (angstrom): " gets stdin a puts -nonewline "\n Set length for b (angstrom): " gets stdin b puts -nonewline "\n Set length for c (angstrom): " gets stdin c puts -nonewline "\n Set angle alpha (if monoclinic cell press enter): " gets stdin alpha if { $alpha =="" } { set alpha 90.000 set beta 90.000 set gamma 90.000 } else { puts -nonewline "\n Set angle beta (degrees): " gets stdin beta puts -nonewline "\n Set angle gamma (degrees): " gets stdin gamma } # Applying to all the frames for {set i 0} {$i < $n} {incr i} { molinfo $molid set frame $i molinfo $molid set a $a molinfo $molid set b $b molinfo $molid set c $c molinfo $molid set alpha $alpha molinfo $molid set beta $beta molinfo $molid set gamma $gamma } #rewind trajectory animate goto start