2 years ago

#74590

test-img

newtcler

How do I auto generate multiple VMD representations from a list of ids in tcl script

I am new to tcl. I have the basics down but I hope to get better. I have a list of lists of ids that I want to select from a molecule for visualization. I want to apply different coloring to each rep generated from each list. I have the following:

mol new myfile.pdb
#ids for selection to create representations
set myids {{10 20} {22 40}}
set index 0
foreach id $myids {
    incr ::index
    set id1 [lindex $id 0]
    set id2 [lindex $id 1]
    mol selection "name protein and resid > $id1 and resid < $id2"
    mol modstyle 0 0 NewCartoon
    mol modcolor 0 0 ColorID [expr $index + 1]
    mol addrep 0
}

This is giving me an output of the entire molecule. I want the base mol view to remain but have the selections shown on top of it. It also generates one color instead of 2 different colors, given that there are 2 lists for 2 different representations. I want all selected rep to remain on. Can atomselect be used here? Do I need to put this in a proc? I feel I should not be coloring by mol but by selections. I am not sure how to proceed. Any pointers will help

tcl

vmd

0 Answers

Your Answer

Accepted video resources