-
Notifications
You must be signed in to change notification settings - Fork 134
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
Coloring based on confidence #1004
Comments
Hi, I have similar problems on it. I tried to applied a array with (n_frames, n_atoms) shape to reflect a "condition" per frame. |
|
@emehinovic72 Maybe try customizing the color scheme yourself? #839 |
hi @appassionate I don't clearly understand your issue, but if you want to update the color based on frame changed, you can play with this code:
|
Would you be able to provide an example(s) for color customization by bfactor? |
Thanks! But "update_cartoon" seems not work in my work.. maybe I even have not used "add_cartoon" in my viewer. n_frames = 100
atom_num = len(u.atoms)
value_array = np.random.randint(0,3,(n_frames,atom_num))
color_list = ['red', 'blue', 'yellow']
for i in range(n_frames):
viewer.view.remove_spacefill()
for j in range(atom_num):
_color = color_list[value_array[i][j]]
viewer.view.add_spacefill(selection=f'@{j}',radiusScale=2,color=f'{_color}')
sleep(1) |
hi @appassionate That's a
where does the bottleneck come from? |
I am not sure "how". But here is the JS code: https://github.com/nglviewer/ngl/blob/master/src/color/bfactor-colormaker.ts In this PR, I showed an example of how to write your own JS code to customize your color. (I admit I am more familiar with Python): #839 (See |
Many thanks for your reply.. I believe I have learned about "add_cartoon" will be a "protein representation" which is not related to my "atom representation". I believe it will be easier to set a ColorScheme to represent a kind of property such as "bfactors". However, the property value in my task is not in trajectory files but a numpy array... It seems that there is less api between JS and python.... it will be a complexed task compared with my imaged "update_spacefill" way.
Anyway, thanks for your help. :p |
Cheers. |
Is there a way to set the color scheme to reflect on PLDDT confidence for those proteins structures outputted by Alphafold?
The text was updated successfully, but these errors were encountered: