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

viewer.color_by is slow for large molecules #39

Open
avirshup opened this issue Nov 2, 2016 · 3 comments
Open

viewer.color_by is slow for large molecules #39

avirshup opened this issue Nov 2, 2016 · 3 comments
Assignees
Labels

Comments

@avirshup
Copy link
Contributor

avirshup commented Nov 2, 2016

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

@avirshup avirshup added the bug label Nov 2, 2016
@justinmc justinmc self-assigned this Nov 3, 2016
@justinmc
Copy link
Contributor

justinmc commented Nov 3, 2016

Were you running the latest code that includes my performance PR #27 when you saw this? Just making sure.

@avirshup
Copy link
Contributor Author

avirshup commented Nov 3, 2016

Yeah - it's all from the latest master (fb2eee0)

On Nov 2, 2016, at 5:16 PM, Justin McCandless [email protected] wrote:

Were you running the latest code that includes my performance PR #27 #27 when you saw this? Just making sure.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #39 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AI8_5-8qjuV-eBlDKc9mMPIgiaQU2FyYks5q6SfPgaJpZM4Kn3Kx.

@justinmc
Copy link
Contributor

justinmc commented Nov 3, 2016

Solution here: #42

It was syncing the data over the network 1 color at a time, which was very slow AND caused a rerender for reach color. Now we do it all at once. The frontend still has to call 3dmol's setStyle for each color, which is a lot, but it happens fast enough and with no pop-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants