cistem.convert.convert module

class cistem.convert.convert.FrealignParFile(filename, mode='r')[source]

Bases: object

Handler class to read/write Frealign par file.


Convert the transformation matrix to shifts and angles. :param matrix: input matrix :return: two lists, shifts and angles

cistem.convert.convert.matrixFromGeometry(shifts, angles)[source]

Create the transformation matrix from given 2D shifts in X and Y and the 3 euler angles. :param shifts: input list of shifts :param angles: input list of angles :return matrix


Retrieve defocus U, V and angle from the output file of the ctffind4 execution. :param filename: input file to parse :return: a tuple of CTF values

cistem.convert.convert.readCoordinates(mic, fn, coordsSet)[source]

Parse coords file and populate coordsSet. :param mic: input micrograph object :param fn: input file to parse :param coordsSet: output set of coords

cistem.convert.convert.readCtfModel(ctfModel, filename)[source]

Set values for the ctfModel. :param ctfModel: output CTF model :param filename: input file to parse

cistem.convert.convert.readSetOfCoordinates(workDir, micSet, coordSet)[source]

Read coordinates from cisTEM .plt files. :param workDir: input folder with coord files :param micSet: input set of mics :param coordSet: output set of coords

cistem.convert.convert.readSetOfParticles(inputSet, outputSet, parFileName)[source]

Iterate through the inputSet and the parFile lines and populate the outputSet with the same particles of inputSet, but with the angles and shift (3d alignment) updated from the parFile info. It is assumed that the order of iteration of the particles and the lines match and have the same number. :param inputSet: input set of particles :param outputSet: output set of particles to be populated :param parFileName: Frealign par file to read alignments


Parse movie alignment shifts. :param shiftFn: input file to parse :return: two lists with shift values

cistem.convert.convert.rowToAlignment(alignmentRow, samplingRate)[source]

Return an Transform object representing the Alignment from a given parFile row. :param alignmentRow: input row object :param samplingRate: input pixel size :return Transform object

cistem.convert.convert.rowToCtfModel(ctfRow, ctfModel)[source]

Convert a row to Scipion CTF model. :param ctfRow: input row :param ctfModel: output model


Set parameters if results parsing has failed. :param ctfModel: the model to be updated

cistem.convert.convert.writeReferences(inputSet, outputFn)[source]

Write 2D references stack file from SetOfAverages or SetOfClasses2D. :param inputSet: the input SetOfParticles to be converted :param outputFn: where to write the output files.