VMD Extension Functions
Auto-cleanup atomselections

Functions

 asel args
 
 ssel str
 
 asel_free
 

Detailed Description

The asel and asel_free functions provide a replacement for VMD's atomselect which behave like VMD's usual atomselect, but keeps a list of selections created in the scope of the calling function (it is called _asel_list, but you should not need it). Such atomselections can be deleted all at once when the function is exited via the asel_free function.

Warning
these functions are experimental and unnecessary for most people, because the behavior of recent VMD versions is to clean up atomselections created in a proc anyway (unless they are declared global).

In short, just use asel instead of atomselect, and call asel_free at the end of your function.

The ssel function allows one to write function which accept either selection strings or existing atomselections.

Function Documentation

◆ asel()

asel   args  

Auto-cleanup version of atomselect.

◆ asel_free()

asel_free

Cleanup the atom-selections performed by asel and ssel in the current function.

◆ ssel()

ssel   str  

Auto-cleanup version of atomselect. If str is an atomselection, just return it as it is. Otherwise, make a selection of it with the top molecule, record it like asel, and return it.

Parameters
strAn atom selection string or an existing atomselection