Hi Enrico,Our servers have been down this week, so this is my first opportunity to respond. So one possible approach is to change the "window = 10" line to:window_by_id = { (1,): 5, (2,): 10 }and change the 'if/continue' statement just inside the loop to:try:window = window_by_id[s.id]except KeyError:continueThe 'id' attribute of a model is a tuple of the model ID numbers, so for model #1 it would be (1,), for model #2.2.1 it would be (2,2,1), etc.So the try/except clause skips all models other than the ones you explicitly put in the window_by_id dictionary.--EricOn Oct 11, 2024, at 1:32 PM, Enrico Martinez <jmsstarlight@gmail.com> wrote:Hello Eric,I have an extra question about the Smooth MD script: I modified it abit to apply the smoth effect only on a model with the name "ottimo.pdb" so that it will affect only one selected model ( in the case when there are several models in the same session ..) Here is this version enclosed.Could you suggest how it could be further modified to affect e.g. 2 models via 2 different smooth windows e.g. smooth the model with the id 1 window=5 and smooth the model with the id 2 with window2=10 ?Many thanks for help!EnricoIl giorno ven 8 dic 2023 alle ore 16:10 Enrico Martinez <jmsstarlight@gmail.com> ha scritto:Thank you very much Eric !CheersEnricoLe mer. 6 déc. 2023 à 19:02, Eric Pettersen <pett@cgl.ucsf.edu> a écrit :Hi Enrico,I have updated the smoothing script on the Scripts page. If you get a new version, there is a line near the top ("stride = 1") that you can edit to make it use, say, every 5th frame ("stride = 5"). One issue is that the coordinate set slider doesn't properly react to the change in the number of frames. You have to close the slider and open a new one ("coordset slider #1"). I will look into fixing that.--EricOn Dec 6, 2023, at 1:34 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:and generally it would be visually fine with averaging of every N frame ?
well it would be interesting to test anyway :-)
Cheers
Enrico
Il giorno mar 5 dic 2023 alle ore 19:30 Eric Pettersen
<pett@cgl.ucsf.edu> ha scritto:
Well, the smoothing script temporarily takes about triple the memory use of the baseline trajectory, so I can imagine it crashing for a large trajectory. Do you need 1000 frames? I could change the script to use every Nth frame, which would use a lot less memory...
--Eric
Eric Pettersen
UCSF Computer Graphics LabOn Dec 5, 2023, at 7:13 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
update: I've just got a crash with md-smooth py script on chimera-x
working on a big system with > 1000 frames loaded in a single pdb
(with smaller trajectory there is no issues ..)
Enrico
Il giorno mer 15 nov 2023 alle ore 18:53 Eric Pettersen
<pett@cgl.ucsf.edu> ha scritto:
You are welcome.
I don't think there is a "right" value for the window. A larger value will provide more smoothing, while also creating more non-physical geometries for highly mobile parts of the structure. A judgement call really.
--EricOn Nov 15, 2023, at 3:33 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Gotcha, thank you very much Eric !
BTW what is the value for the window that should be used ? Does it
mean that the higher value would result in smoother dynamics ?
Enrico
Il giorno mar 14 nov 2023 alle ore 19:47 Eric Pettersen
<pett@cgl.ucsf.edu> ha scritto:
Hi Enrico,
I don't see how you could get that error. I couldn't reproduce it myself. I would need some kind of recipe for how you get it to occur. A separate problem is that the averaging in the script isn't really right. Line 21 of the script should be changed from:
weight = window + 1 + abs(i-j)
to:
weight = window + 1 - abs(i-j)
i.e. change the "+ abs(...)" to "- abs(...)". I have corrected the script on the Scripts page.
--Eric
Eric Pettersen
UCSF Computer Graphics Lab
On Nov 14, 2023, at 6:31 AM, Enrico Martinez via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
update: i've just opened closed chimera-x and reloaded my pdb and
everything works as expected. probably there is a bug somewhere ..
Il giorno mar 14 nov 2023 alle ore 14:56 Enrico Martinez
<jmsstarlight@gmail.com> ha scritto:
Dear Chimera-X users.
I am trying to record a md trajectory loaded as multi-pdb file:
open ./stripped_traj2.pdb coordsets true
I have the issue with smooth-md script (enclosed), which produces the
following error:
open smooth_md_chX.py
open /home/test/Bureau/MOVIE_CHIMERAX\/smooth_md_chX.pyTraceback (most
recent call last):
File "/home/test/Bureau/MOVIE_CHIMERAX\/smooth_md_chX.py", line 23, in <module>
avg += weight * coord_sets[j]
ValueError: operands could not be broadcast together with shapes
(6120,3) (6112,3) (6120,3)
Should something be fixed in the script in order that I could observe
the MD movie with smooth details ?
Thank you in advance
Enrico
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/