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

Need help - set_coordinates does not seem to work for components. #940

Closed
vaddanki69 opened this issue Jan 4, 2021 · 2 comments
Closed

Comments

@vaddanki69
Copy link

nglview.version=2.7.7
ipywidgets.version=7.6.2

I was able to successfully add and display 2 proteins as 2 components in a single view. However, they are overlapping each other and set_coordinates does not seem to work. Please help.

------- code start --------
from nglview import NGLWidget

viewWidget = nglview.NGLWidget()

c1 = viewWidget.add_pdbid("7d4f")
c1.set_coordinates(np.array([0, 0, 0]))
c1.add_representation('surface', color='chainindex')

#viewWidget.add_representation('surface', color='chainindex')

c2 = viewWidget.add_pdbid("6yyt")
c2.set_coordinates(np.array([80, 80, 80]))
c2.add_representation('surface', color='chainindex')

#c3 = viewWidget.add_pdbid("6xez")
#c3.set_position([80, 80, 80])

viewWidget

------- code end --------

python -c 'import nglview; print(nglview.__version__)'
python -c 'import ipywidgets; print(ipywidgets.__version__)'
@hainm
Copy link
Collaborator

hainm commented Jan 6, 2021

hi @vaddanki69, use set_position instead.

c1.set_position([0, 0, 0])
c2.set_position([80, 80, 80])

set_coordinates is used for setting 3D coordinates of the system for corresponding frame (mainly for trajectory).

@hainm
Copy link
Collaborator

hainm commented Jan 19, 2021

Close this case since I don't hear the feedback. Feel free to reopen if you still have any Q. Cheers.

@hainm hainm closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants