gautomatch.convert module

class gautomatch.convert.CoordStarWriter(filename)[source]

Bases: object

Helper class to write a star file containing coordinates.

HEADER = '\ndata_\n\nloop_\n_rlnCoordinateX #1\n_rlnCoordinateY #2\n_rlnAnglePsi #3\n_rlnClassNumber #4\n_rlnAutopickFigureOfMerit #5\n    '
writeRow(x, y, psi=0, classNumber=0, autopickFom=0)[source]
gautomatch.convert.openMd(fn, state='Manual')[source]
gautomatch.convert.readCoordinates(mic, fileName, coordsSet)[source]
gautomatch.convert.readSetOfCoordinates(workDir, micSet, coordSet, suffix=None)[source]

Read from coordinates from Gautomatch .star files. For a micrograph: mic1.mrc, the expected coordinate file is: Params:

workDir: where the Gautomatch output files are located. micSet: the SetOfMicrographs. coordSet: the SetOfCoordinates that will be populated. suffix: input coord file suffix


Create a Coordinate from a row of a meta

gautomatch.convert.rowToObject(row, obj, attrDict, extraLabels=[])[source]

This function will convert from a XmippMdRow to an EMObject. Params:

row: the XmippMdRow instance (input) obj: the EMObject instance (output) attrDict: dictionary with the map between obj attributes(keys) and

row MDLabels in Xmipp (values).

extraLabels: a list with extra labels that could be included

as properties with the label name such as: _rlnSomeThing

gautomatch.convert.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

gautomatch.convert.writeDefectsFile(coordSet, outputFn)[source]

Write all coordinates in coordSet as the file as expected by Gautomatch.

gautomatch.convert.writeMicCoords(mic, coordSet, outputFn)[source]

Write all the coordinates in coordSet as star file for micrograph mic.

gautomatch.convert.writeSetOfCoordinates(workDir, coordSet, isGlobal=False)[source]

Write set of coordinates from md to star file. Used only for exclusive picking. Creates .star files with bad coordinates (for each mic) and/or a single .star file with global detector defects.

gautomatch.convert.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.

gautomatch.convert.writeSetOfMicrographs(micSet, filename)[source]

Simplified function borrowed from xmipp.