Skip to content

viewer.color_by is slow for large molecules #39

@avirshup

Description

@avirshup

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

To reproduce:
In a notebook, execute this cell:

mol = mdt.from_pdb('3aid')
drug = mol.chains['A'].get_ligand()
viewer = mol.draw(display=True)
viewer.stick()

Then this one:

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

In 0.7.3, the color comes in all-at-once after thinking for a second or two:
color_by_fast

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions