Autodesk / Autodesk/notebook-molecular-visualization

viewer.color_by is slow for large molecules

Open
#39 3 comments 0 reactions 1 assignee Claimed by @justinmc View on GitHub
bug
Dominant language
Python
Stars
88
Forks
21
PR merge metrics
No merged PRs in 30d

Description

This actually looks cool, although it's probably not what we want :)

**To reproduce:**
In a notebook, execute this cell:
```python
mol = mdt.from_pdb('3aid')
drug = mol.chains['A'].get_ligand()
viewer = mol.draw(display=True)
viewer.stick()
```

Then this one:
```python
viewer.color_by(lambda atom:atom.distance(drug))
```

In the latest version, the colors draw in 1-at-a-time, which takes a while:
![color_by_slow](https://cloud.githubusercontent.com/assets/9388007/19950966/459b8c28-a118-11e6-96ec-b6df628b3e4f.gif)

In 0.7.3, the color comes in all-at-once after thinking for a second or two:
![color_by_fast](https://cloud.githubusercontent.com/assets/9388007/19951029/ac41e684-a118-11e6-985d-ba5ceed3ca89.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.