pyworkflow.em.protocol.protocol_sets module

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

class pyworkflow.em.protocol.protocol_sets.ProtSets(**kwargs)[source]

Bases: pyworkflow.em.protocol.protocol.EMProtocol

Base class for all protocols related to subsets.

class pyworkflow.em.protocol.protocol_sets.ProtSplitSet(**kwargs)[source]

Bases: pyworkflow.em.protocol.protocol_sets.ProtSets

Protocol to split a set in two or more subsets.

class pyworkflow.em.protocol.protocol_sets.ProtSubSet(**kwargs)[source]

Bases: pyworkflow.em.protocol.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).

class pyworkflow.em.protocol.protocol_sets.ProtSubSetByMic(**kwargs)[source]

Bases: pyworkflow.em.protocol.protocol_sets.ProtSets

Create a subset of those particles comes from a particular set of micrographs

createOutputStep(partsId, micsId)[source]
class pyworkflow.em.protocol.protocol_sets.ProtUnionSet(**kwargs)[source]

Bases: pyworkflow.em.protocol.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]

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


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


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. objId object.label: objLabel object.comment: objComment