Esempio n. 1
0
    def _defineParams(self, form):
        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('boxSize',
                      IntParam,
                      default=100,
                      allowsPointers=True,
                      label='Box Size',
                      help='Box size in pixels')
        line = form.addLine('Picker range',
                            help='CCF threshold range for automatic picking')
        line.addParam('lowerThreshold', FloatParam, default='1', label='Lower')
        line.addParam('higherThreshold',
                      FloatParam,
                      default='30',
                      label='Higher')
        form.addParam('gaussWidth',
                      FloatParam,
                      default='1',
                      label='Gauss Width',
                      help='Width of the Gaussian kernel used')
        form.addParam('useVarImg',
                      BooleanParam,
                      default=False,
                      expertLevel=LEVEL_ADVANCED,
                      label='Use variance image?')
        form.addParam('doInvert',
                      BooleanParam,
                      default=True,
                      expertLevel=LEVEL_ADVANCED,
                      label='Invert contrast?',
                      help='Picker expects particles to be white.')

        form.addParallelSection(threads=1, mpi=0)
Esempio n. 2
0
    def _defineParams(self, form):

        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('diameter',
                      params.IntParam,
                      default=100,
                      label='Diameter of particle')
        form.addParam('invert',
                      params.BooleanParam,
                      default=False,
                      label='Invert',
                      help="Invert image before picking, DoG normally picks "
                      "white particles.")
        form.addParam('threshold',
                      params.FloatParam,
                      default=0.5,
                      label='Threshold',
                      help="Threshold in standard deviations above the mean, "
                      "e.g. --thresh=0.7")
        form.addParam('extraParams',
                      params.StringParam,
                      expertLevel=params.LEVEL_ADVANCED,
                      label='Additional parameters',
                      help='Additional parameters for dogpicker: \n  '
                      '--numberSizes, --sizeRange, --threshold,...')
    def _defineParams(self, form):
        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('boxSize',
                      IntParam,
                      default=128,
                      label='Box size (px)',
                      help="Box size in pixels.")
        form.addParam('particleSize',
                      IntParam,
                      default=100,
                      label='Particle size (px)',
                      help="Longest axis of particle in pixels (diameter, "
                      "not radius).")
        form.addParam(
            'boxerMode',
            EnumParam,
            choices=['local search', 'by ref', 'gauss', 'neural net'],
            label="Autopicker mode:",
            default=AUTO_LOCAL,
            display=EnumParam.DISPLAY_COMBO,
            help="Choose autopicker mode:\n\n"
            " _local search_ - Reference based search by "
            "downsampling and 2-D alignment to references.\n"
            " _by ref_ - simple reference-based "
            "cross-correlation picker with exhaustive "
            "rotational search.\n"
            " _gauss_ - Gaussian sparx picker.\n"
            " _neural net_ - convolutional neural network "
            "boxer.")
        form.addParam('threshold',
                      FloatParam,
                      default='5.0',
                      label='Threshold')

        form.addSection('References')
        form.addParam('goodRefs',
                      PointerParam,
                      pointerClass='SetOfAverages',
                      important=True,
                      label="Good references",
                      help="Good particle references.")
        form.addParam('badRefs',
                      PointerParam,
                      pointerClass='SetOfAverages',
                      allowsNull=True,
                      label="Bad references",
                      help="Bad particle references like ice contamination "
                      "or large aggregation.")
        form.addParam('bgRefs',
                      PointerParam,
                      pointerClass='SetOfAverages',
                      allowsNull=True,
                      label="Background references",
                      help="Pure noise regions in micrograph.")

        form.addParallelSection(threads=1, mpi=0)
Esempio n. 4
0
    def _defineParams(self, form):
        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('boxSize', IntParam, default=100,
                      label='Box Size', help='Box size in pixels')
        line = form.addLine('Picker range',
                            help='CCF threshold range for automatic picking')
        line.addParam('lowerThreshold', FloatParam, default='1',
                      label='Lower')
        line.addParam('higherThreshold', FloatParam, default='30',
                      label='Higher')

        form.addParam('gaussWidth', FloatParam, default='1',
                      label='Gauss Width',
                      help='Width of the Gaussian kernel used')
Esempio n. 5
0
    def _createSetOfCoordinates(self, micSet, suffix=''):
        """ Override this method to set the box size. """
        coordSet = ProtParticlePickingAuto._createSetOfCoordinates(self, micSet,
                                                                   suffix=suffix)
        coordSet.setBoxSize(self.getBoxSize())

        return coordSet
    def _createSetOfCoordinates(self, micSet, suffix=''):
        """ Override this method to set the box size. """
        coordSet = ProtParticlePickingAuto._createSetOfCoordinates(
            self, micSet, suffix=suffix)
        coordSet.setBoxSize(self.getBoxSize())

        return coordSet
Esempio n. 7
0
    def _defineParams(self, form):

        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('radius', params.IntParam,
                      label='Radius of particle (px)')

        form.addParam('height', params.FloatParam, default=0.5,
                      label="Min. height",
                      help='The minimum height of the virus peak compared to '
                           'the average peak.')

        form.addParam('squareWidth', params.FloatParam, default=1.5,
                      label="Square width",
                      help='Minimum distance between two viruses is:\n'
                           '2 * SQUARE_WIDTH_PARAM * RADIUS.')

        form.addParam('ringWidth', params.FloatParam, default=1.2,
                      label="Ring width",
                      help='Width of the ring in ring filter is: \n'
                           'RING_WIDTH_PARAM * RADIUS - RADIUS.')

        form.addParam('dist', params.FloatParam, default=0.1,
                      label="Distance",
                      help='Distance which the peak can move in x or y '
                           'direction during center refinement is: \n'
                           'DIST_PARAM * RADIUS.')

        form.addParam('reduction', params.IntParam, default=0,
                      label="Reduction",
                      help='REDUCTION_PARAM * REDUCTION_PARAM pixels are '
                           'averaged before filtering. The value has to be '
                           'integer. Special value 0 means that the program '
                           'determines the parameter.')

        form.addParam('doRefine', params.BooleanParam, default=True,
                      label="Refine particle centers?",
                      help='')
        form.addParam('doSectorTest', params.BooleanParam, default=True,
                      label="Perform sector test?",
                      help='')
        form.addParam('doHeightTest', params.BooleanParam, default=True,
                      label="Perform height test?",
                      help='')
        form.addParam('doDistanceTest', params.BooleanParam, default=True,
                      label="Perform peak pair distance test?",
                      help='')
Esempio n. 8
0
    def _defineParams(self, form):

        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('diameter', params.IntParam, default=100,
                   label='Diameter of particle')
        form.addParam('invert', params.BooleanParam, default=False,
                      label='Invert',
                      help = "Invert image before picking, DoG normally picks "
                             "white particles.")
        form.addParam('threshold', params.FloatParam, default=0.5,
                      label='Threshold',
                      help = "Threshold in standard deviations above the mean, "
                             "e.g. --thresh=0.7")
        form.addParam('extraParams', params.StringParam,
                      expertLevel=params.LEVEL_ADVANCED,
                      label='Additional parameters',
                      help='Additional parameters for dogpicker: \n  '
                           '--numberSizes, --sizeRange, --threshold,...')
    def _insertAllSteps(self):
        self.inputStreaming = self.getInputMicrographs().isStreamOpen()

        if self.inputStreaming and not self.isRunOptimize():
            # If the input is in streaming, follow the base class policy
            # about inserting new steps and discovery new input/output
            ProtParticlePickingAuto._insertAllSteps(self)
            self.createOutputStep = self._doNothing
        else:
            # If not in streaming, then we will just insert a single step to
            # pick all micrographs at once since it is much faster
            self._insertInitialSteps()
            self._insertFunctionStep('_pickMicrographsFromStar',
                                     self._getPath('input_micrographs.star'),
                                     *self._getPickArgs())
            self._insertFunctionStep('createOutputStep')

            # Disable streaming functions:
            self._insertFinalSteps = self._doNothing
            self._stepsCheck = self._doNothing
Esempio n. 10
0
    def _insertAllSteps(self):
        self.inputStreaming = self.getInputMicrographs().isStreamOpen()

        if self.inputStreaming and not self.isRunOptimize():
            # If the input is in streaming, follow the base class policy
            # about inserting new steps and discovery new input/output
            ProtParticlePickingAuto._insertAllSteps(self)
            self.createOutputStep = self._doNothing
        else:
            # If not in streaming, then we will just insert a single step to
            # pick all micrographs at once since it is much faster
            self._insertInitialSteps()
            self._insertFunctionStep('_pickMicrographsFromStar',
                                     self._getPath('input_micrographs.star'),
                                     *self._getPickArgs())
            self._insertFunctionStep('createOutputStep')

            # Disable streaming functions:
            self._insertFinalSteps = self._doNothing
            self._stepsCheck = self._doNothing
Esempio n. 11
0
    def _defineParams(self, form):
        ProtParticlePickingAuto._defineParams(self, form)
        form.addParam('boxSize',
                      IntParam,
                      default=100,
                      label='Box Size',
                      help='Box size in pixels')
        line = form.addLine('Picker range',
                            help='CCF threshold range for automatic picking')
        line.addParam('lowerThreshold', FloatParam, default='1', label='Lower')
        line.addParam('higherThreshold',
                      FloatParam,
                      default='30',
                      label='Higher')

        form.addParam('gaussWidth',
                      FloatParam,
                      default='1',
                      label='Gauss Width',
                      help='Width of the Gaussian kernel used')
Esempio n. 12
0
 def __init__(self, **args):
     ProtParticlePickingAuto.__init__(self, **args)
Esempio n. 13
0
 def __init__(self, **kwargs):
     ProtParticlePickingAuto.__init__(self, **kwargs)
     self.extraParams = ('pixel_input=1:pixel_output=1:invert_contrast'
                         '=True:use_variance=True')
Esempio n. 14
0
 def __init__(self, **kwargs):
     ProtParticlePickingAuto.__init__(self, **kwargs)
     self.extraParams = ('pixel_input=1:pixel_output=1:invert_contrast'
                         '=True:use_variance=True')
Esempio n. 15
0
 def getFiles(self):
     return (self.inputMicrographs.get().getFiles() |
             ProtParticlePickingAuto.getFiles(self))
 def __init__(self, **kwargs):
     ProtParticlePickingAuto.__init__(self, **kwargs)
     self.stepsExecutionMode = STEPS_PARALLEL
 def __init__(self, **kwargs):
     ProtParticlePickingAuto.__init__(self, **kwargs)
Esempio n. 18
0
 def getFiles(self):
     return (self.inputMicrographs.get().getFiles()
             | ProtParticlePickingAuto.getFiles(self))
Esempio n. 19
0
 def __init__(self, **kwargs):
     ProtParticlePickingAuto.__init__(self, **kwargs)
     self.extraParams = 'pixel_input=1:pixel_output=1'