From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Jun 28 2019 - 11:12:44 CDT

Bart,
  If you give a more concrete statement about your ultimate goal, we
can give you more specific guidance beyond what you've already received.
Have you tried the previously suggested methods yet?

Best,
  John

On Thu, Jun 27, 2019 at 10:54:01PM +0000, Vermaas, Joshua wrote:
> Hi Bart,
>
> I'm not sure I understand your question. You mean would the colors respond
> as the trajectory is played? They should if you colored your atoms by the
> user field (Coloring Method = Trajectory->User->User), since again that
> can change from frame to frame, unlike something like occupancy or beta
> which are shared between frames. This won't be smooth though, since as the
> cluster identifier changes, the colors will switch instantaneously, which
> probably isn't the effect you are looking for.
>
> -Josh
>
>
>
> On 2019-06-27 15:47:31-06:00 Bart Bruininks wrote:
>
> Heya Josh,
> Thanks for the replay, would that also work upon sliding of the user
> window? The goal is to add it smoothly to the visual interphase to act
> as an extra layer of selection you can compare to.
> Cheers,
> Bart
>
> Op do 27 jun. 2019 19:04 schreef Vermaas, Joshua
> <[1]Joshua.Vermaas_at_nrel.gov>:
>
> Hi Bart,
>
> There are two ways I can see this working. One is to use Tcl, and
> modify the user field for each atom to a numeric identifier for the
> cluster they belong to. Then you would color your trajectory by the
> user field, which can be updated per frame. Lets say you've written a
> text file with all your cluster identifications per frame, with one
> per line. I *think* something like this would do what you want.
>
> #Setup. Read the file, set some initial variables
> set sel [atomselect top "all"]
> set fp [open "data.txt" r]
> set file_data [read $fp]
> close $fp
> set frame 0
> set data [split $file_data "\n"]
> #Act on each line.
> foreach line $data {
> $sel frame $frame
> #Assuming a space-delimited output format
> set cluster [split $line " "]
> $sel set user $cluster
> #On the next line, apply to the next frame
> incr frame
> }
>
> The other is with python, and would be more applicable if not every
> atom was assigned to a cluster, or if your data structure was oriented
> such that clusters only knew which atoms they contained. This requires
> a working python-enabled VMD installation. You would use the Molecule
> and MoleculeRep commands to create a distinct representation for each
> cluster at each frame, taking advantage of the ease of removing all
> representations through the python interface relative to the Tcl one.
>
> -Josh
>
>
>
> On 2019-06-27 10:04:57-06:00 [2]owner-vmd-l_at_ks.uiuc.edu wrote:
>
> Heya,
> I am currently working on some cool clustering scripts and what I
> would like to do is show the clustering in VMD. However, to do so, I
> need to be able to make an adaptive selection based on a full
> trajectory spanning cluster array (numpy) per atom e.g.:
> [
> [frame 1
> atom1 1
> atom2 3
> atom3 1
> . ..
> ]
> [frame 2
> atom1 1
> atom2 2
> ...
> ]
> ]
> I would like to use the atom clusters per frame as my selection and
> color them based on cluster name. However, this seems to be more
> complex then I had hoped. I do know some tcl etc so I could figure
> it out, I am just wondering what would be a wise path to take.
> Cheers,
> Bart Bruininks
> MD Groningen (Martini)
>
> References
>
> Visible links
> 1. mailto:Joshua.Vermaas_at_nrel.gov
> 2. mailto:owner-vmd-l_at_ks.uiuc.edu

-- 
NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
http://www.ks.uiuc.edu/~johns/           Phone: 217-244-3349
http://www.ks.uiuc.edu/Research/vmd/