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

Redraw Style per Frame #705

Open
duerrsimon opened this issue Jul 18, 2023 · 3 comments
Open

Redraw Style per Frame #705

duerrsimon opened this issue Jul 18, 2023 · 3 comments

Comments

@duerrsimon
Copy link

Is your feature request related to a problem? Please describe.
I have a PDB file that contains a trajectory of steps of optimization of a structure where amino acid identities change per frame. It looks like sphaggetti. presumeably because only the last frame is used to determine connectivity.

Describe the solution you'd like
I'd like to determine connectivity per frame

Describe alternatives you've considered(Optional)
Probably could load the files individually and then show/hide them but then I can't use the internal frame mechanism.

Additional context(Optional)
last frame
image
first frame:
image

Please close your issue when you feel it has been adequately resolved

@dkoes
Copy link
Contributor

dkoes commented Jul 18, 2023

Can you provide your file and code? Frames containing different molecules are suppose to work.

@duerrsimon
Copy link
Author

duerrsimon commented Jul 18, 2023

Can't share the file unfortunately. I confirm that loading multiple different molecules within one PDB file is working, it is just that the connectivity seems to be assigned based on the last frame and not per frame (makes sense given that is more expensive). Due to this if atoms move a lot one has these extremely long bonds as shown on the second picture.

Other viewers like VMD also have this problem (circumvented by plugins such as sscache). Basically one would just need a flag to call the connectivity determination each time the frame is changed instead of just once. I can try to prepare a synthetic file in case that helps understand the problem.

@dkoes
Copy link
Contributor

dkoes commented Jul 24, 2023

I need more to go on here. I've constructed a multi-model pdb file (attached) with two very different structures and it animates just fine with this code:

    viewer.addModelsAsFrames(data,'pdb');
    viewer.setStyle({'stick':{'colorscheme':'greenCarbon'}});
    viewer.zoomTo();
    viewer.animate({'loop': "forward", reps: 1, interval: 1000, 'step': 1});
    viewer.render();

multi.pdb.gz

Can you please try to construct a reproducible test case that you can share?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants