Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul Biological Assemblies #278

Merged
merged 27 commits into from
Aug 2, 2023
Merged

Overhaul Biological Assemblies #278

merged 27 commits into from
Aug 2, 2023

Conversation

BradyAJohnston
Copy link
Owner

@BradyAJohnston BradyAJohnston commented Aug 2, 2023

This finally brings in the improved biological assembly information from #148 to main. This enables multiple biological assemblies to be shown, as well as properly supporting assemblies where not every chain is involved in every single transformation.

Previous implementations I have stored arbitrary data using individual node groups. While this worked well with smaller structures. Because the symmetry operations are applied on a chain-by-chain basis, this dramatically increases the number of operations that are required and dramatically slows down the creation of the node groups.

The data is now stored on a data object, inside of a new collection MN_data which is a collection inside of MolecularNodes collection. This collection also allows for storing other arbitrary data sets on objects for use inside of Geometry Nodes.

Assembly Data Object

The data object currently has the following attributes:

  • position: translation of the symmetry operation
  • assembly_rotation: rotation of the symmetry operation
  • assembly_id: which biological assembly this symmetry operation belongs to
  • chain_id: which chain this symmetry operation acts upon

image

For this to work properly, the structure has to first be split into instances based on the chain_id. This is done by the new MOL_utils_split_{name} node which separates the geometry based on the chain_id and then combines them as instances. This node can be slow on larger structures, but is currently the only way to have the symmetry operations only be applied to their relevant chains.

image

Inside the user-facing assembly node, the geometry is split into instances, then these instances are instanced on their symmetry operations based on the data object.

Scaling the rotation and translations, as well as choosing the biological assembly are all exposed on the user-facing node.

image

The assembly can be applied to any of the styles, as long as the resulting styles conain chain_id attributes.

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Patch coverage: 93.09% and project coverage change: +4.30% 🎉

Comparison is base (98f336c) 56.25% compared to head (84155af) 60.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
+ Coverage   56.25%   60.56%   +4.30%     
==========================================
  Files          15       19       +4     
  Lines        1943     2206     +263     
==========================================
+ Hits         1093     1336     +243     
- Misses        850      870      +20     
Files Changed Coverage Δ
MolecularNodes/ui.py 40.99% <0.00%> (+0.23%) ⬆️
MolecularNodes/load.py 90.86% <71.42%> (-1.41%) ⬇️
MolecularNodes/assembly/pdb.py 90.14% <90.14%> (ø)
MolecularNodes/assembly/mmtf.py 93.93% <93.93%> (ø)
MolecularNodes/assembly/cif.py 95.65% <95.65%> (ø)
MolecularNodes/nodes.py 60.62% <97.14%> (+3.55%) ⬆️
MolecularNodes/assembly/mesh.py 98.24% <98.24%> (ø)
MolecularNodes/assembly/__init__.py 100.00% <100.00%> (ø)
MolecularNodes/coll.py 95.00% <100.00%> (+2.69%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BradyAJohnston BradyAJohnston marked this pull request as ready for review August 2, 2023 09:26
@BradyAJohnston BradyAJohnston merged commit 6b6ec46 into main Aug 2, 2023
4 of 5 checks passed
@BradyAJohnston BradyAJohnston deleted the dev-assemblies branch August 2, 2023 09:29
BradyAJohnston added a commit that referenced this pull request Sep 14, 2023
Overhaul Biological Assemblies

Brings work from @padix-key in #148 to properly support more biological assemblies. Fixes errors in #109.
BradyAJohnston added a commit that referenced this pull request Sep 14, 2023
Overhaul Biological Assemblies

Brings work from @padix-key in #148 to properly support more biological assemblies. Fixes errors in #109.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants