Giter Site home page Giter Site logo

bradyajohnston / molecularnodes Goto Github PK

View Code? Open in Web Editor NEW
788.0 16.0 80.0 759.64 MB

Toolbox for molecular animations in Blender, powered by Geometry Nodes.

Home Page: https://bradyajohnston.github.io/MolecularNodes/

License: MIT License

Python 99.92% Makefile 0.08%
blender biochemistry geometry-nodes protein protein-structure protein-visualization sciart visualisation structural-biology blender-addon

molecularnodes's Introduction

MolecularNodes ๐Ÿงฌ๐Ÿ๐Ÿ’ป

Badge displaying license, which is MIT. Repo total downloads count. Badge displaying license, which is MIT. Badge displaying count of GitHub stars.

Documentation Building Running Tests codecov

Button linking to buymeacoffee.com to leave me a tip as a thank you. Button linking to buymeacoffee.com to leave me a tip as a thank you. Button linking to buymeacoffee.com to leave me a tip as a thank you.

About

MolecularNodes enables quick import and visualisation of structural biology data inside of Blender. Blender provides advanced industry-leading visualisation and animation technology, while MolecularNodes provides the interface that allows Blender to understand the unique data formats used in structural biology.

The add-on enables creating animations from static crystal structures, styling proteins and other molecules in a variety of highly customisable styles, importing and playing back molecular dynamics trajectories from a wide variety of sources, and even importing of EM density maps.

Examples

See examples, tutorials and video projects that use Molecular Nodes in the documentation page.

Installation

See the installation page of the documentation, for detailed instructions on how to install the add-on.

Getting Started

These tutorials are for earlier versions of the addon. There are some differences in design, but overall the workflow is the same. Watch through the videos to get an overview of how the addon works.

image

Contributing

If you would like to contribute to the project, please open an issue to discuss potential new features, or comment on an existing issue if you would like to help with fixing it. I welcome any and all potential PRs.

It's recommended to clone this repository using git clone --depth 1 as the complete commit history gets close to 1GB of data. I also recommend using VS Code with the Blender VS Code addon which streamlines the development process.

Once installed, you can use the Blender: Build and Start command with VS Code open in the addon directory, to start Blender with the addon built and installed. Any changes that are then made to the underlying addon code, can be quickly previewed inside of the running Blender by using the VS Code command Blender: Reload Addonds.

Once happy with your code, open a pull request to discuss and get it reviewed by others working on the project. Open a draft pull request early, or open an issue to discuss the scope and feasability of potential features.

Citation

A paper has not yet been published on the addon, but if you use it in your academic work you can site it from Zenodo:

Thanks

A massive thanks to the Blender Foundation which develops Blender as a free and open source program.

The Blender logo.

Buy Me a Coffee

If you'd like to say thank you, you can buy me a coffee (or 10!) as a thanks for developing the add-on. Many others have already done exactly that. You can also join our Blender.Science discord, where fellow science visualisation enthusiasts and experts hang out and help each other.

Button linking to buymeacoffee.com to leave me a tip as a thank you.

molecularnodes's People

Contributors

blastorios avatar bradyajohnston avatar corredd avatar drdomenicomarson avatar hwcopeland avatar jahooker avatar janash avatar jojoelfe avatar kainszs avatar kimjoyc avatar ljcolson avatar olaprevote avatar padix-key avatar plethorachutney avatar rbdavid avatar thejeran avatar tubiana avatar yaoyinying avatar yuxuanzhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

molecularnodes's Issues

Issue running the Molecular Nodes addon on Mac M1

I installed the addon on Blender 3.1.2 on Mac ARM, and kept getting error when running it:

Traceback (most recent call last):
  File "/Applications/BLENDER_31/Blender.app/Contents/Resources/3.1/scripts/modules/addon_utils.py", line 387, in enable
    mod.register()
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.1/scripts/addons/molecular/__init__.py", line 42, in register
    from . import properties, ui, operators, creators
  File "/Users/jimmygunawan/Library/Application Support/Blender/3.1/scripts/addons/molecular/operators.py", line 14, in <module>
    from . import simulate, core
ImportError: cannot import name 'core' from 'molecular' (/Users/jimmygunawan/Library/Application Support/Blender/3.1/scripts/addons/molecular/__init__.py)

ribbons for RNA

Hi Brady,

I think the ribbons style doesn't work for RNA molecules. Is there a chance it will be added anytime soon? Thanks for the great tool!

Lipophilic potential

Hi Brady,
I am truly amazed and admired of your excellent work!
I am trying to use MolNodes, but the logic of nodes is somehow counterintuitive, at least for my brain configuration! However, I am studying, hopefully one day it will click, and things will become clear.

In the meanwhile, do you think it could be possible to attribute to atoms the value of lipophilic potential, similarly to what we used to do in BioBlender, but without the steps of texture mapping ?
The procedure was based on a library of atomic potentials (for each aminoacid and atom) based on chemistry (i.e. a carboxylic Oxygen is not the same as an alcoholic one), derived form PyMLP (https://github.com/plantigrade/pyMLP). In BioBlender the library was extended to include atoms for DNA, RNA and some other small molecules.

When (if?) I will understand nodes, I might be able to do this by myself, but it could take some time.

Thanks again for you work!
Monica

How can I debug Molecular Nodes? (Cannot load some PDBs and mmCIFs)

Hi Brady,

I have a local PDB file, attached as CTD.zip. It is self-generated so that it has nothing else but only the atom position information. It can be opened in PyMol or ChimeraX. But when I load it via Molecular Nodes, it tells the following error.

Python: Traceback (most recent call last):
  File "C:\Users\luod\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1491, in execute
    sna_func_import_structure_EE5B6(
  File "C:\Users\luod\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 907, in sna_func_import_structure_EE5B6
    n_atoms = len(first_model.atoms())
AttributeError: 'File' object has no attribute 'atoms'

location: <unknown location>:-1

My ultimate goal is to convert this CTD.pdb into mmCIF (with more than one instance of the protein in mmCIF, and hence with transformation info) and then combine multiple proteins' mmCIFs into one big mmCIF. The final mmCIF will have more than 99,999 atoms for sure. So I can only rely on mmCIF format. I tried several tools (mmcif.pdbj.org converter, export from PyMol/ChimeraX, gemmi, pdb-tools). None of them give me a successful loading. The mmcif.pdbj.org converter does seem promising in my case, as the converted file (CTD.pdb.zip) gives the same error as above. And I also noticed that if I convert in this way for 1bna, the converted mmCIF can indeed be loaded via Molecular Nodes. However, I do want to rely on a command-line tool to finish the format conversion as I have a handful of PDBs to be converted.

My guess is there is some metadata that is required to be in the PDB/mmCIF either from the Molecular Nodes side or from the Atomium side. But this info might not actually be that necessary.

Anyways, it would be great and be appreciated if you can help with the debugging. But I would also like to set up a debugging/dev environment. This is the first time I use both Blender and its python addons. But I have some experience using PyCharm/VS/VS code. Could you please guide me shortly on how to set up the dev env? Thanks.

Demo blender project / video?

Hi, I'm a newcomer to blender and I must have misread something in the tutorial.
A video with all the steps starting from a blank blender project or even the project files for a simple animation would be helpful to people like me who are new to blender.

KeyError: 'bpy_prop_collection[key]: key "Group Input" not found'

Hi, I'm trying "Download from the PDB" and "Load MD Trajectory File" according to your document.
However, I got the same error in both cases. Thanks!

Python: Traceback (most recent call last):
  File "C:\Users\ryohei.yamaguchi\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 2471, in invoke
    return self.execute(context)
  File "C:\Users\ryohei.yamaguchi\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 2458, in execute
    sna_func_import_structure_EE5B6(
  File "C:\Users\ryohei.yamaguchi\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1583, in sna_func_import_structure_EE5B6
    sna_setup_node_tree_272D6(output_name, unique_chains, base_model,
  File "C:\Users\ryohei.yamaguchi\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 2599, in sna_setup_node_tree_272D6
    create_starting_node_tree(collection_of_properties=col_properties,
  File "C:\Users\ryohei.yamaguchi\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 2523, in create_starting_node_tree
    node_input = node_mod.node_group.nodes['Group Input']
KeyError: 'bpy_prop_collection[key]: key "Group Input" not found'

location: <unknown location>:-1

MOL_atomic properties not a library

Hi!

I installed MolecularNodes, both the add-on and the atomium installation was said to be fine. However, when I tried to load a pdb file (even from pdb or file), I get the following error:
image
Blender version: 2.93.4, add-on version: 0.4.0

What could the the issue?

Blender 3.2 Compatibility

Runninng list of compatibility issues with the new Blender 3.2 beta release and upgrades of nodes and interface required for a 1.0 release with Blender 3.2.

Will be targeting a 1.0 release of Molecular Nodes to coincide with Blender 3.2 release, which will bring named attributes to GN and make the Molecular Nodes nodes much cleaner and easier to work with.

Import

  • Create panel for MD trajectory import

  • Improve Bond Calculations on Import

    • LImit to within chains
      • Exceptions for disulphide bonds
    • Confirm radii for usage in algorithm
    • Attempt to speed up with numpy
  • upgrade Find Bonds node to take into account chains

  • Add automatic setup of animat frames nodes for multi-state PDB files

MDAnalysis Compatability

  • Confirm import of all properties
  • Add per-frame b-factor import
  • Enable detection of MDAnalaysis by Blender python installation
    • Improve detection of MDAnalysis once installed
  • Enable automatic setuyp of animate frames nodes for MD trajectory files
  • re-order properties to align between MDA and atomium import strategies

Interface

  • Addition of geometry node modifier doesn't auto-create and assign a new node tree, so setup of default nodes fails.
  • Add tooltips to all interface items.

Nodes

  • Upgrade Find Bonds node to take into account atomic radius element
  • Upgrade colour node to use attributes
  • Upgrade selection nodes to use attributes
  • Upgrade EEVEE atoms node to utilise instancing and materials attributes
  • Add invert button for object effect
  • Fix the animate_frames node to not be relative to original position, breaks when atoms teleport to the other side of the simulation box
  • Add per-chain custom colour node
  • Update custom chain selection node to use named attributes

Documentation

  • Documentation for Atomium Install
  • Documentation for MDAnalsysi install and linking
  • Documetation for PDB Download
  • Documentation for opening local file
  • Documentation for MD Trajectory import
  • Nodes Documentation
    • Atomic Properties Documentation
    • Animate Frames Documentation
    • Styling nodes documentation

MDAnalysis unavailable error

I keep getting "Error: MDAnalysis Unavaiable" despite having MDanalysis installed.
I just followed the instructions, and installed:

  • Blender 3.1.2 (ok)
  • Molecular Nodes 0.5.19 (ok),
  • Atomium (ok),
  • python3 -m pip install MDAnalysis (ok)

However, I keep getting the error "MDAnalysis Unavaiable" (I obtain the path from import MDAnalysis as mda; mda.__path__)

Loading pdb with a membrane : List Index Out of range

Hi Brady :)

I wanted to reproduce a previous picture with the geometry made with ChimeraX, but with your nodes :)

The PDB Contains a transmembrane protein with a membrane and I have this error message :

Python: Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 1147, in sna_func_import_structure_EE5B6
    try_append(atom_element_char, get_element(atom))
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 1116, in get_element
    element = element_from_atom_name(atom.name)
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 1108, in element_from_atom_name
    return re.findall("^[A-Z][a-z]?", atom_name)[0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 744, in invoke
    return self.execute(context)
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 740, in execute
    sna_func_import_structure_EE5B6(bpy.context.scene.sna_pdb_code, bpy.context.scene.sna_nanometre_scale, False, bpy.context.scene.sna_pdb_path, bpy.context.scene.sna_molecule_name, bpy.context.scene.sna_create_bonds, bpy.context.scene.sna_connect_cutoff, bpy.context.scene.sna_build_assembly, bpy.context.scene.sna_build_assembly_id)
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 1163, in sna_func_import_structure_EE5B6
    try_append(atom_element_char, get_element(atom))
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 1116, in get_element
    element = element_from_atom_name(atom.name)
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\molecular_nodes\__init__.py", line 1108, in element_from_atom_name
    return re.findall("^[A-Z][a-z]?", atom_name)[0]
IndexError: list index out of range

I'm not sure if the problem is comming from the PDB / Atomium or something with the node... But I leave the PDB here :)
2nq2_membrane_pymol.zip

Thanks :)
Thibault.

no color when plugged into volume.

Hi Brady :)

I saw something strange... I see no color information when I plugged the shader into volume. Is it a bug from the new attribute system ?
Exemple :

  • Plugged into Surface
    image

  • Plugged into Volume
    image

  • Expected results (with just random color here, I tried to check if it was possible to have different colors when plugged into Volume..)
    image

Thank you ;)

How to select a specific residue by residue number

Hello,

I'm sorry if the answer is obvious, but I've been trying to figure out how to select a specific residue by its residue number and show it as ball and sticks. For example, if I want to show residue TRP853 as ball and sticks I'm not sure how to do it. I've been able to select all TRPs in the molecule (using the select by amino acids node available in the selections menu), but haven't been able to figure out how to limit the selection to a specific TRP (TRP853, for example). I'm not even sure if this is possible to do yet, but I'm still trying to see if this is possible.

Any guidance would be super helpful. Thank you so much!

Freestyle issue

Hi,

It's me again. This time I've read the docs and I'm starting to get the hang of it, outstanding work with this package!

Recently I was toying around with using Blender for maths illustrations
For that, one of my favorite effects if FreeStyle to add a line around geometry after rendering
image
image

But I couldn't get it to work with molecular nodes:
image
image

it only picks up the edges, not the atoms. I've tried playing around with a few things, but I'm not very familiar with the point cloud structure. Would you have any advice on how to get this to work?

MacOS: Wrong directory of installation of atomium ?

Hi Brady :-)

Thank again for this wonderfull addon =D
I was trying to set it up on my MacBook Pro, and It didn't work because blender didn't find atomium (despite the installation ended up well).
After some investigation I saw that all tools were install in my Home directory ~/.local/lib/python3.10/site-packages instead of the blender directory (/Applications/Blender.app/Contents/Resources/3.1/python/lib/python3.10/site-packages)

Quick and dirty fix :
mv ~/.local/lib/python3.10/site-packages/* Applications/Blender.app/Contents/Resources/3.1/python/lib/python3.10/site-packages/

Now it works, but I just wanted to reported it if anyone have the same issue at some point :-)

not defined atom types in pdb not accepted

Hi Brady!
Here comes the issue report :)

I have a pdb file with not defined atom types (written as X).
The objects load fine, but the properties can not be assigned correctly.

Fixing it manually by converting X to C works, but for whatever reason I needed to add an TER before END at the end of the pdb file (might be important to mention as well). After those modifications everything worked fine.

Thanks again for your awesome work!
Verena

MOL Addon and update-ability of Nodes

Hi Brady, cool addon and nodes!

I like how your MOL addon simply installed into Blender like addon, but magically adding the extra nodes for Geometry Nodes. This is super handy and efficient in handling dependency.

I am also looking at Erindale ETK and Bradley Animation extra geometry nodes.

I wonder what will actually happen do the node setup when the addon got updated. Will BLEND file be simple recreate the node setup and connect the attributes and parameters of the nodes correctly?

In the past I have been using SVerchok and with SV addon there is a way to:

  • export and import node setup
  • save parameters presets
  • update SV addon itself
  • regenerate nodes based on updated nodes

Mol style ribbon cannot be loaded

Hi all,
I am getting the following error, when trying to add the Ribbon style node, under Styling-Style ribbon.
(The same thing happens when trying to add any of the nodes from the Molecular Nodes package).
Thanks!

Python: Traceback (most recent call last):
File "C:\Users\sarah\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes_init_.py", line 2501, in invoke
return self.execute(context)
File "C:\Users\sarah\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes_init_.py", line 2495, in execute
bpy.context.active_node.node_tree = bpy.data.node_groups[
AttributeError: 'FunctionNodeRandomValue' object has no attribute 'node_tree'

location: :-1

Local file import does not work

Hi Brady,

Short question,
I am following the m-node toturial number two on youtube. But I am stuck at importing the ATP-synthase frames from my desktop, I have made them with chimeraX but when I try to upload them in blender via the local file window the open button does not become highlighted. Any idea how I could solve this issue?
ATP-synthe

Best,
Jorik

test_chain_selection return python error

Hi again :)

I wanted to try the "test_chain_selection" node but it return a python error when an MD is loaded (I haven't tried yet with a static PDB)

Python: Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 604, in invoke
    return self.execute(context)
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 417, in execute
    bpy.ops.wm.append(
  File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: 'C:\Users\BradyJohnston\Documents\GitHub\MolecularNodes\molecular_nodes_append_file.blend\NodeTree\MOL_utils_bool_chain': not a library


location: <unknown location>:-1

Cheers!
Thibault.

Unable to install atomium

image

I'm located in China. Maybe it's because of the network. I tried many times and couldn't install Atomium. Is there any other way?

Problem with Surface Style

Hi Brady

I tried to mimic your tutorial โ€œBlender for Biochemists | Fundamentals of 3Dโ€ with MolecularNodes today, but I found a problem with the surface style. It doesn't seem to be the same as the surface produced by pymol. MolecularNodes create larger surfaces that encapsulate small molecule. ๏ผˆpdb๏ผš6LU7๏ผ‰

image
Atom Style ๏ผˆUsing MolecularNodes๏ผ‰

image
Surface Style ๏ผˆUsing MolecularNodes๏ผ‰

In the surface style, the small molecule and the protein surface are overlaped.๏ผˆpdb๏ผš6LU7๏ผ‰

Problem with the Atomium instalation on windows?

I get the error below when trying to import a pdb-file, online or localy.

I have followed the steps in the instalation guide:
I run Blender as an administrator on Windows 10, and after installing the add-on, i click the button to install Atomium. I get a confirmation that Atomium is successfully installed.

In the MolecularNodes panel i click the "Download" / "Open" button and get the error below. I assume the it is because the Atomium library is not properly installed.

Python: Traceback (most recent call last):
  File "C:\Users\Jonas\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1401, in execute
    sna_func_import_structure_EE5B6(bpy.context.scene.sna_pdb_code,
  File "C:\Users\Jonas\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1134, in sna_func_import_structure_EE5B6
    pdb = atomium.fetch(pdb_id)
UnboundLocalError: local variable 'atomium' referenced before assignment

location: <unknown location>:-1

I am very curious to try this amazing add-on, hope that you can help resolve the issue.

Can't see atoms in blender < 3.2

Hey,

Thanks for developing this ad-on. I've been following your updates on twitter and it looks amazing, finally I've had an evening to give it a try.

Unfortunately I could not get it to work with Blender 3.1.2. I've followed the installation and getting starting docs and it all went smoothly but I couldn't see the atoms in any way. Updating to Blender 3.2 fixed everything. Perhaps I've missed it in the docs but it might be good to have a warning to encourage prospective users to update to the latest blender.

keep up the amazing work!

Attribute Error in Blender 3.2 when loading Molecular Nodes

Hi,

I have installed molecular nodes on Blender 3.2 on macOS Catalina on Intel hardware. The installation is successful (doesn't pop up any errors) but fails to load the Geometry Nodes specific to Molecular Nodes. I am attaching a screenshot of the error I faced. Please let me know what I might be doing wrong. Thanks!

image

Subsurface scattering non compatible with point ?

Hi Brady!

Sorry, another bug in sight XD

I wanted to add some subsurface scattering in the shader and when I activate it and set even a very small value, all atoms becomes very dark, like in the screenshot. I put a Suzanne mesh with subsurface scattering to check if it was not my config.
First screenshot is on GPU render
image
And Strangly, it seems to be a bit better with CPU (but not perfect)
image

But I'm wondering here if the issue doesn't come from Blender itself.... Here's the blend file if you need it for some testing ^^

Cheers!
Thibault.

Windows Install

Excited to see this! Blender wouldn't let me enable the plugin saying it crashed on line 23 of __init__.py file (see source below). I was able to just install atomium by copy/paste the install script in repo though. This was on Blender 3.0.0

bl_info = {
    "name" : "Molecular Nodes",
    "author" : "Brady Johnston", 
    "description" : "A plugin and nodes for working with molecular data in Blender.",
    "blender" : (3, 0, 0),
    "version" : (0, 3, 2),
    "location" : "Perth, Australia",
    "waring" : "",
    "doc_url": "", 
    "tracker_url": "https://github.com/BradyAJohnston/MolecularNodes/issues", 
    "category" : "Molecular" 
}

import bpy
import bpy.utils.previews

import subprocess
import os
import bpy
import bpy
import os
import bpy
import atomium # error here

Split atoms/bonds geometry

As mentioned in the previous issue, I've just started using the ad-on so apologies if I'm creating an issue for something that is obvious/already implemented.

I was trying to create a balls and stick visualization of DNA
image

if I load it with the bonds enabled I can see them:
image

but I can't change their thickness or appearance.

So what I did is I've converted the bonds geometry to curve and then back to mesh with a circle curve around it and passed that as a separate group output instead of merging it to the nodes geometry:
image

then it's simply a matter of setting the material for the bonds separately:
image

and of course the circle curve radius can be changed too:
image

The reason why the material needs to be separately is that otherwise the bonds are colored based on the closest atom:
image

So I was thinking it might be a nice option to separate the two so that users can color/scale the bonds independently of the atoms.

Ps. it might be easier if atoms radii (and perhaps in the future bonds radii) was an input to the main molecular nodes geometry node so that they can be changed without having to look into the node group.

Group Input Node not Available

@orbeckst Thanks for the installation guide! That's really helpful and I got atomium and MDA linking to work(now both buttons are grey). When I was trying to load the pdb and xtc, I still got the following error. It seems to be something from blender
blender-bug
.

Originally posted by @ChenouZhang in #24 (comment)

ChainID reading error (release 0.10.1)

I'm learning the new selection feature and got a error when Molecular Nodes read my customized chainIDs. It seems to use the wrong ID on the wrong chain.
For example, chain 'C' stands for chloride in my pdb, but it represents one of the protomer when Molecular Nodes read it.
image

The naming convention I used for chains is:
ProtomerA-'A', ProtomerB-'B', lipids-'X', sodium-'S', chloride-'C'

I've attached the test file here. I changed the original file format from pdb to txt just to get it uploaded,
NapA-test.txt

Why `Open`/`Download` and then `OK`?

Hi Brady,

What is the design purpose here to have one more confirmation click? (It seems to me a redundant clicking... Every time I was hoping to get the operation being performed right away and then realized I need to click again.)

image

MDAnalysis is not stable in blender

Every time opening blender have to be re-check MDAnalysis, it seems MDAnalysis not stable in blender MAC. Whoever when I re-check MDAnalysis it work fine.

Atomium and big pdb file?

Hello Brady :)

Long time ago I made a video on VMD of my Norovirus Capsid, and I thought that it could be a good test for your tool (Since I have 600K+ atom in the PDB).
Here it is (just 1 state) morph_state001-capsid.zip

The problem is that only one part seems to be read since the numbering stop at 99999 (cf. Screenshot 1). I tried different format (convertion with Pymol to mmtf, mmcif, cif, pdb.gz, cif.gz) and it fails for other format (But here the problem seems to come from the atomium library for reading mmtf or mmcif when the output comme from Pymol maybe ?)

For this issue maybe the problem come from the atomium library itself ? But I wanted to repport it since with this new render system it seems possible to load very big systems, and unfortunatly the "assembly" coming from the PDB is splitted into different models (so your addon think it's a trajectory)

Anyway, here's some extra information โคต๏ธ and thank you again for this already great piece of work =D
Thibault.

Screenshot 1:
image

traceback for loading when it's mmtf

Python: Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 80, in execute
    sna_func_import_structure_EE5B6(bpy.context.scene.sna_pdb_code,
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1137, in sna_func_import_structure_EE5B6
    pdb = atomium.open(pdb_path)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 41, in open
    return parse_string(filestring, path, *args, **kwargs)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 122, in parse_string
    parsed = file_func(filestring)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 18, in mmtf_bytes_to_mmtf_dict
    return decode_dict(raw)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 40, in decode_dict
    new_value = [decode_dict(x) for x in new_value]
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 40, in <listcomp>
    new_value = [decode_dict(x) for x in new_value]
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 37, in decode_dict
    new_value = parse_binary_field(new_value)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\mmtf.py", line 56, in parse_binary_field
    codec, length, params = struct.unpack(">iii", b[:12])
struct.error: unpack requires a buffer of 12 bytes

location: <unknown location>:-1

Traceback for loading when it's mmcif

Python: Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 506, in add_atom_to_non_polymer
    ] = atom_line_to_dict(line, aniso_dict)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 530, in atom_line_to_dict
    a["x"] = float(line[30:38].strip())
ValueError: could not convert string to float: '9 ? -57.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 80, in execute
    sna_func_import_structure_EE5B6(bpy.context.scene.sna_pdb_code,
  File "C:\Users\tubia\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\molecular_nodes\__init__.py", line 1137, in sna_func_import_structure_EE5B6
    pdb = atomium.open(pdb_path)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 41, in open
    return parse_string(filestring, path, *args, **kwargs)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\utilities.py", line 124, in parse_string
    parsed = data_func(parsed)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 86, in pdb_dict_to_data_dict
    update_models_list(pdb_dict, data_dict)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 158, in update_models_list
    add_atom_to_non_polymer(line, model, res_id, aniso, full_names)
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 512, in add_atom_to_non_polymer
    "atoms": {int(line[6:11]): atom_line_to_dict(line, aniso_dict)}
  File "C:\Users\tubia\AppData\Roaming\Python\Python310\site-packages\atomium\pdb.py", line 530, in atom_line_to_dict
    a["x"] = float(line[30:38].strip())
ValueError: could not convert string to float: '9 ? -57.'

location: <unknown location>:-1

Can't select all side chains for 3JC8

Hey,

I've been using chain_number and MOL_select_atoms to differently style different chains in protein complexes. So far it mostly worked but I'm struggling with 3JC8

I can load the whole thing
image

and select a few chains:
image
image

however if I try to select something else I don't see anything
image

even though I can see 7.k instances exist:
image

if I merge the two selection I see something, but the style is not applied correctly:

image

if I use Cycles I can see the second selection:
image

but if I merge both the color gets changed
image

different ways to enforce the restriction doesn't help either:
image

Some more attempts. This selects a bunch of chains
image
image
but if the second threshold is >19:
image

This way of selecting chains worked perfectly with all other proteins I've done so far, so I don't think I'm doing something wrong here. Perhaps there's something wrong in the way the chain number is represented?

PDB without 4-character code

I'm trying to load a PDB from a MD simulation from a folder. It has no 4-character code and all the times i tried to, it failed.

Is there a way to load a "custom" pdb or only from PDBDatabank?

image

Thank you!

import_protein_local does not import frames

I was trying to debug why my generated PDB files were not working and I think I tracked it down to the import_protein_local function.

If I try enter PDB code and download, all is good.

But if I manually download, enter the location of pdb file, I get this error:
image

The frames are not imported.

Here is the pdb file I tried:
https://files.rcsb.org/view/7QIL.pdb

add MolecularNodes to the MDAnalysis "used by" page

MolecularNodes is awesome, and it's fantastic that MDAnalysis can help with importing trajectories. Thank you for acknowledging our library!

MDAnalysis has a "Used-by" page https://www.mdanalysis.org/pages/used-by/ . I opened a PR to add MolecularNodes to this page at MDAnalysis/MDAnalysis.github.io#228 โ€” it would be great if you could have a quick look that you're happy with the representation of your project. A quick comment on the PR is all I am looking for.

Should you not want to be listed then we'll respect your wish, of course, you just have to say something.

Incorrect assignment of elements

I have a little hydrogen peroxide pdb file that looks like this:

ATOM      1  O   PER     0       0.038  -0.113  -0.046  0.00  0.00           O  
ATOM      2  H   PER     0       0.132  -0.803  -0.752  0.00  0.00           H  
ATOM      3  O   PER     0      -1.074  -0.427   0.586  0.00  0.00           O  
ATOM      4  H   PER     0      -0.777  -0.749   1.475  0.00  0.00           H  
END

When I load it with MolecularNodes it seems to become three oxygens and one hydrogen. I notice that the auxllary object ohoh_properties_1 only has three vertices, where I would have expected four. The x-values of the vertices are 8.0, 1.0, and 8.0, which I assume are the atomic numbers. Nothing seems to tell Blender that the last atom is a hydrogen. I spotted a potential too short range in create_properties_model, in which case one should remove '-1' from the following:
locations=list(map(lambda x: [get_value(prop_x, x), get_value(prop_y, x), get_value(prop_z, x)], range(len(first_model.atoms()) - 1))))

How to slice protein so that we can show the interior region

The idea of slicing protein is important in preparing atomic images since a lot interesting atom-atom interactions are located under the surface of a protein. Is there a function in molecular nodes to select all atoms on one side of a plane so that we can hide that part of the protein to show the interior region?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.