ccpem/mrcfile

mx,my and mz potentially being set wrong

Ryan-Pye opened this issue · 1 comments

For entries with non x,y,z axis ordering e.g. z,y,x running update_header_from_data sets mx equal to nx, my equal to ny etc.

However mx is declared as sampling along X axis of unit cell not in terms of columns like nx.
My interpretation of the spec is that this should set nx == mz when z is the col axis.
Am I misinterpreting the mrc specification or is this an issue with not taking axis ordering into account in mrcfile?

Example entry EMD-30289's primary map.

Regards
Ryan

Thanks for raising this. I think your interpretation of the MRC specification is probably correct. There's actually a wider issue here, that mrcfile currently does nothing with the column order. It just assumes the axis order is x,y,z and it's up to developers to check the mapc, mapr and maps records in the header if they like. For most cryo-EM work this is fine because (almost?) all cryo-EM software does use x,y,z order (unlike MicroED as in the EMD-30289 case, which uses crystallography software and does much more exciting things with the map format!)

I would like to fix this at some point, but it would risk being quite a big change of behaviour and might break existing usage so it'd probably require a major version update. In the meantime, you could check the map header yourself and apply the correct axis order if you need to. Alternatively, for working with MicroED maps you could consider using an alternative library that's more crystallographically-aware, such as Gemmi.