#!/usr/bin/tclsh # this tiny script removes the irritating bond between H1 # and H2 that VMD inherits when loading Amber topologies # (it is correct for the operation of Amber, but not # useful for visualizations). # Warning: this scripts assumes certain naming conventions # and ordering that are typical for amber, but may not # apply in your case. please check carefully. # # (c) 2006 Axel Kohlmeyer # get current bond info proc fixamberwater {{molid top}} { set wat [atomselect $molid water] set blist [$wat getbonds] set nlist {} # process the list and remove the bond info # (it is the last in the hydrogen bond list). foreach {o h1 h2} $blist { lappend nlist $o lappend nlist [lreplace $h1 1 1] lappend nlist [lreplace $h2 1 1] } # override the bonds with the new info $wat setbonds $nlist $wat delete }