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

Current Milestone - Electron Density and Atom Quality Specification #238

Open
TJGorrie opened this issue Mar 19, 2021 · 0 comments
Open

Comments

@TJGorrie
Copy link

See Attached Slides:
Fragalysis_Electron_Density_and_Atom_Quality.pptx

Electron Density

Need an extra, optional, view to display the experimental evidence behind XChem experiments.
Files can be optionally supplied at file upload. These will follow a ligandname_event.ccp4 file pattern but there is also a possibility that these files can be supplied as .map files.

image

Expected Behaviour

  • When loading a ligand (clicking L) the electron map should not appear by default
  • Upon clicking 'D' the electron density is rendered in the style indicated by the surface/wireframe toggle found in the settings
  • Upon clicking 'D' a second time, the electron map should be render in the other style (Frank's idea).
  • Clicking 'D' a third time should remove the electron density from view.

Technical bits

Map files can be read in and rendered using this (you may want to edit it).

function readMap(file, color, opacity, isolevel, smooth, boxSize, wireframe){ 
  fetch(file).then(function(x){ 
    stage.loadFile(file, {ext:'ccp4'}).then(function(o){
      o.addRepresentation(
        'surface’,
        {
          color: color,   // This should be the same as ligand colour
          isolevel: isolevel,   // Essentially, to what degree of ‘evidence’ do we want to display...?
          smooth: smooth,   // The number of cycles the browser should apply to render the surface, lower=faster
          boxSize: boxSize,   // How large of an area around the ligand should be rendered. Default = 0.
          contour: wireframe===true,   // I don’t write JS so probably poorly implemented but whether a surface envelope or wire-frame is rendered 
          wrap: true,   // required
          opacity: opacity,   // How transparent the electron density envelope/wireframe should be (between 0 and 1)
          opaqueBack: false   // required to render surface envelope opacity
        }
      )
    })
  })
}

The color, opacity, isolevel, boxSize and contour or wireframe commands should be controllable by the user and can be controlled via the settings panel.

image

Here are two examples of how the maps could be render in surface envelope:
image

and wireframe modes:
image

Lastly, any and all map representations need to be available in the display controls options to allow users full control over the representation.

image

Atom Quality

We have proposed a mechanism to render individual atoms that we are not confident in differently, this will be in the context of the evidence.
These require optional strings that specify the atom id and a comment pertaining the reason why the atom is poor quality.
This information will be encoded in the .mol files that are used to render the individual ligands in Fragalysis.
This information is communicated as two strings i.e "0;1;2;3;4" and "lorem;ipsum;dolor;sit;amet" separated by ';'s.

What it should look like:

image

Mol file example:

image

How it behaves in Fragalysis

image

Atom quality should be toggled by another box labelled 'Q'. Which should be next to the V or D boxes. When clicking L this will be automatically toggled on. When Q is turned off the mol file should be rendered normally. likewise when L is turned off then the Q should also be turned off.

Additionally, a warning triangle should appear nearby or on top of the 2D images, and can also toggle the behaviour as if it is a Q button.

The Q button + warning button should only be available if information was supplied to the badatoms (if there is something different to render).

How to render the .mol files so weirdly?

The code used to render the atoms is described here:
https://github.com/TJGorrie/FourMol/blob/master/AQandED.js

The file contains the readFileFixedStyle function as an example.

Briefly: we use a custom mesh to place spiky balls at the location where the bad atoms are indicated. Dictated by feed in the BADATOMS string e.g. '0;1;2;3;4'
Uses a custom mesh to place spiky balls at location where bad atoms would appear. And also joins all atoms with special stripy bonds if atoms are connected to a spiky atom.

The function requires 3 inputs:
file – The .mol file to be rendered
badids – A string, containing integers corresponding to atoms to render differently e.g. ‘0;1;2;3’ separated by ‘;’s. If given an empty string ‘’, then ligand should be rendered normally.
badcomments – A string, coordinating with the badids of context regarding why an atom is rendered differently. These strings will be contextually added to the hover over tags on the atoms.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants