a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
1.01k stars 126 forks source link

visualize protein 3d structure in python scripts #256

Closed pengzhangzhi closed 1 year ago

pengzhangzhi commented 1 year ago

Hi. I found this tool can beautifully visualize the protein structure in jupyter notebook. I wonder if this can be implemented in python scripts.

a-r-j commented 1 year ago

Hi @pengzhangzhi, would you be able to share a bit more context about what you're trying to achieve?

For instance, the following script works:

# example_plot.py

import graphein.protein as gp

if __name__ == "__main__":
    g = gp.construct_graph(pdb_code="3eiy")
    fig = gp.plotly_protein_structure_graph(g)
    fig.show()
pengzhangzhi commented 1 year ago

Hi @a-r-j ,thank you for the information. can the code save the figure? I want to visualize a whole bunch of pdbs and save them as images and then maybe convert them to videos. Since this tool can visualize beautiful protein structures, I want to implement this idea using your tool.

a-r-j commented 1 year ago

Yep!

You can save them as HTML (maintains interactivity) and in static format.

pengzhangzhi commented 1 year ago

Thank you for your helpful feedback! You are very nice!

a-r-j commented 1 year ago

Happy to help! :hugs: