Package net.sf.mzmine.parameters

Examples of net.sf.mzmine.parameters.ParameterSet


  }

  public static void show2DVisualizerSetupDialog(RawDataFile dataFile,
      Range mzRange, Range rtRange) {

    ParameterSet parameters = MZmineCore.getConfiguration()
        .getModuleParameters(TwoDVisualizerModule.class);

    parameters.getParameter(TwoDParameters.dataFiles).setValue(
        new RawDataFile[]{dataFile});

    if (rtRange != null)
      parameters.getParameter(TwoDParameters.retentionTimeRange)
          .setValue(rtRange);
    if (mzRange != null)
      parameters.getParameter(TwoDParameters.mzRange).setValue(mzRange);

    ExitCode exitCode = parameters.showSetupDialog();

    if (exitCode != ExitCode.OK)
      return;

    int msLevel = parameters.getParameter(TwoDParameters.msLevel)
        .getValue();
    rtRange = parameters.getParameter(TwoDParameters.retentionTimeRange)
        .getValue();
    mzRange = parameters.getParameter(TwoDParameters.mzRange).getValue();

    TwoDVisualizerWindow newWindow = new TwoDVisualizerWindow(dataFile,
        msLevel, rtRange, mzRange, parameters);

    MZmineCore.getDesktop().addInternalFrame(newWindow);
View Full Code Here


        if (module instanceof MZmineProcessingModule
            && module.getClass().getName().equals(methodName)) {

          logger.info("success, now loading parameters...");
          // Get parameters and add step to queue.
          final ParameterSet parameterSet = MZmineCore
              .getConfiguration().getModuleParameters(
                  module.getClass());
          final ParameterSet methodParams = parameterSet
              .cloneParameter();

          logger.fine("method parameters are of type: "
              + methodParams.getClass().getName());
          methodParams.loadValuesFromXML(stepElement);
          queue.add(new MZmineProcessingStepImpl<MZmineProcessingModule>(
              (MZmineProcessingModule) module, methodParams));
          break;
        } else {
          // logger.finest("=> was of wrong type or name didn't match...");
View Full Code Here

      stepElement.setAttribute(METHOD_ELEMENT, step.getModule()
          .getClass().getName());
      xmlElement.appendChild(stepElement);

      // Save parameters.
      final ParameterSet parameters = step.getParameterSet();
      if (parameters != null) {
        parameters.saveValuesToXML(stepElement);
      }
    }
  }
View Full Code Here

        // Show method's set-up dialog.
        final MZmineModuleWrapper wrappedModule = (MZmineModuleWrapper) selectedItem;
        final MZmineProcessingModule selectedMethod = (MZmineProcessingModule) wrappedModule
            .getModule();
        final ParameterSet methodParams = MZmineCore.getConfiguration()
            .getModuleParameters(selectedMethod.getClass());

        if (methodParams.getParameters().length > 0) {
          ExitCode exitCode = methodParams.showSetupDialog();
          if (exitCode != ExitCode.OK)
            return;
        }

        // Make a new step
        final ParameterSet stepParams = methodParams.cloneParameter();
        final MZmineProcessingStep<MZmineProcessingModule> step = new MZmineProcessingStepImpl<MZmineProcessingModule>(
            selectedMethod, stepParams);

        // Add step to queue.
        batchQueue.add(step);
        currentStepsList.setListData(batchQueue);
        currentStepsList.setSelectedIndex(currentStepsList.getModel()
            .getSize() - 1);

      }
    }

    if (btnRemove.equals(src)) {

      // Remove selected step.
      final MZmineProcessingStep selected = (MZmineProcessingStep) currentStepsList
          .getSelectedValue();
      if (selected != null) {
        final int index = currentStepsList.getSelectedIndex();
        batchQueue.remove(selected);
        currentStepsList.setListData(batchQueue);
        selectStep(index);
      }
    }

    if (btnClear.equals(src)) {

      // Clear the queue.
      batchQueue.clear();
      currentStepsList.setListData(batchQueue);
    }

    if (btnConfig.equals(src)) {

      // Configure the selected item.
      final MZmineProcessingStep selected = (MZmineProcessingStep) currentStepsList
          .getSelectedValue();
      final ParameterSet parameters = selected == null ? null : selected
          .getParameterSet();
      if (parameters != null) {
        parameters.showSetupDialog();
      }
    }

    if (btnSave.equals(src)) {
View Full Code Here

          + " within given retention time range.");
      return ExitCode.ERROR;

    }

    ParameterSet myParameters = MZmineCore.getConfiguration()
        .getModuleParameters(ThreeDVisualizerModule.class);
    try {
      desktop.addInternalFrame(new ThreeDVisualizerWindow(
          dataFile,
          msLevel,
          rtRange,
          myParameters.getParameter(
              ThreeDVisualizerParameters.rtResolution).getValue(),
          myParameters.getParameter(
              ThreeDVisualizerParameters.mzRange).getValue(),
          myParameters.getParameter(
              ThreeDVisualizerParameters.mzResolution).getValue()));
    } catch (RemoteException e) {

      final String msg = "Couldn't create 3D plot";
      LOG.log(Level.WARNING, msg, e);
View Full Code Here

  }

  public static void setupNew3DVisualizer(final RawDataFile dataFile,
      final Range mzRange, final Range rtRange) {

    final ParameterSet myParameters = MZmineCore.getConfiguration()
        .getModuleParameters(ThreeDVisualizerModule.class);
    final ThreeDVisualizerModule myInstance = MZmineCore
        .getModuleInstance(ThreeDVisualizerModule.class);
    myParameters.getParameter(ThreeDVisualizerParameters.dataFiles)
        .setValue(new RawDataFile[]{dataFile});
    myParameters
        .getParameter(ThreeDVisualizerParameters.retentionTimeRange)
        .setValue(rtRange);
    myParameters.getParameter(ThreeDVisualizerParameters.mzRange).setValue(
        mzRange);
    if (myParameters.showSetupDialog() == ExitCode.OK) {
      myInstance.runModule(myParameters.cloneParameter(),
          new ArrayList<Task>());
    }
  }
View Full Code Here

      // Check each step.
      for (final MZmineProcessingStep batchStep : value) {

        // Check step's parameters.
        final ParameterSet params = batchStep.getParameterSet();
        if (params != null) {
          for (final Parameter<?> parameter : params.getParameters()) {

            // Ignore the raw data files and peak lists parameters
            if (!(parameter instanceof RawDataFilesParameter)
                && !(parameter instanceof PeakListsParameter)
                && !parameter.checkValue(errorMessages)) {
View Full Code Here

    // This is a hack to keep correct value of last opened directory (this
    // value was overwritten when configuration file was loaded from the new
    // project)
    if (project.getProjectFile() != null) {
      File projectFile = project.getProjectFile();
      ParameterSet loaderParams = MZmineCore.getConfiguration()
          .getModuleParameters(ProjectLoadModule.class);
      loaderParams.getParameter(ProjectLoaderParameters.projectFile)
          .setValue(projectFile);
    }

    // Notify the GUI about project structure change
    ((MZmineProjectImpl) project).activateProject();
View Full Code Here

    MZmineProcessingStep currentStep = queue.get(stepNumber);

    logger.fine("running step: " + currentStep);
    MZmineProcessingModule method = (MZmineProcessingModule) currentStep
        .getModule();
    ParameterSet batchStepParameters = currentStep.getParameterSet();

    // Update dataFiles and peakLists in the batchStepParameters
    for (Parameter p : batchStepParameters.getParameters()) {
      if (p instanceof RawDataFilesParameter)
        ((RawDataFilesParameter) p).setValue(dataFiles);
      if (p instanceof PeakListsParameter)
        ((PeakListsParameter) p).setValue(peakLists);
      if (p instanceof RawDataFilesMultiChoiceParameter)
        ((RawDataFilesMultiChoiceParameter) p).setChoices(dataFiles);
    }

    // Check if the parameter settings are valid
    ArrayList<String> messages = new ArrayList<String>();
    boolean paramsCheck = batchStepParameters
        .checkAllParameterValues(messages);
    if (!paramsCheck) {
      setStatus(TaskStatus.ERROR);
      errorMessage = "Invalid parameter settings for module " + method
          + ": " + Arrays.toString(messages.toArray());
View Full Code Here

      ModuleType modules[]) {
    this.name = name;
    this.description = description;
    this.modulesWithParams = new MZmineProcessingStep[modules.length];
    for (int i = 0; i < modules.length; i++) {
      ParameterSet moduleParams;
      try {
        Class<? extends ParameterSet> parameterSetClass = modules[i]
            .getParameterSetClass();
        if (parameterSetClass != null)
          moduleParams = parameterSetClass.newInstance();
View Full Code Here

TOP

Related Classes of net.sf.mzmine.parameters.ParameterSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.