coot icon indicating copy to clipboard operation
coot copied to clipboard

Orthorhombic P1 maps are parsed as EM maps with no way to change

Open dennisbrookner opened this issue 2 years ago • 6 comments
trafficstars

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!

dennisbrookner avatar Nov 30 '22 19:11 dennisbrookner

There is a way. Add a title to the map that begins "PANDDA::"

pemsley avatar Dec 04 '22 18:12 pemsley

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?

dennisbrookner avatar Dec 04 '22 18:12 dennisbrookner

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.

dennisbrookner avatar Dec 13 '22 22:12 dennisbrookner

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')

wojdyr avatar Dec 21 '22 14:12 wojdyr

Coot tests all of the labels and checks the first 8 characters. This only works for X,Y,Z-ordered maps.

pemsley avatar Dec 21 '22 20:12 pemsley

On reflection, I will add a function that allows the user to override Coot's attempt to determine the EM-state of the map.

pemsley avatar Dec 21 '22 21:12 pemsley