coot
coot copied to clipboard
Orthorhombic P1 maps are parsed as EM maps with no way to change
In my work, various tasks end up being easiest to compute by first artificially expanding a crystallographic electron density map to P1. However, as I learned here https://github.com/project-gemmi/gemmi/issues/243#issuecomment-1332524437, Coot assumes that any map in P1 with alpha=beta=gamma=90 is an EM map, and does not render periodic boundary conditions.
This behavior is a sensible default, but it would be strongly desirable to be able to override this behavior. I could imagine this being a checkbox in the "open map" dialog, analogous to the "is difference map" check box. My C++ is probably not strong enough to fork and make this change myself (though I will poke around) but hopefully this is fairly easy to implement! Thanks!
There is a way. Add a title to the map that begins "PANDDA::"
That's great to know, thank you!
Can you give some more detail about how to do that? Is this something I do inside of coot, or something I do in python/gemmi?
I'm just following up on this! I believe I've located the relevant code, linked below, and I can't find where the map title is parsed. I searched for "PANDDA" in this repo, and the only hit is the changelog linked below. If I'm missing something, please let me know! I would love to have this functionality.
Here's the changelog: https://github.com/pemsley/coot/blob/96ec883a7902bccab713ef111b9b127b0378b7c3/blog/_posts/2021-07-06-release-0.9.6.md
Here's (I think) the relevant code that parses the alpha/beta/gamma angles of a map: https://github.com/pemsley/coot/blob/0a391eb6c559aec48f17cd77cedc8d916acff9d5/src/molecule-class-info-maps.cc#L1766
I also tried the following in gemmi's python API:
m = gemmi.read_ccp4_map(my_map_file)
m.set_header_str(57, 'PANDDA::blah')
and I can't get this to work.
As a workaround, I've found that changing an angle to 90.006 degrees does render periodicity.
possibly, in addition to the label you need to change the number of labels in the map header
m.set_header_i32(56, 1)
m.set_header_str(57, 'PANDDA:: compatible')
Coot tests all of the labels and checks the first 8 characters. This only works for X,Y,Z-ordered maps.
On reflection, I will add a function that allows the user to override Coot's attempt to determine the EM-state of the map.