pragmatic-streamlit / streamlit-molstar

42 stars 5 forks source link

Viewer issues. #16

Closed ShaheerSyed closed 9 months ago

ShaheerSyed commented 9 months ago

Hello,

I have written the code below:

# Function to visualize the trajectory using Mol* viewer
def visualize_trajectory(your_protein):

    # Load the trajectory
    traj_file_path = f'{your_protein}_traj.dcd'

    # Load the PDB file
    pdb_file_path = f'{your_protein}.pdb'

    # Display Visual using Mol* component
    st_molstar_remote(pdb_file_path, traj_file_path, height=600)
  1. The viewer seems to be displaying on my streamlit app correctly, however, I do not see the protein visual....meaning the viewer is empty. I have to manually drag and drop the files onto the viewer to see the visualization of the protein.

  2. Furthermore, as you can see, I also have a trajectory file. I want to be able to see the trajectory of the protein. But, I am not sure how to do this, or, if it is available to do so using python.

I instead have to click Toggle Controls Panel -> Home -> Load Trajectory -> Then upload the PBD file as Model and trajectory file as coordinates and click apply.

Then I have to click the Select Animation button, change Mode to Once, and click start.

Only then can I see the animation.

Is there a way to do this using code ?

ShaheerSyed commented 9 months ago

image

mapix commented 9 months ago

@ShaheerSyed

Could you provide a set of your files that are suitable for public disclosure, so that I can investigate further? Additionally, the 'auto' function may support a wider range of formats than the default, which doesn't support many.

ShaheerSyed commented 9 months ago

Yes of course. Thank You!

I have sent the files to your email - [mapix.me@gmail.com]

Please let me know if you have trouble opening the attached file. @mapix

mapix commented 9 months ago

@ShaheerSyed fixed version 0.4.7

st_molstar("../pchem/polyALA.pdb", "../pchem//polyALA_traj.dcd", key="10")
st_molstar_remote("http://localhost:8000/polyALA.pdb", "http://localhost:8000/polyALA_traj.dcd")

image