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

User-Friendly Functions #5

Closed
BradyAJohnston opened this issue Jan 25, 2021 · 2 comments · Fixed by #6
Closed

User-Friendly Functions #5

BradyAJohnston opened this issue Jan 25, 2021 · 2 comments · Fixed by #6

Comments

@BradyAJohnston
Copy link
Collaborator

Hi swsoyee!

Firstly, great package. Once I got the hang of it, I have been really enjoying being able to visualise structures and analysis that I've been doing in 3D in my rmkarkdown documents.

Secondly, I don't really know any javascript, only R, so excuse any glaring errors that might end up breaking the package.

I found myself always having to look up the specifics of the documentation when trying to select atoms or add styles.

I've written a number of functions, that simply return a list, but give options for the user so they know what they can specify without having to lookup the documentation of 3dmol.js. I also made some that allowed for importing from bio3d objects and fetching directly from the PDB using bio3d as an intermediate. I know 3dmol.js has that option when using url calls, but I couldn't see a way set up yet using r3dmol.

example as such:

r3dmol() %>% 
  m_add_model(data = m_fetch_pdb("1bna")) %>% 
  m_set_style(style = list(cartoon = m_cartoon_style(color = 'spectrum'), 
                           stick = m_stick_style(), 
                           sphere = m_sphere_style(scale = 0.3))) %>% 
  m_zoom_to()

I've detailed them in this vignette and they're all uploaded on my own fork of this repo.

What do you think about the functions, to allow ease of use? I've found them very useful in my own work since starting to make them.

Do you think something like this might be implemented into the base r3dmol?

@swsoyee
Copy link
Owner

swsoyee commented Jan 26, 2021

I'm sorry for the late reply since I'm very busy these day.
I'm very impressive by those commits which you are working in your fork!

This package is not very well designed and tested as I have no knowledge about the protein structure visualization, what package that researchers always use in their work such like bio3d.

I found myself always having to look up the specifics of the documentation when trying to select atoms or add styles.

I'm very sorry for the inconvenient user experience, since I don't have enough time to contribute to it and keep using this package. So there are still a lot of work to be completed such as add more user friendly functions to select atoms and add styles as you mention. So you are more than welcome to submit a PR directly to the r3dmol!

I know 3dmol.js has that option when using url calls, but I couldn't see a way set up yet using r3dmol.

Yes, I didn't implement such function yet (not enough time).

In addition, this project really needs background support from someone who has knowledge of and needs to visualize protein structures in their daily work for getting more feedback.

You are more than welcome to join this project, you can adjust the interface of the R part to be more user-friendly, and I can focus on interfacing with the JavaScript visualization side (some functions are not supported now so there are still many work to do).

@BradyAJohnston
Copy link
Collaborator Author

Thanks for replying, and thanks for already doing so much work with getting this package to where it is already, you've done great!

I would be very happy to contribute to the R user-facing side of the package, and will continue to do so as I come across things that might be useful while I work with it.

I'll set up a PR to merge my current functions I've written. I am new to open-source contributing, so I may not do things in exactly the right order, let me know if I'm doing something wrong!

@swsoyee swsoyee linked a pull request Feb 4, 2021 that will close this issue
@swsoyee swsoyee closed this as completed in #6 Feb 4, 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

Successfully merging a pull request may close this issue.

2 participants