Never been to DZone Snippets before?

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

Scripted Atom-Highlight in VMD (See related posts)

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"


You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts