pwem.protocols.protocol_sets module

This module contains protocols related to Set operations such us: - subsets - unions - split … etc

class pwem.protocols.protocol_sets.ProtSets(**kwargs)[source]

Bases: pwem.protocols.protocol.EMProtocol

Base class for all protocols related to subsets.

class pwem.protocols.protocol_sets.ProtSplitSet(**kwargs)[source]

Bases: pwem.protocols.protocol_sets.ProtSets

Protocol to split a set in two or more subsets.

createOutputStep()[source]
class pwem.protocols.protocol_sets.ProtSubSet(**kwargs)[source]

Bases: pwem.protocols.protocol_sets.ProtSets

Create a set with the elements of an original set that are also referenced in another set.

Usually there is a bigger set with all the elements, and a smaller one obtained from classification, cleaning, etc. The desired result is a set with the elements from the original set that are also present somehow in the smaller set (in the smaller set they may be downsampled or processed in some other way).

Both sets should be of the same kind (micrographs, particles, volumes) or related (micrographs and CTFs for example).

SET_DIFFERENCE = 1
SET_INTERSECTION = 0
createOutputStep()[source]
class pwem.protocols.protocol_sets.ProtSubSetByCoord(**kwargs)[source]

Bases: pwem.protocols.protocol_sets.ProtSets

Create a subset of those particles that have a particular set of coordinates

createOutputStep(partsId, micsId, tolerance)[source]
class pwem.protocols.protocol_sets.ProtSubSetByMic(**kwargs)[source]

Bases: pwem.protocols.protocol_sets.ProtSets

Create a subset of those particles that come from a particular set of micrographs

createOutputStep(partsId, micsId)[source]
class pwem.protocols.protocol_sets.ProtUnionSet(**kwargs)[source]

Bases: pwem.protocols.protocol_sets.ProtSets

Protocol to join two or more sets of images. This protocol allows to select two or more set of images and will produce another set joining all elements of the selected sets. It will validate that all sets are of the same type of elements (Micrographs, Particles or Volumes)

cleanExtraAttributes(obj, verifyAttrs, prefix='')[source]
commonAttributes()[source]

Compute the set of common attributes to all items within each input set.

createOutputStep()[source]
duplicatedIds()[source]

Check if there are duplicated ids to renumber from the beginning.

getAllSetsAttributes()[source]
getObjDict(includeClass=False)[source]

Return all attributes and values in a dictionary. Nested attributes will be separated with a dot in the dict key. Params:

includeClass: if True, the values will be a tuple (ClassName, value)
otherwise only the values of the attributes
includeBasic: if True include the id, label and comment.
object.id: objId object.label: objLabel object.comment: objComment