cryocat.core.cryomotl.relion2emmotl#

cryocat.core.cryomotl.relion2emmotl(input_motl, relion_version, load_kwargs=None, output_motl_path=None, pixel_size=None, binning=None, update_coordinates=False, flip_handedness=False, tomo_dim=None)#

Converts a RelionMotl to EmMotl format and optionally writes it to a file.

Parameters:
input_motlstr or pandas.DataFrame or RelionMotl

Path to the input Relion MOTL file (e.g., a .star file) or an already loaded RelionMotl object.

relion_versionfloat

The version of the Relion file format.

load_kwargsdict, optional

Dictionary of keyword arguments passed to the RelionMotl or RelionMotlv5 constructor. See RelionMotl.__init__ or RelionMotlv5.__init__ for full list of accepted keys.

output_motl_pathstr, optional

If provided, the converted motl will be written to this path.

pixel_sizefloat, optional

The pixel size of the data. Required if input_motl is a file path and a pixel size is not specified in the file’s optics group.

binningint, optional

The binning factor of the data, used for certain Relion file formats (e.g., v4.0).

update_coordinatesbool, default=False

If True, updates the coordinates in the DataFrame.

flip_handednessbool, default=False

If True, flips the handedness of the coordinates.

tomo_dimtuple of int, optional

Dimensions of the tomogram (required if flip_handedness=True).

Returns:
em_motlEmMotl

The converted EmMotl object.