pragmatic-streamlit / streamlit-molstar

42 stars 5 forks source link

Load multi structures? #6

Closed jourmore closed 1 year ago

jourmore commented 1 year ago

This is a great plugin! Can streamlit-molstar load multi structures?

mapix commented 1 year ago

The Trajectory and Volume categories can now be freely rendered across multiple files through the new auto module (version >=0.4.2). The usage is as follows:

    import streamlit as st
    from streamlit_molstar.auto import st_molstar_auto

    import streamlit as st

    st.set_page_config(layout="wide")

    st.write("from remote url")
    files = ["https://files.rcsb.org/download/3PTB.pdb", "https://files.rcsb.org/download/1LOL.pdb"]
    st_molstar_auto(files, key="6", height="320px")

    st.write("from local file")
    files = ['examples/7bcq.pdb', "examples/7bcq.mrc"]

    st_molstar_auto(files, key="7", height="320px")
mapix commented 1 year ago

fixed some bugs in version >=0.4.6

jourmore commented 1 year ago

fixed some bugs in version >=0.4.6

Thank you very much !!!