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

Load OpenDX files #438

Open
FilouPlains opened this issue Feb 19, 2024 · 8 comments
Open

Load OpenDX files #438

FilouPlains opened this issue Feb 19, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@FilouPlains
Copy link

Load OpenDX files

Hi! First of all, thanks a lot for your hard work! This extension and its constant improvement is awesome!

OpenDX (extension .dx) is a grid format that you can visualize using, for instance, VMD or PyMol. I was wondering if it was possible to do something using your Blender extension, to open these files? Currently, what I am manually doing is exporting, using VMD, the obtained grid in a .OBJ and .MTL files. Then I open them into Blender and I align this grid to the protein…

If I am not mistaken, you are using MDAnalysis, which can write and open these formats. But anyway, if it is not doable, there are no problems, due to the particular format.

Thanks again for your hard work!

@BradyAJohnston
Copy link
Owner

Thanks for the kind words!

It seems that MDAnalysis certainly can read the data format. In theory if MDAnalysis can parse it, then we should have very little trouble using it to bring the data to Blender.

I've tried looking at opendx.org and the website doesn't load, so I am not entirely sure what the data format is.

If you could link to some example data, and how you would want this example data to be rendered or visualised, then I'm sure we can set something up to import it into Blender via Molecular Nodes.

@BradyAJohnston BradyAJohnston added the enhancement New feature or request label Feb 19, 2024
@FilouPlains
Copy link
Author

Thanks for this reply !

Render example in VMD

The picture

isosurface

Information of how it was done

Actually done in VMD 1.9.4a55 using Tachyon 0.99.1. The command used to load the structure was:

vmd 1EHE.pdb 2024_02_20_10-07-27_abps.dx

Into the representation, two isosurface were drawn at value -1 and 1. Rendering was done using the GUI of VMD. The objective, here, is to display certain properties around the protein, using a .dx of my own. But I know, for instance, that other software like ABPS produce those kinds of .dx files, to visualize other properties.

The 2024_02_20_10-07-27_abpq.dx file: https://drive.google.com/file/d/1YOpUdKnSCCAkg6ysHsYxj0C8egi3zM7M/view?usp=sharing . Too heavy to just paste or linked to this comment.

What could be done?

Something like VMD, where you import the .dx file, and it is linked to the structure. In other words, if I change the size or the rotation of the protein, the charged grid also does so. Then, there is, in the geometry node, something to change the isovalue (like up there, with -1 and 1). Well, something like VMD but with the power and the beauty of Blender!

If you need other information, please do not hesitate to ask!

@BradyAJohnston
Copy link
Owner

Do you have a PDB code that goes with this protein & .dx for testing purposes?

@FilouPlains
Copy link
Author

The PDB code should be 1EHE and the .dx file is the one given into the Google Drive : https://drive.google.com/file/d/1YOpUdKnSCCAkg6ysHsYxj0C8egi3zM7M/view?usp=sharing . Tell me if everything work well! The two isovalues for the given figure were chosen : -1 and 1.

@BradyAJohnston
Copy link
Owner

I have successfully got it importing into Blender:
CleanShot 2024-03-08 at 17 10 05@2x

I am unsure about the two cutoffs for the isovalues though. When convertying a density to mesh in Blender - I only have the option for a single cutoff value (in the image is 1).
But there is certainly potential!

@FilouPlains
Copy link
Author

It looks so great! After some discussion with collegues, it seam there are two option when working with isosurface:

  1. You give one value, and there is a already-define delta. I think this is the case for VMD.
  2. You give minimum and maximum values. I think this is the case for Chimera.

I would say 2d case is the best, but if it's working with the 1st one, it is also so cool!

Thank you for your dedication into this awsome project!

@BradyAJohnston
Copy link
Owner

Thanks for the extra info @FilouPlains - I'll look into what kind of options I can have for cutoffs. In the image you attached there are two colors on the generated volume mesh - where are those values coming from? I'm assuming you are using some attribute of the volume to choose colors?

@FilouPlains
Copy link
Author

🖼️ Pictures examples

Fig 1. - 1EHE with isosurface set to 1. Here, I choose 1 to have all electrostatic positive mesh values.


Fig. 2 - 1EHE with isosurface set to -1. Here, I choose 1 to have all electrostatic negative mesh values.

🔎 Details of obtention

In VMD, I can open a structure and an isosurface grid like this:

vmd 1EHE.pdb 2024_02_20_10-07-27_abps.dx

Then, into the interface, I can select a value and a colour. Here, to obtain the picture in the first message (orange background), I do a superposition of the isosurface shown in Fig. 1 ad Fig 2.

The things here, with VMD, is that I would prefer to do something like (if, for instance, isosurface value goes from -100 to 100):

  • Isofurface 1: From -100 to 0. Or, from min() to 0.
  • Isofurface 2: From 0 to 100. Or, from 0 to max().

Like that, I would be able to do a full isosurface all both negative and positive values obtained for electrostatic computation. Which is not currently possible in VMD using the GUI (maybe through TCL, but I do not want to suffer).

Based on what you said, it I could be also nice to do, something like (if, for instance, isosurface value goes from -100 to 100):

  • Isosurface: From -100 to 100. Or, from min() to max().
  • Coloring: Based on isosurface values, following a certain gradient scale (blue-white-red, viridis…).

I hope I answered your question! If you want me to explain again or give other details, do not hesitate to ask!

Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants