DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Scripted Atom-Highlight In VMD

01.19.2007
| 3031 views |
  • submit to reddit
        Tcl-procedure for VMD. Embed this function and be happy.


# Highlight a certain selection. Selection is ONLY A STRING, not an atomselection
# Example:
# set repr "Licorice 0.300000 10.000000 30.000000"
# highlighting 0 $repr $id_KcsA "segid 1SG and resid 26 to 50 and not backbone"
# 
proc highlighting { colorId representation id selection } {
   set id [[atomselect $id $selection] molid]
   puts "highlighting $id"
   mol delrep 0 $id
   mol representation $representation
   mol color ColorID $colorId
   mol selection $selection
   mol addrep $id
}

set repr "Licorice 0.300000 10.000000 30.000000"
highlighting 0 $repr $id "segid 1SG and resid 26 to 50 and not backbone"