Giter Club home page Giter Club logo

Comments (13)

ghutchis avatar ghutchis commented on June 12, 2024

Ooh, that would be lovely. I would think you could piggy-back on the symmetry support.

from 3dmol.js.

dkoes avatar dkoes commented on June 12, 2024

I think the symmetry support does most of what you want. It will grab the BIOMT records out of a pdb. cif support is still a work in progress, but it will work similarly.

By default we don't show the symmetric units (you have to pass the doAssembly option). I've enabled this option in the example page:
http://3dmol.csb.pitt.edu/tests/example.html
If you go there and download 2POR you'll see the full assembly.

Symmetric units are efficiently rendered - the geometry is not recalculated, just redrawn with a different transform. This means you can't uniquely style the individual units. However, with the get and set symmetry functions you can specify which symmetries belong to which model (for example, if you want to style a single subunit one way and all the others another way).

We're still working on both symmetry support (surfaces don't do the right thing yet) and cif support. I'm assigning this to the two students who are doing this so they know someone is interested.

Let us know if there are other ways you want to interact with this sort of data.

from 3dmol.js.

patrickfuller avatar patrickfuller commented on June 12, 2024

Have you thought about hosting an openbabel HTTP server and running conversions through that until you build up js support?

Regarding crystals, a unit cell box is an easy-to-add feature with substantial benefit. It's 30-ish lines with three.js and jquery, and should be translatable to your codebase.

Regarding other feature requests, I have a closed-source UI that has some useful crystal functionality. I've been meaning to wrap it up into a FOSS project, but haven't had the time. If you want, I could explain some of those features + pseudocode and then @jlc206 and @Jus1in can decide if any are worth pursuing.

from 3dmol.js.

dkoes avatar dkoes commented on June 12, 2024

fe69130

The GLViewer class now has an addUnitCell function. If a model has unit cell data (e.g., from a pdb file) this will return a GLShape object with the box defined as line shapes.

What is CIF unpacking?

from 3dmol.js.

patrickfuller avatar patrickfuller commented on June 12, 2024

CIF unpacking = processing symmetries. processSymmetries looks like it does this already.

from 3dmol.js.

dkoes avatar dkoes commented on June 12, 2024

So like this: http://3dmol.csb.pitt.edu/tests/testsym.html

I think we'll also add support for generating the symmetry axes and then close this issue, unless there are other desirable features.

from 3dmol.js.

patrickfuller avatar patrickfuller commented on June 12, 2024

That's exactly it.

Have you tried running your mmCIF parser against structures in the CCDC? It'll stress test your parser, but, if it works, I think you could declare 3dmol.js crystal friendly.

from 3dmol.js.

dkoes avatar dkoes commented on June 12, 2024

The CCDC isn't exactly open or accessible. I can't even figure out how to download the small teaching subset, which seems like it would be ideal for surveying a diverse set of structures.

A random sample from the Crystallography Open Database might do the trick. We've been mostly focused on PDB cifs - examining small molecules cifs is definitely a good idea.

from 3dmol.js.

patrickfuller avatar patrickfuller commented on June 12, 2024

Agreed that it's a mess (just like CIFs). Here's a download link.

wget https://downloads.ccdc.cam.ac.uk/supplementary_materials/teaching_subset_cifs.tgz

Errors I usually see in parsers are:

  • Handling non-rectangular unit cells
  • Handling multiple conformations in one file
  • Collision / spacegroup detection to fix malformed files (optional)

The CCDC is a messy database (maybe the teaching subset is different?). Hopefully it'll be useful in stress testing the parser.

from 3dmol.js.

sky1e avatar sky1e commented on June 12, 2024

I have gone through many of the CIFs in the teaching subset and fixed many issues. The only one that I've found that still doesn't work is CHOLES20, explained in #102. I made sure to handle non rectangular unit cells correctly (22a7a5e). Could you explain what you mean by multiple conformations in one file?

I then added crystal symmetry support (22298ee). This converts all of the crystal symmetries into transformations, which are then rendered when passed the doAssembly=true option is passed. At the moment, any reflected symmetries will appear as black, as all of the normals are flipped inward, but reflections shouldn't happen often. If this is ever an issue pass the duplicateAssemblyAtoms=true option. It is slower, but should render correctly.

It looks like the crystal symmetry support commit has not been pushed to the website yet. Once it is, see if it works for you.

from 3dmol.js.

dkoes avatar dkoes commented on June 12, 2024

I've updated the website (git is always the most up to date version). Multiconformer support is what Jasmine is working on. I don't know what this looks like in cifs. For most file formats you just concatenate together single conformer files.

from 3dmol.js.

patrickfuller avatar patrickfuller commented on June 12, 2024

It's basically the same in cifs. Their key-value notation is sometimes used to mash together different structures, different conformers, etc. into one file. I just asked some colleagues to send me CIFs with conformers that don't parse well. Here's a good example.

I'd say additional work here is nice to have, but not necessary. The drawer works on >90% of my cifs, so it's definitely usable. This extra conformer business can be handled externally when it pops up.

from 3dmol.js.

sky1e avatar sky1e commented on June 12, 2024

I finally fixed the issue where reflected transformations would render black. Are there any other issues with crystal symmetry support, or can this issue be closed?

from 3dmol.js.

Related Issues (20)

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.