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

NGL Viewer for molecule representation #3601

Merged
merged 5 commits into from Feb 15, 2017

Conversation

Projects
None yet
5 participants
@anuprulez
Copy link
Member

commented Feb 12, 2017

​Introduction:

This Pull Request includes the NGL viewer for visualizing molecular structures like PDB. It uses WebGL to exhibit 2D/3D molecular structures and offers an array of intriguing representations. It is available as charts in the Galaxy.

Here are some representations of PDB molecules using NGL viewer:

main1

main2

Display modes:

There are multiple display modes like representation with axes (Axes), secondary structure abstraction (Cartoon), bonds and atoms shown as cylinders and spheres respectively (Ball+Stick), lines for bonds (Line) and many more. More information can be read here.

dp1

ball stick

axes

dp3

Other features:

There is a list of rich color schemes like Uniform, Random, Polymer, Hydrophobicity and so on to display a representation in multiple shades.

color1

color2

The background color of the viewer can be chosen as either light or dark. The radius of a representation can be chosen using a slider. Moreover, any representation can be rotated on an axis by turning on the spin feature.

WebGL support:

To run the NGL viewer, it requires a browser to support WebGL (which is accessible in current browser versions. More information about WebGL support in browsers can be found out here).

Courtesy:

The source code of this library is at here.

  • AS Rose, AR Bradley, Y Valasatava, JM Duarte, A Prlić and PW Rose. Web-based molecular graphics for large complexes. ACM Proceedings of the 21st International Conference on Web3D Technology (Web3D '16): 185-186, 2016. doi: link

  • AS Rose and PW Hildebrand. NGL Viewer: a web application for molecular visualization. Nucl Acids Res (1 July 2015) 43 (W1): W576-W579 first published online April 29, 2015. doi: link

Credits:

Thanks a lot to @bgruening and @guerler for their suggestions and reviews.

Note:

  • The "Surface" display mode takes a few seconds to generate. It is under development as per the official documentation.

  • The visualizations in Galaxy can be enabled by adding a path in galaxy.ini file visualization_plugins_directory = config/plugins/visualizations

@galaxybot galaxybot added the triage label Feb 12, 2017

@galaxybot galaxybot added this to the 17.05 milestone Feb 12, 2017

@bgruening

This comment has been minimized.

Copy link
Member

commented Feb 13, 2017

Thanks @anuprulez!

initialize: function( options ) {
var dataset = options.dataset,
settings = options.chart.settings,
url = window.location.protocol + '//' + window.location.host + "/datasets/" + dataset.dataset_id +

This comment has been minimized.

Copy link
@guerler

guerler Feb 13, 2017

Contributor

I think this should be url = dataset.download_url. Then it will also work if the instance url is prefixed.

@anuprulez anuprulez force-pushed the bgruening:ngl_viewer branch from 77b6b7b to 6864bc3 Feb 15, 2017

@guerler guerler force-pushed the bgruening:ngl_viewer branch from 071d947 to c390da3 Feb 15, 2017

@guerler

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2017

I repacked the scripts with webpack -p.

@guerler

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2017

Looks good to me. 👍

color: settings.get( 'colorscheme' ),
opacity: settings.get( 'opacity' )
};
stage_parameters = { ext: dataset.extension, name: dataset.name, defaultRepresentation: true };

This comment has been minimized.

Copy link
@dannon

dannon Feb 15, 2017

Member

Is dataset.name escaped at this point? Is there any risk here of unsanitized names being displayed in the viz?

This comment has been minimized.

Copy link
@guerler

guerler Feb 15, 2017

Contributor

The name option does not seem to be used anywhere nor its documented as option for loadFile. Thanks for pointing it out.

This comment has been minimized.

Copy link
@dannon

dannon Feb 15, 2017

Member

Cool, good to know. Since it's unused (and not required), let's cut that out, and then I'm +1 and will merge?

@dannon

This comment has been minimized.

Copy link
Member

commented Feb 15, 2017

Thanks for the contribution, this looks great!

@dannon dannon merged commit 43f2a64 into galaxyproject:dev Feb 15, 2017

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@anuprulez

This comment has been minimized.

Copy link
Member Author

commented Feb 15, 2017

Thanks a lot @dannon and @guerler for reviewing and merging!

@bgruening bgruening deleted the bgruening:ngl_viewer branch Feb 15, 2017

@bgruening bgruening referenced this pull request Feb 21, 2017

Closed

Enhance Charts #3642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.