relion.convert.convert_coordinates module

Utility functions for conversions that will be used from both newer Relion3.1 routines and old ones.

relion.convert.convert_coordinates.openMd(fn, state='Manual')[source]
relion.convert.convert_coordinates.openStar(fn, extraLabels=False)[source]
relion.convert.convert_coordinates.writeCoordsConfig(configFn, boxSize, state)[source]

Write the config.xmd file needed for Xmipp picker. Params:

configFn: The filename were to store the configuration. boxSize: the box size in pixels for extraction. state: picker state
relion.convert.convert_coordinates.writeMicCoordinates(mic, coordList, outputFn, getPosFunc=None)[source]

Write the pos file as expected by Xmipp with the coordinates of a given micrograph. Params:

mic: input micrograph. coordList: list of (x, y) pairs of the mic coordinates. outputFn: output filename for the pos file . isManual: if the coordinates are ‘Manual’ or ‘Supervised’ getPosFunc: a function to get the positions from the coordinate,

it can be useful for scaling the coordinates if needed.
relion.convert.convert_coordinates.writeSetOfCoordinates(posDir, coordSet, getStarFileFunc, scale=1)[source]

Convert a SetOfCoordinates to Relion star files. Params:

posDir: the output directory where to generate the files. coordSet: the input SetOfCoordinates that will be converted.

getStarFileFunc: function object that receives the micrograph name
and return the coordinates star file (only the base filename).
scale: pass a value if the coordinates have a different scale.
(for example when extracting from micrographs with a different pixel size than during picking)
relion.convert.convert_coordinates.writeSetOfCoordinatesXmipp(posDir, coordSet, ismanual=True, scale=1)[source]

Write a pos file on metadata format for each micrograph on the coordSet. Params:

posDir: the directory where the .pos files will be written. coordSet: the SetOfCoordinates that will be read.