From: Arham Amouie (
Date: Sat Aug 06 2016 - 13:12:18 CDT

Hi. I've written the following tcl script to change the beta value of all the atoms of a large "molecule", composed of about 500,000 atoms:
set crystal [atomselect top "all"]
set atomsNo [$crystal num]
$crystal delete
for {set i 0} {$i < $atomsNo} {incr i} {
    set atom_i [atomselect top "index $i"]
    set atomcolor [$atom_i get beta]
    if {$atomcolor < 0.02} {
        $atom_i set beta 0
    } else {
        $atom_i set beta 1.0
    $atom_i delete

But it's extremely slow. How can I write a much faster script? Is it possible within VMD?