adding new trajectory format
Hi,
Is there a way I can add custom, multi-frame trajectory format to ChimeraX so I can view multi frame trajectories? Is there some manual that could guide me through the process like this?: https://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html
(scroll to the bottom)
Best regards,
Radosław Giziński
Radosław,
There is a tutorial for adding a new file format using a bundle: https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/tutorial_read_format....
To add multiple coordinate sets to an atomic model, you can use the "add_coordset" or "`add_coordsets`" methods of the AtomicStructure to add the coordinates for different frames in the trajectory. There's more info on how to use these methods in their docstrings, but they basically take numpy arrays for atom coordinates in different frames of the trajectory. The add_coordset method adds one frame at a time with a N_atoms x 3 array, whereas add_coordsets can take a N_frames x N_atoms x 3 array. Once the trajectory is opened, users can run the ChimeraX command "coordset slider <model id>" to open a tool to flip through the frames.
Best,
Tony ________________________________ From: ChimeraX-users chimerax-users-bounces@cgl.ucsf.edu on behalf of Radosław Giziński via ChimeraX-users chimerax-users@cgl.ucsf.edu Sent: Thursday, September 30, 2021 8:24 AM To: chimerax-users@cgl.ucsf.edu chimerax-users@cgl.ucsf.edu Subject: [chimerax-users] adding new trajectory format
[EXTERNAL SENDER - PROCEED CAUTIOUSLY]
Hi,
Is there a way I can add custom, multi-frame trajectory format to ChimeraX so I can view multi frame trajectories? Is there some manual that could guide me through the process like this?: https://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html
(scroll to the bottom)
Best regards,
Radosław Giziński
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimerax-users
Hi Radosław, Tony's reply offers valuable specifics about adding a trajectory format. There is no step-by-step guide like the one in Chimera. Since trajectories in ChimeraX are opened via the generic 'open' command, you should familiarize yourself with how to add a new format to the open command. This involves writing a 'bundle' that is installed into ChimeraX. How to create a bundle is described extensively in the ChimeraX Developer Tutorial https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/introduction.html#seven-steps. You should read the whole thing, but the "Bundle Example: Read a New File Format" section is particularly relevant to what you want to do. To make your bundle, I would take the existing code for the md_crds bundle https://github.com/RBVI/ChimeraX/tree/develop/src/bundles/md_crds and modify it to support your format. If your format loads coordinates into an existing structure, it would use the code paths that .xtc and analogous formats use. If it creates the structure itself, it would use the paths that the .psf format uses. Feel free to ask questions if you run into problems. If this trajectory format is private, or is used only in your institution, you can just directly give your bundle's wheel to whoever needs it and they can install it into their ChimeraX with the "toolshed install" command. If its use is more widespread than that, your could submit the bundle to the ChimeraX Toolshed https://cxtoolshed.rbvi.ucsf.edu/, where any ChimeraX user can download/install it. If the format is widely used, you could submit a pull request the the ChimeraX GitHub repository to add support for the format directly to the md_crds bundle.
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Sep 30, 2021, at 5:24 AM, Radosław Giziński via ChimeraX-users chimerax-users@cgl.ucsf.edu wrote:
Hi,
Is there a way I can add custom, multi-frame trajectory format to ChimeraX so I can view multi frame trajectories? Is there some manual that could guide me through the process like this?: https://www.cgl.ucsf.edu/chimera/docs/ContributedSoftware/movie/movie.html
(scroll to the bottom)
Best regards,
Radosław Giziński
ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
Anthony James Schaefer
-
Eric Pettersen
-
Radosław Giziński