3dmol 中文文档教程

发布于 3年前 浏览 31 项目主页 更新于 3年前

3Dmol.js

CDNJS

3Dmol.js 是一个面向对象的、基于 webGL 的在线分子可视化 JavaScript 库 - 无需 Java!

由于 3Dmol.js 是在宽松的 BSD 开源许可证下获得许可的,您可以在任何项目中自由使用它,只要正确确认代码并且 引用

使用 3Dmol.js,您可以将呈现精美的分子可视化效果添加到您的 Web 应用程序中。 功能包括:

  • support for pdb, sdf, mol2, xyz, and cube formats
  • parallelized molecular surface computation
  • sphere, stick, line, cross, cartoon, and surface styles
  • atom property based selection and styling
  • labels
  • clickable interactivity with molecular data
  • geometric shapes including spheres and arrows

请参阅文档以了解如何将 3Dmol.js 用作托管查看器、可嵌入查看器、或作为更大应用程序的组件。

Examples

PDB

我们支持使用 PDB 查询和 PDB 文件。

Alt Text

首先,您只需使用 div 的 id 创建查看器。

var viewer = $3Dmol.createViewer($("#div"));

然后您可以下载一个蛋白质数据库模型(此处为 pdb:1MO8)并以您选择的样式显示它。

$3Dmol.download("pdb:1MO8",viewer,{multimodel:true, frames:true},function(){
    viewer.setStyle({}, {cartoon:{color:"spectrum"}});
    viewer.render();
});

Surfaces

我们还支持使用异步加载的表面,支持不同的配色方案

Alt Text

viewer.addSurface($3Dmol.SurfaceType.VDW, {
    opacity:0.85,
    voldata: new $3Dmol.VolumeData(volumedata, "cube"),
    volscheme: new $3Dmol.Gradient.ROYGB(range[1],range[0])
},{});

Shapes

支持使用不同的形状和样式。

Alt Text

viewer.addCylinder({start:{x:0.0,y:2.0,z:0.0},
    end:{x:0.0,y:10.0,z:0.0},
    radius:0.5,
    fromCap:false,
    toCap:true,
    color:'teal'});
viewer.addCylinder({start:{x:15.0,y:0.0,z:0.0},
    end:{x:20.0,y:0.0,z:0.0},
    radius:1.0,
    color:'black',
    fromCap:false,
    toCap:false});

Documentation

请在 3dmol 查看我们的文档。 js。 我们有教程,以及平台的稳定版本。

Contact

请将任何问题或疑虑发送至 dkoes@pitt.edu。 您也可以在 github 上提交问题

Citing

如果您使用 3Dmol.js,请引用我们的生物信息学论文

Funding

3DMol.js 由国家综合医学研究所的 R01GM108340 资助。 内容完全由作者负责,并不一定代表美国国立综合医学研究所或美国国立卫生研究院的官方观点。

3Dmol.js

CDNJS

3Dmol.js is an object-oriented, webGL based JavaScript library for online molecular visualization - No Java required!

Since 3Dmol.js is licensed under the permissive BSD open-source license, you are free to use it in any project, as long the code is properly acknowledged and cited.

With 3Dmol.js, you can add beautifully rendered molecular visualizations to your web applications. Features include:

  • support for pdb, sdf, mol2, xyz, and cube formats
  • parallelized molecular surface computation
  • sphere, stick, line, cross, cartoon, and surface styles
  • atom property based selection and styling
  • labels
  • clickable interactivity with molecular data
  • geometric shapes including spheres and arrows

See the documentation to learn how to use 3Dmol.js as a hosted viewer, embeddable viewer, or as a component of a larger application.

Examples

PDB

We support the use of both PDB queries as well as PDB files.

Alt Text

First you simply create the viewer with a div's id.

var viewer = $3Dmol.createViewer($("#div"));

Then you can download a protein data bank model (here pdb:1MO8) and display it with the styling of your choosing.

$3Dmol.download("pdb:1MO8",viewer,{multimodel:true, frames:true},function(){
    viewer.setStyle({}, {cartoon:{color:"spectrum"}});
    viewer.render();
});

Surfaces

We also support the use of surfaces that are asynchronously loaded and support different color schemes

Alt Text

viewer.addSurface($3Dmol.SurfaceType.VDW, {
    opacity:0.85,
    voldata: new $3Dmol.VolumeData(volumedata, "cube"),
    volscheme: new $3Dmol.Gradient.ROYGB(range[1],range[0])
},{});

Shapes

The use of different shapes and styles is supported.

Alt Text

viewer.addCylinder({start:{x:0.0,y:2.0,z:0.0},
    end:{x:0.0,y:10.0,z:0.0},
    radius:0.5,
    fromCap:false,
    toCap:true,
    color:'teal'});
viewer.addCylinder({start:{x:15.0,y:0.0,z:0.0},
    end:{x:20.0,y:0.0,z:0.0},
    radius:1.0,
    color:'black',
    fromCap:false,
    toCap:false});

Documentation

Please check out our documentation at 3dmol.js. We have tutorials, as well as the stable release of the platform.

Contact

Please address any questions or concerns to dkoes@pitt.edu. You may also submit an issue on github.

Citing

If you use 3Dmol.js, please cite our Bioinformatics paper.

Funding

3DMol.js is funded through R01GM108340 from the National Institute of General Medical Sciences. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institute of General Medical Sciences or the National Institutes of Health.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文