Home   Manual

Feedback Wanted: Layer system in Avogadro v2

Marc Masó is a master’s student at UPC in Barcelona. He’s working on Avogadro v2 as part of this year’s Google Summer of Code on a project he called “Tools for visualization and efficient editing.”

One thing Marc would like to add is a system of “layers” for fragments. This would be similar to tools in graphics editing programs (Photoshop, Blender, etc.) and make it easier to edit or change graphics styles on different disconnected pieces (e.g., ligand + protein, molecule + surface, two molecules, etc.)

He’s looking for some feedback on then concept and how the UI should work.

When finished, the layers would also be available to commands / input generation (e.g., fragment-based calculations).

Thoughts? Ideas? Suggestions?

I am not sure I get the concept. Is the idea that one can group molecules and then use different display styles - like VDW or ball and stick - for different groups, so that they are easily distinguishable or that one can more easily see a molecule in a solvent?

Certainly all of the above:

  • molecules and fragments can have different display styles
  • one can more easily see a molecule in a solvent (e.g., hide the solvent layer / layers)
  • layers can be exposed to other programs (e.g., use QM for a molecule and MM for the solvent, etc.)
  • you could lock / freeze a layer during optimization as a constraint

I like the idea very much! It seems so obvious, but somehow did not come to my mind before :upside_down_face:
Would love to have it for material science projects, when we have sandwiched materials or water + nanotubes or graphene. It will make life so much easier to be able to modify only part of the system without fear to spoil the rest. Ideally, selection and editing must be limited to the current layer if a user do not select the opposite.

1 Like

The feature would be even better if coupled with selection tools based on/allowing string expressions implementing boolean operators, possibly preserving the expression that generated the selection.
This combination would considerably ease the (repeated) selection of special ligand or solvent atoms/molecules (e.g. those within a given distance from one or more atoms/groups/residues/molecules), which is a pain in the neck in many common molecular editors and analysis programs.

Yep. :smile: It’s possible to turn a selection into a new layer or move it into an existing layer.

Your example of “select fragments within X Å” is a good one. The next release will include flexible atom lists (e.g. “select atoms 1, 5, 6, 9, 10”)

Please feel free to make suggestions for other selection tasks. For example, what kinds of expressions do you have in mind?

Recent problems of selection that inspired my previous comment: 1) finding all solvent molecules within 5 Å from either atom group A or atom group B; 2) finding all solvent molecules within 5 Å from both atom group A and atom group B (incidentally, atom groups A and B were indeed protein sidechains), or, in “selection metalanguage”:

  1. res.type=solvent AND [(r from atom_group_A < 5) OR (r from atom_group_B < 5)]
  2. res.type=solvent AND [(r from atom_group_A < 5) AND (r from atom_group_B < 5)]
    More refined selections could include further filtering on other geometrical parameters, line angles or dihedrals.
    Obviously the most effective solution would be the definition of neighbor lists for selected atom groups and then the selection within these lists of interesting molecules/groups/atoms (or corresponding types), followed by the application of eventual boolean operations and/or further geometrical constraints.
    These kinds of selections would be very useful in characterizing solvation properties within MD trajectory analyses.
    In the case of membrane systems or other spatially anisotropic systems, a selection of solvent molecules, ions, ligands or other small molecules, or even of macromolecular subunits (residues, segments) according to a single coordinate value (obviously after proper alignment of the system) would be equally precious: e.g. mol.type=Na+ AND (z >= X OR z <= Y).
    I hope that also these examples may be clear and potentially useful.
1 Like

Great, that’s helpful.

This would be easy to do right now even without any C++. I’ll whip up an example Python script (with dialog) after 1.95 is released on Monday.

  • Enter a list of elements
  • Enter the range of X, Y, Z (with defaults set by the current system)

I’ve had some discussions with colleagues about adding more “CAD-like” boolean operations on selections. Certainly “select everything within 5 Å of atom X” or “select everything within a radius of the current selection” is easy enough to code – layers are a nice way to “save this selection.” That was possible in Avo1, but AFAIK hardly ever used.