Hi Steven,

  To fit atomic models into maps automatically is in general very hard -- for instance you spend a lifetime developing algorithms trying to reliably dock one protein in a 10 protein complex reliably.  But maybe you have easy cases, or maybe you don't care if the result is very wrong 20% of the time -- then maybe you can write a script to do it.  The only thing ChimeraX does to find a global fit is randomly place and orient a molecule in your map and then do local optimization, as many placements as you want, then cluster ones that have very similar final position and orientation.  The problem is there are often wrong fits with very high scores, and it is time consuming to sample enough positions.  If you thought that approach might work I would first suggest trying it on several cases you are interested interactively using the fitmap command with the search option

fit #1 in #2 search 100

https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/fitmap.html#global

Currently ChimeraX does not have the user interface that lists all the fits, but you could try it in Chimera which does list them and uses the same algorithm.  In a Python script you could get the different fits in ChimeraX.

Tom


On Feb 19, 2021, at 1:12 PM, Steven Truong <sdt45@cam.ac.uk> wrote:

Hi Tom and Elaine,

Thank you for your help!  These are all very helpful suggestions, and I appreciate you getting back to me so quickly.

Regarding fitting atomic models to maps, what would you suggest as a starting point to globally fit?  Is this something you'd suggest be done outside of ChimeraX?  Is there perhaps a way to semi-automate the process where you can interactively start from rough inspection — and then loop from there?  Our group is hoping to do this for a few hundred models/maps, so manually doing this would be a bit time-consuming.  However, we have fitted one model to a map, and it does seem to work very well when done interactively.

Many thanks,
Steven 

On Feb 19, 2021, at 3:00 PM, Tom Goddard <goddard@sonic.net> wrote:

Hi Steven,

Elaine pointed to the right place for the fitmap Python documentation.  I've also added it under the Python Modules page under Volume data to make it easier to find.  The open_pdb() and save_pdb() functions are here and have strangely not been documented.


We will try to get those documented in the Programmer's manual.

ChimeraX fitting of atomic models in maps is intended for interactive fitting.  Keep that in mind if you are going to try to script it in Python.  It doesn't have good capabilities for doing global searches and is really intended to locally optimize a fit once you have atomic models close to their correct positions.

Tom

On Feb 19, 2021, at 10:29 AM, Elaine Meng <meng@cgl.ucsf.edu> wrotey:

Hi Steven,
Maybe this page in the programmer documentation (and links therein) would help... it includes "fitmap," at least:

<https://www.cgl.ucsf.edu/chimerax/docs/devel/core/commands/user_commands.html>

I don't create the programmer documentation, but since the page says version 1.2 I'm hoping it's reasonably up-to-date.

The "save" link doesn't say much, however, so somebody else will have to give more information on writing files.
Best,
Elaine
-----
Elaine C. Meng, Ph.D.                       
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

On Feb 19, 2021, at 10:05 AM, Steven Truong <sdt45@cam.ac.uk> wrote:

To whom it may concern,
Hello!  I was hoping to ask for some help in Python Scripting in ChimeraX.  Specifically, I am trying to fit structure files (.PDB) to electron density maps (.MAP).  Is there a way to do this in .PY scripts in ChimeraX?  I can’t seem to find such a command like “fitmap” in the documentation here (https://www.cgl.ucsf.edu/chimerax/docs/devel/modules.html).  Additionally, it seems like the “Read and Write PDB Files” page (https://www.cgl.ucsf.edu/chimerax/docs/devel/bundles/atomic/src/pdbio.html) of the documentation page hasn’t been updated.  Is there another place that outlines how to save structures?


_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users



_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users