relion.convert.convert31 module

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

class relion.convert.convert31.OpticsGroups(opticsTable)[source]

Bases: object

Store information about optics groups in an indexable way. Existing groups can be accessed by number of name.

add(newOg)[source]
addColumns(**kwargs)[source]

Add new columns with default values (type inferred from it).

static create(**kwargs)[source]
first()[source]

Return first optics group.

static fromImages(imageSet)[source]
static fromStar(starFilePath)[source]

Create an OpticsGroups from a given STAR file.

static fromString(stringValue)[source]

Create an OpticsGroups from string content (STAR format)

hasColumn(colName)[source]
toImages(imageSet)[source]

Store the optics groups information in the image acquisition.

toStar(starFile)[source]

Write current optics groups to a given file.

toString()[source]

Return a string (STAR format) with the current optics groups.

update(ogId, **kwargs)[source]
updateAll(**kwargs)[source]

Update all Optics Groups with these values.

class relion.convert.convert31.Reader(**kwargs)[source]

Bases: relion.convert.convert_base.ReaderBase

ALIGNMENT_LABELS = ['rlnOriginXAngst', 'rlnOriginYAngst', 'rlnOriginZAngst', 'rlnAngleRot', 'rlnAngleTilt', 'rlnAnglePsi']
COORD_LABELS = ['rlnCoordinateX', 'rlnCoordinateY', 'rlnMicrographName', 'rlnAutopickFigureOfMerit', 'rlnClassNumber', 'rlnAnglePsi']
CTF_LABELS = ['rlnDefocusU', 'rlnDefocusV', 'rlnDefocusAngle', 'rlnCtfAstigmatism', 'rlnCtfFigureOfMerit', 'rlnCtfMaxResolution']
readSetOfParticles(starFile, partSet, **kwargs)[source]

Convert a star file into a set of particles.

Params:

starFile: the filename of the star file partsSet: output particles set

Keyword Arguments:

blockName: The name of the data block (default particles) alignType: alignment type removeDisabled: Remove disabled items

static rowToAcquisition(optics, acq)[source]
static rowToCoord(row)[source]

Create a Coordinate from the row.

static rowToCtf(row, ctf)[source]

Create a CTFModel from the row.

setParticleTransform(particle, row)[source]

Set the transform values from the row.

class relion.convert.convert31.Writer(**kwargs)[source]

Bases: relion.convert.convert_base.WriterBase

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

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.

Params:

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.

relion.convert.convert31.getPixelSizeLabel(imageSet)[source]

Return the proper label for pixel size.