Beispiel #1
0
 def convertInputStep(self, micsId, refsId):
     self._ih = ImageHandler() # used to convert micrographs
     # Match ctf information against the micrographs
     self.ctfDict = {}
     if self.ctfRelations.get() is not None:
         for ctf in self.ctfRelations.get():
             self.ctfDict[ctf.getMicrograph().getMicName()] = ctf.clone()
     
     micStar = self._getPath('input_micrographs.star')
     writeSetOfMicrographs(self.getInputMicrographs(), micStar, 
                           preprocessImageRow=self._preprocessMicrographRow,
                           postprocessImageRow=self._postprocessMicrographRow)
     
     writeReferences(self.getInputReferences(), self._getPath('input_references'))  
Beispiel #2
0
    def convertInputStep(self, inputId, avgId, volId):
        """ Create the input file in STAR format as expected by Relion.
        If the input particles comes from Relion, just link the file.
        Params:
            particlesId: use this parameters just to force redo of convert if
                the input particles are changed.
        """
        inputSet = self.inputSet.get()
        imgStar = self._getFileName('input_particles')
        refStar = self._getFileName('input_refs')
        # Pass stack file as None to avoid write the images files
        self.info("Converting set from '%s' into '%s'" %
                  (inputSet.getFileName(), imgStar))

        refSet = None
        # case refine3D
        if self.isInputClasses():
            refSet = self.inputSet.get()  # 2D or 3D classes

        else:
            if self.isInputAutoRefine():
                em.ImageHandler().convert(self.referenceVolume.get(),
                                          self._getFileName('input_refvol'))
            else:  # Autopicking case
                refSet = self.referenceAverages.get()

        self.classDict = {}

        if refSet:
            self.info("Converting reference from '%s' into %s" %
                      (refSet.getFileName(), refStar))

            # Compute class mapping
            classList = [cls.getObjId() for cls in refSet]
            classList.sort()
            for i, c in enumerate(classList):
                self.classDict[c] = i + 1

            writeReferences(refSet,
                            removeExt(refStar),
                            postprocessImageRow=self._updateClasses)

        # Write particles star file
        allParticles = self._allParticles(iterate=False)
        writeSetOfParticles(allParticles,
                            imgStar,
                            self._getPath(),
                            postprocessImageRow=self._postProcessImageRow)
Beispiel #3
0
    def convertInputStep(self, micsId, refsId, runType):
        # runType is passed as parameter to force a re-execute of this step
        # if there is a change in the type

        self._ih = ImageHandler() # used to convert micrographs
        # Match ctf information against the micrographs
        self.ctfDict = {}
        if self.ctfRelations.get() is not None:
            for ctf in self.ctfRelations.get():
                self.ctfDict[ctf.getMicrograph().getMicName()] = ctf.clone()

        micStar = self._getPath('input_micrographs.star')
        writeSetOfMicrographs(self.getMicrographList(), micStar,
                              alignType=ALIGN_NONE,
                              preprocessImageRow=self._preprocessMicrographRow)

        if self.useInputReferences():
            writeReferences(self.getInputReferences(),
                            self._getPath('input_references'), useBasename=True)
    def convertInputStep(self, micsId, refsId, runType):
        # runType is passed as parameter to force a re-execute of this step
        # if there is a change in the type

        self._ih = ImageHandler()  # used to convert micrographs
        # Match ctf information against the micrographs
        self.ctfDict = {}
        if self.ctfRelations.get() is not None:
            for ctf in self.ctfRelations.get():
                self.ctfDict[ctf.getMicrograph().getMicName()] = ctf.clone()

        micStar = self._getPath('input_micrographs.star')
        writeSetOfMicrographs(self.getMicrographList(),
                              micStar,
                              alignType=ALIGN_NONE,
                              preprocessImageRow=self._preprocessMicrographRow)

        if self.useInputReferences():
            writeReferences(self.getInputReferences(),
                            self._getPath('input_references'),
                            useBasename=True)