Example #1
0
    def _runAnalysis(self, paramName=None):
        program = Plugin.getProgram('analyze')
        args = ' %s %d --Apix %0.3f' % (
            self.protocol._getFileName("output_dir"),
            self._epoch,
            self.protocol._getSampling())

        hostConfig = self.protocol.getHostConfig()
        # Create the steps executor
        executor = StepExecutor(hostConfig)
        self.protocol.setStepsExecutor(executor)
        # Finally run the protocol
        self.protocol.runJob(program, args, env=Plugin.getEnviron(),
                             cwd=None)
Example #2
0
        def _extraWork():
            program = Plugin.getProgram('').split()[:-1]  # remove cryodrgn command
            fn = self.protocol._getFileName('output_notebook',
                                            epoch=self._epoch)
            program.append('jupyter notebook %s' % os.path.basename(fn))

            if os.path.exists(fn):
                fnDir = os.path.dirname(fn)
                hostConfig = self.protocol.getHostConfig()
                executor = StepExecutor(hostConfig)
                self.protocol.setStepsExecutor(executor)
                self.protocol.runJob(" ".join(program), '',
                                     env=Plugin.getEnviron(),
                                     cwd=fnDir)
            else:
                self.showError('Jupyter notebook not found! Have you run analysis?')
    def _getTrainingArgs(self):
        args = [
            '-o %s ' % self._getFileName('output_dir'),
            '--zdim %d' % self.zDim.get(),
            '--poses %s' % self._getFileName('input_poses'),
            '--ctf %s' % self._getFileName('input_ctf'),
            '-n %d' % self.numEpochs.get(), '--relion31 '
        ]

        if Plugin.IS_V03():
            if len(self.getGpuList()) > 1:
                args.append('--multigpu')
            if not self.doInvert:
                args.append('--uninvert-data')

            args.extend([
                '--enc-layers %d' % self.qLayers.get(),
                '--enc-dim %d' % self.qDim.get(),
                '--dec-layers %d' % self.pLayers.get(),
                '--dec-dim %d' % self.pDim.get()
            ])
        else:
            if self.doInvert:
                args.append('--invert-data')
            args.extend([
                '--qlayers %d' % self.qLayers.get(),
                '--qdim %d' % self.qDim.get(),
                '--players %d' % self.pLayers.get(),
                '--pdim %d' % self.pDim.get()
            ])

        if self.extraParams.hasValue():
            args.append('%s' % self.extraParams.get())

        if os.path.exists(self._getFileName('input_stack')):
            # input is a downsampled stack
            args.append('%s' % self._getFileName('input_stack'))
        else:
            # input is a star file
            args.extend([
                '--datadir %s' % self._getDataDir(),
                '%s' % self._getFileName('input_parts')
            ])

        return args
 def runTrainingStep(self):
     """ Call cryoDRGN with the appropriate parameters. """
     params = ' '.join(self._getTrainingArgs())
     gpus = ",".join(str(i) for i in self.getGpuList())
     program = Plugin.getProgram('train_vae', gpus=gpus)
     self.runJob(program, params, env=Plugin.getEnviron(), cwd=None)
Example #5
0
 def runParseCtfStep(self):
     """ Call cryoDRGN with the appropriate parameters. """
     params = ' '.join(self._getParseCtfArgs())
     program = Plugin.getProgram('parse_ctf_star')
     self.runJob(program, params, env=Plugin.getEnviron(), cwd=None)
Example #6
0
 def runDownSampleStep(self):
     """ Call cryoDRGN with the appropriate parameters. """
     params = ' '.join(self._getDownsampleArgs())
     program = Plugin.getProgram('downsample')
     self.runJob(program, params, env=Plugin.getEnviron(), cwd=None)
Example #7
0
 def _runProgram(self, program, args, useGpu=True):
     gpus = ','.join(str(i) for i in self.getGpuList())
     self.runJob(Plugin.getProgram(program, gpus), ' '.join(args))
 def _runProgram(self, program, args):
     self.runJob(Plugin.getProgram(program), ' '.join(args))