Giter Site home page Giter Site logo

nglviewer / ngl Goto Github PK

View Code? Open in Web Editor NEW
646.0 646.0 167.0 539.47 MB

WebGL protein viewer

Home Page: http://nglviewer.org/ngl/

License: MIT License

Python 0.15% JavaScript 8.28% GLSL 3.15% Shell 0.07% TypeScript 88.35%
javascript molecular-graphics molecular-structures scientific-visualization web-application webgl

ngl's People

Contributors

arose avatar chmnk avatar christoph-elfmann avatar cxn-astracz avatar fil avatar fredludlow avatar fredricj avatar garyo avatar giagitom avatar gky360 avatar hainm avatar hhongseungwoo avatar itswil avatar j0kaso avatar jussty avatar luxaritas avatar martingraham avatar milot-mirdita avatar ohheylucas avatar pablowatson avatar papillot avatar ppillot avatar rennradjunkie avatar rgbkrk avatar rudolfspetrovs avatar sbliven avatar vbchen avatar vvv444 avatar xcorail avatar yitzchak 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngl's Issues

Color Spectrum BGR by b-factor

I am trying to use ngl to create a visualization for a webserver. Is there a way to color by b-factor and set the color spectrum. For example, everything below a b-factor below 0.2 is blue, .2 to .8 is green, and .8 to 1 is red?

Thanks!

User-friendly API for geometric primitives

The current methods for building geometric primitives (buffer.js) do not appear to be designed for use by end users. Adding some documentation would be a great first step, as the arguments are often hard to guess and there are many similarly-named functions (e.g. should I use a SphereBuffer, a SphereGeometryBuffer, or the nefarious SphereImposterBuffer?). It would also be nice to have some higher-level structures, such as a method for arrows.

Performance of NGL.ColorMakerRegistry.addSelectionScheme( selection_scheme )

Hello. I got color changing to work. I am now dealing with performance issues. There are a lot of things I can do on my end to improve performance of my webapp. However, I need some insight into the NGL.ColorMakerRegistry.addSelectionScheme( selection_scheme ) function.

I have noticed this function is O(N^2), where N is the number of selections in selection_scheme. I'm not sure why this is the case, but it may have something to do with the way jQuery works. For example, if N =130, NGL takes 968ms, but at N=2492, it takes 22571ms. My highest theoretical N so far is around 7000, although I may never see that in practice. That would take around 90,000ms to run. That's quite a bit too much for an interactive application.

Can you think of a better faster way to do this? Would combining selections be faster? For example, which is faster?

red, 10-50
red, 70-80

OR

red, 10-50 or 70-80

I know with Jmol and PyMOL, if I tried to put too many ORs together, it would crash. Please advise,

Thank you

Chad

Wishlist: smoothing traj

Just like vmd.

In python we can use scipy (same as mdtraj) for traj smoothing. Not sure about what u want for js side.

Better cartoon arrows

Currently cartoon arrows have no sharp transition from and to the rest of the cartoon. This is especially apparent with few segments.

arrow1
arrow2

To solve this, additional sets of vertices need to be added at the transition points.

wishlist: option for zoom, speed, ...

I am myself using VMD for visualization and there are few things I want to customize in in ngl

  • camera: orthographic or perspective (I normally use orthographic camera)
  • zoom and rotation speed: Most of viewing packages make me feel the molecule is very heavy when rotating. It's great if ngl allows user to config (right now I need to change js file)

wishlist: shortcut key for "Translate" (T) and "Rotate" (R)

currently ngl uses right mouse button for translating molecule. But using ring finger to push seems requiring more press. What's about adding shorcut key T (same as VMD) to switch to translate mode to be used with index finger? add adding 'R' to go back to Rotation mode.

PS: since I am using VMD and find it very convenient, I will suggest some nice features (I think).

Parsing of the embedded structure in Gaussian98 Cube files

The atom line parsing can be done inside the NGL.CubeParser class and similar to the NGL.GroParser._parse. The atom elements need to be assigned from the number code in the atom lines. To complete the structure, post-processing as in NGL.StructureParser is required.

Further, the NGL.Stage.loadFile method needs to be adapted to create two components for the Cube file, a SurfaceComponentand additionally a StructureComponent.

Unloading files

I'm not sure the best way to unload a file. I only need one mmCIF file loaded at a time, at least in the near future. What code do I run as soon as I know I'm going to need a different file?

Also, when I accidentally loaded a second structure, WebGL crashed. I'm not sure if that is a bug or not. It may just be that my computer ran out of memory when trying to do that. I may experiment with loading multiple large structures another time and test the limits.

Superimpose sub-selection

It is often useful to superimpose structures based on a single chain or selection. The most natural (for me) way to do this in NGL would be to filter two structures to the desired selections, superimpose them, and then remove the filters to show the unaligned portions as well. However, the superposition gets updated automatically after changing the filter. Should this behavior be changed to only update the superposition after manually selecting the Superpose option, or is there another way to superimpose based on a selection?

Problems with API documentation

Hello. I have found at least one spot where the documentation is wrong. I'm looking at this page, http://arose.github.io/ngl/doc/#API_reference/Object/ColorMakerRegistry

You have the following example,

// color residues 1 to 100 in red, 101-200 in blue and the remaining in white
var mySelectionScheme = NGL.ColorMakerRegistry.addSelectionScheme( [
[ "red": "1-100" ],
[ "blue": "101-200" ],
[ "white": "*" ]
] );
// apply colorscheme to an existing representation
repr.setParameters( { color: mySelectionScheme } );

In order to make this work, I had to change the : to , and change color to colorScheme, like this.

// color residues 1 to 100 in red, 101-200 in blue and the remaining in white
var mySelectionScheme = NGL.ColorMakerRegistry.addSelectionScheme( [
[ "red", "1-100" ],
[ "blue", "101-200" ],
[ "white", "*" ]
] );
// apply colorscheme to an existing representation
repr.setParameters( { colorScheme: mySelectionScheme } )

What did you intend?

Chad

Best guess for representation

This is my wish list but might be very low priority.

Supposed I have a molecule and load to ngl. I do not have artistic eye but wanting to have nice rendering. I just want to have an option, such as 'I am lucky' to have ngl to o make best guess to make nice representation for me. (So I can make good figure for publication)

Compatible Chain IDs

Hello, great project. I have an issue though.

In mmCIF format, you are using label_asym_id for the chain names. On it's own, that seems reasonable. However, the PDB and PyMOL, and maybe others use auth_asym_id for the chain names. Do you think NGL should use auth_asym_id as well in the interest of compatibility? You know a lot more about your program and these file formats than I do. I'm sure you will come up with a reasonable solution.

Wishlist: Autorotate

Good for demos would be an auto-rotate option that just continuously rotates model until mouse takes over.

Fully support chains for biological assembly generation

Currently the transformation matrices for a specific biological assembly must all be applied to the same set of chains. However in PDB entries like 4OPJ two different matrices need to be applied to two different sets of chains to create a biological assembly.

Before I start with this I will implement the use of bitsets to represent atom selections which will allow easier and more efficient combination of selections.

Allow drawing of cylinders between separate structures

  • could be a representation that is linked to multiple structures
  • one question is if atom selections are useful as they do not support selecting a specific structure (which could be another feature request)
  • an implementation might be similar to the DistanceRepresentation with the atomPairparameter

Caching

Parsing is one of the slowest steps of this program. I use very big macromolecules, and the parsing makes my program appear unresponsive. I'd like to minimize that.

  1. How do I put up some status messages on the screen?

  2. Is it reasonably possible to cache parsed structures? In MATLAB, I save and load in .mat format instead of reading in the pdb every time. Could we do that here in JSON format or something? Although it would have to be gzipped too to minimize transfer time between the server and client.

I could help code this with some direction, I don't know the inner workings of this program yet.

Thanks.

Simplify initialization for builds/non-development mode

Since the normal builds contain all assets there is no need to do async initialization. This is only needed for development mode where a number of assets loaded async. Basically get rid of the callback in NGL.init( callback ). Maybe get rid of the whole function for builds.

local file system support

Standalone NGL Viewer does not always work if used from local filesystem (file:///...). The error only shows up in Chromium, in Firefox everything works fine. The problem also disappears if security policies in Chromium are relaxed deliberately with "--allow-file-access-from-files".
Image of Yaktocat

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.