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

Designing a GUI using Gradio #221

Open
vandrw opened this issue Sep 6, 2024 · 12 comments
Open

Designing a GUI using Gradio #221

vandrw opened this issue Sep 6, 2024 · 12 comments

Comments

@vandrw
Copy link
Contributor

vandrw commented Sep 6, 2024

I have briefly used Gradio before and could have an attempt at designing a frontend for the project. However, before starting, I wanted to discuss how much feature parity we could achieve with DeepMind's AlphaFold server.

Currently, their implementation supports taking as input sequences/fastas of proteins, DNA, RNA, ligands and ions. Should I keep anything in mind while trying to replicate the following in Gradio? I will definitely be coming back with more questions regarding the output of the model, but for now I will try to implement the basic elements.

landing
protein visualization
info

@amorehead
Copy link
Contributor

amorehead commented Sep 6, 2024

I love the initiative here! Thanks for kicking this off. I think Phil will have more thoughts on the web UI

@Poko18
Copy link

Poko18 commented Sep 6, 2024

If it helps, here is already a similar implementation in gradio for RFAA.

@lucidrains
Copy link
Owner

lucidrains commented Sep 7, 2024

@vandrw hey Andrei! i think we should just try to use gradio as much as possible

i'm sure there are limitations however, and we can always go for a more complete UI sans gradio at a later date, and only if we figure out some missing UI component has a big enough value add (i was a fullstack developer prior to the AI thing, so doing this is pretty trivial but time consuming)

for starters, i think just having a multi-input form for the various bio sequences + rendering the pdb and associated confidence heatmaps is good enough?

@vandrw
Copy link
Contributor Author

vandrw commented Sep 7, 2024

@lucidrains Hi! Thanks for looking into this! I'm not worried about the graphical elements, but I was merely wondering if there are certain things we don't plan to support. I am still quite inexperienced with the AlphaFold model input and output that you have coded, and when I wrote this issue, I didn't look too closely at the Alphafold3Input class. However, after having a closer look, it seems I answered my own question 😄

I will start working on this once I manage to debug the template unit vector code!

@lucidrains
Copy link
Owner

lucidrains commented Sep 7, 2024

@vandrw yup exactly! Alphafold3Input should be intuitive enough, if i designed it well

we will also need a few tests to ensure that the same PDBInput and Alphafold3Input converges to the same AtomInput representation. Alex and I kind of just worked off different input pipelines to parallelize work

re: plan to support - i haven't actually played around with their UI yet, so you'll have to let me know which things you are referring to

@lucidrains
Copy link
Owner

lucidrains commented Sep 7, 2024

@vandrw would say, if you haven't developed an app before, just focus on single string input protein sequence -> 3d atomic positions -> pdb -> rendering with 3dmol + gradio or whatever lib is popular these days. then we can slowly work our way up to a more complex form for multichain + nucleic acids + ions

@vandrw
Copy link
Contributor Author

vandrw commented Sep 7, 2024

re: plan to support - i haven't actually played around with their UI yet, so you'll have to let me know which things you are referring to

@lucidrains I was jumping the gun a bit here, but for example, the AlphaFold Server supports glycosylated proteins. According to their FAQ:

The Server supports the following glycan residues to be attached to a protein residue

  • N (Asparagine): BGC, BMA, GLC, MAN, NAG
  • T (Threonine): BGC, BMA, FUC, GLC, MAN, NAG
  • S (Serine): BGC, BMA, FUC, GLC, MAN, NAG

The Server assumes that glycosidic bonds are formed between atoms at positions that have the highest frequency of occurrence in similar bonds from the PDB - this might lead to different bond positions in the modeled structure than expected. Specifying exact atoms for the glycosidic bond is not currently supported.

I was wondering if we need to perform any additional checks for such inputs. However, as I mentioned, I'm probably a bit ahead of myself here. This can be addressed once we have an initial version :)

Regarding my experience with app development, I've done some work in this area before. I can definitely use custom JS if the basic gradio capabilities are lacking. I will see how far I go with this! Thank you very much for your suggestions 😄

@lucidrains
Copy link
Owner

lucidrains commented Sep 7, 2024

@vandrw let's definitely save modified biomolecules for last, as there is a lot of complexity there (which is mainly reflective of molecular biology in general)

i also don't have an interface for modified biomolecules in Alphafold3Input just yet, but will get that done by month's end

@lucidrains
Copy link
Owner

@vandrw put down some basic scaffold here

eventually end researcher will just do alphafold3_pytorch_app --checkpoint ./path/to/alphafold3.pt

vandrw pushed a commit to vandrw/alphafold3-pytorch that referenced this issue Sep 11, 2024
…o AF3 input

App contains some bugs. After clicking the predict button, everything else is no longer responsive.
lucidrains pushed a commit that referenced this issue Sep 11, 2024
#247)

App contains some bugs. After clicking the predict button, everything else is no longer responsive.
@Hanziwww
Copy link

Hanziwww commented Nov 19, 2024

Hi, I developved an Alphafold3 GUI. Project url: https://github.com/Hanziwww/AlphaFold3-GUI.
Demo site (generate input JSON files ONLY)
image

@lucidrains
Copy link
Owner

@Hanziwww very cool! keep up the great work!

@Hanziwww
Copy link

@lucidrains Thanks. Now I released a new version with visualization.

1. Visualization Module

image

2. Visualization GUI Interface

image

3. Online Usability

  • To make this even more accessible, I have deployed an online app where users can upload their AlphaFold3 result files and visualize them in real time.
  • This app is fully functional and available at the following link: Usable visualization site (fully usable)

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

5 participants