Forum Navigation
You need to log in to create posts and topics.

Cluster analysis for displacement vectors (identification of stringlike displacements)


I am trying to write a script for identifying stringlike displacements of atoms (see, for example, Figure 5) and am wondering if this is possible purely in the pipeline. A "string" is defined as a mobile cluster of atoms with displacements joined head to tail. An algorithm for identifying strings is as follows:

1. Identify mobile atoms that have moved some cutoff distance relative to an earlier frame. This can be done in the pipeline by simply defining a selection on displacement magnitude.
2. Identify correlated pairs of atoms among mobile atoms. Consider mobile atom i and its j nearest neighbors at t = 0 and t = dt: if two mobile atoms remain nearest neighbors at t = dt, their motion is correlated and they are part of the same string. A quantitative criterion for being a pair is that min(|r_i(dt) - r_j(0)|, |r_i(0)-r_j(dt)|) < C, where C is some cutoff, and r are atomic positions.
3. Draw bonds between correlated pairs of atoms. At this point, strings will be identified as clusters connected by bonds. Cluster statistics are the desired output.

Currently, I do not see a way to do steps 2 / 3 purely in the pipeline. If the standard cluster analysis is performed just on the selected atoms from Step 1 (with large displacements), the clusters are not correct because strings may be "entangled" and looping around each other. In other words, in the standard cluster algorithm, the cutoff distance fails to separate entangled clusters that are *not* joined head to tail. I attached an example image showing three or four distinct string clusters with total numbers of atoms 1,1,2,5. The goal would be to distinguish these automatically in the pipeline.

I would be very grateful to get feedback on whether you think this analysis is possible in the pipeline or what new features would need to be added to make this possible. I will be working on a python script to do this, and am using the very useful python code generation feature to get started. Thanks for continuing to develop great software!




Uploaded files:
  • Screen-Shot-2021-01-13-at-5.25.00-PM.png

Hi Ian,

I am not entirely sure this leads to the same result, because I'm lacking proper example data, but here is a suggestion how to build your pipeline. Please import your trajectory and then insert the following modifiers into the modification pipeline:

  1. Displacement vectors
  2. Expression selection: Operate on: Particles. Boolean Expression: DisplacementMagnitude < threshold-for-mobile-atoms
  3. Delete selected
  4. Create bonds
  5. Expression selection: Operate on: Bonds. Boolean Expression:
    (@1.Displacement.X-@2.Displacement.X)^2 + (@1.Displacement.Y-@2.Displacement.Y)^2 + (@1.Displacement.Z-@2.Displacement.Z)^2 > C^2, with "C" being a placeholder for the threshold value C from your algorithm above.
  6. Delete Selected
  7. Cluster analysis: Neighbor Mode: Bonds. Activate Option "Color particles by cluster" and inspect cluster statistics (size, center-of mass etc.) by clicking "Show list of clusters".

This pipeline starts off by creating a network of bonds between all moving atoms. It then removes bonds again connecting pairs of atoms which aren't moving into the same direction. Finally, clustering is performed on the network of remaining bonds.

Let me know what you think. We'd also be happy to help with developing a Python-based solution if you rather prefer that option.