relion.convert.convert_base module

New conversion functions dealing with Relion3.1 new star files format.

class relion.convert.convert_base.ReaderBase(**kwargs)[source]

Bases: object

Helper class to grab information from star file rows and fill the required values in Scipion objects (e.g particles, micrographs, etc)

createExtraLabels(item, row, extraLabels)[source]

Create new Objects for each extra label if contained in the columnObj. It will set the self._extraLabels property. Args:

item: Object item that will have new extra labels objects row: column object that should have a method hasColumn extraLabels: list of label names that will be set if present

in columnObj
readSetOfParticles(starFile, partsSet, **kwargs)[source]

Convert a star file into a set of particles.

starFile: the filename of the star file partsSet: output particles set
Keyword Arguments:
blockName: The name of the data block (default particles) alignType: removeDisabled:
setExtraLabels(item, row)[source]

Set values for already computed extraLabels with self.createExtraLabels.

setParticleTransform(particle, row)[source]

Set the transform values from the row.

class relion.convert.convert_base.WriterBase(**kwargs)[source]

Bases: object

Helper class to convert from Scipion SetOfImages subclasses into Relion>3.1 star files (and binaries if conversion needed).

update(attrsList, **kwargs)[source]

Update the some attributes with values from kwargs.

writeSetOfMicrographs(micsIterable, starFile, **kwargs)[source]
writeSetOfMovies(moviesIterable, starFile, **kwargs)[source]
writeSetOfParticles(partsSet, starFile, **kwargs)[source]

Convert a set of particles into a star file and maybe binary files.

partsSet: input particles set starFile: the filename of the star file that will be written.
Keyword Arguments:

blockName: The name of the data block (default particles) fillMagnification: If True set magnification values (default False)

outputStack: A file name to write all particles. If this option is
passed, then the outputDir will be ignored.