Package net.sf.mzmine.project

Examples of net.sf.mzmine.project.MZmineProject


      e.printStackTrace();
      return;
    }

    // Add new peaklist to the project or MZviewer.desktop
    MZmineProject currentProject = MZmineCore.getCurrentProject();
    currentProject.addPeakList(buildingPeakList);

    logger.info("Finished parsing " + fileName);
    setStatus(TaskStatus.FINISHED);

  }
View Full Code Here


      processedRows++;

    }

    // Add new peaklist to the project
    MZmineProject currentProject = MZmineCore.getCurrentProject();
    currentProject.addPeakList(normalizedPeakList);

    // Load previous applied methods
    for (PeakListAppliedMethod proc : originalPeakList.getAppliedMethods()) {
      normalizedPeakList.addDescriptionOfAppliedTask(proc);
    }

    // Add task description to peakList
    normalizedPeakList
        .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
            "Standard compound normalization", parameters));

    // Remove the original peaklist if requested
    if (removeOriginal)
      currentProject.removePeakList(originalPeakList);

    logger.info("Finished standard compound normalizer");
    setStatus(TaskStatus.FINISHED);

  }
View Full Code Here

    logger.info("Running Path aligner");

    aligner = (Aligner) new ScoreAligner(this.peakLists, parameters);
    alignedPeakList = aligner.align();
    // Add new aligned peak list to the project
    MZmineProject currentProject = MZmineCore.getCurrentProject();
    currentProject.addPeakList(alignedPeakList);

    // Add task description to peakList
    alignedPeakList
        .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
            "Path aligner", parameters));
View Full Code Here

      if (!isCanceled()) {
        // Finalize writing
        filteredDataFile = rawDataFileWriter.finishWriting();

        // Add the newly created file to the project
        final MZmineProject project = MZmineCore.getCurrentProject();
        project.addFile(filteredDataFile);

        // Remove the original data file if requested
        if (removeOriginal)
          project.removeFile(dataFile);

        setStatus(TaskStatus.FINISHED);
        logger.info("Finished spectrum filter " + dataFile.getName());
      }
    } catch (IOException e) {
View Full Code Here

        filteredPeakList = filterPeakListRows(origPeakList);

        if (!isCanceled()) {

          // Add new peaklist to the project
          final MZmineProject currentProject = MZmineCore
              .getCurrentProject();
          currentProject.addPeakList(filteredPeakList);

          // Remove the original peaklist if requested
          if (parameters.getParameter(AUTO_REMOVE).getValue()) {

            currentProject.removePeakList(origPeakList);
          }

          setStatus(TaskStatus.FINISHED);
          LOG.info("Finished peak list rows filter");
        }
View Full Code Here

      }

    } // Next peak list

    // Add new aligned peak list to the project
    MZmineProject currentProject = MZmineCore.getCurrentProject();
    currentProject.addPeakList(alignedPeakList);

    // Add task description to peakList
    alignedPeakList
        .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
            "Ransac aligner", parameters));
View Full Code Here

      numberOfGroups = selectedRawDataFiles.length;
    }

    if (coloringType.isByParameter()) {
      // Group files with same parameter value to same group
      MZmineProject project = MZmineCore.getCurrentProject();
      Vector<Object> availableParameterValues = new Vector<Object>();
      UserParameter selectedParameter = coloringType.getParameter();
      for (RawDataFile rawDataFile : selectedRawDataFiles) {
        Object paramValue = project.getParameterValue(
            selectedParameter, rawDataFile);
        if (!availableParameterValues.contains(paramValue))
          availableParameterValues.add(paramValue);
      }

      for (int ind = 0; ind < selectedRawDataFiles.length; ind++) {
        Object paramValue = project.getParameterValue(
            selectedParameter, selectedRawDataFiles[ind]);
        groupsForSelectedRawDataFiles[ind] = availableParameterValues
            .indexOf(paramValue);
      }
      parameterValuesForGroups = availableParameterValues.toArray();
View Full Code Here

      processedPeaks++;

    }

    // Add new peakList to the project
    MZmineProject currentProject = MZmineCore.getCurrentProject();
    currentProject.addPeakList(extendedPeakList);

    // Load previous applied methods
    for (PeakListAppliedMethod proc : peakList.getAppliedMethods()) {
      extendedPeakList.addDescriptionOfAppliedTask(proc);
    }

    // Add task description to peakList
    extendedPeakList
        .addDescriptionOfAppliedTask(new SimplePeakListAppliedMethod(
            "Peak extender", parameters));

    // Remove the original peakList if requested
    if (removeOriginal)
      currentProject.removePeakList(peakList);

    logger.info("Finished peak extender on " + peakList);
    setStatus(TaskStatus.FINISHED);

  }
View Full Code Here

    // Determine the reference group and non reference group (the rest of
    // the samples) for raw data files
    List<RawDataFile> referenceDataFiles = new ArrayList<RawDataFile>();
    List<RawDataFile> nonReferenceDataFiles = new ArrayList<RawDataFile>();

    MZmineProject project = MZmineCore.getCurrentProject();
    for (RawDataFile rawDataFile : allDataFiles) {

      Object paramValue = project.getParameterValue(selectedParameter,
          rawDataFile);

      if (paramValue.equals(referenceGroup)) {

        referenceDataFiles.add(rawDataFile);
View Full Code Here

    // the samples) for raw data files
    List<RawDataFile> referenceDataFiles = new ArrayList<RawDataFile>();
    List<RawDataFile> nonReferenceDataFiles = new ArrayList<RawDataFile>();

    List<String> groups = new ArrayList<String>();
    MZmineProject project = MZmineCore.getCurrentProject();

    for (RawDataFile rawDataFile : allDataFiles) {

      Object paramValue = project.getParameterValue(selectedParameter,
          rawDataFile);
      if (!groups.contains(String.valueOf(paramValue))) {
        groups.add(String.valueOf(paramValue));
      }
      if (String.valueOf(paramValue).equals(referenceGroup)) {

        referenceDataFiles.add(rawDataFile);
      } else {

        nonReferenceDataFiles.add(rawDataFile);
      }
    }

    int numRows = 0;
    for (int row = 0; row < peakList.getNumberOfRows(); row++) {

      if (!onlyIdentified
          || (onlyIdentified && peakList.getRow(row)
              .getPeakIdentities().length > 0)) {
        numRows++;
      }
    }

    // Create a new aligned peak list with all the samples if the reference
    // group has to be shown or with only
    // the non reference group if not.
    double[][] dataMatrix = new double[groups.size() - 1][numRows];
    pValueMatrix = new String[groups.size() - 1][numRows];

    // data files that should be in the heat map
    List<RawDataFile> shownDataFiles = nonReferenceDataFiles;

    for (int row = 0, rowIndex = 0; row < peakList.getNumberOfRows(); row++) {
      PeakListRow rowPeak = peakList.getRow(row);
      if (!onlyIdentified
          || (onlyIdentified && rowPeak.getPeakIdentities().length > 0)) {
        // Average area or height of the reference group
        meanControlStats.clear();
        for (int column = 0; column < referenceDataFiles.size(); column++) {

          if (rowPeak.getPeak(referenceDataFiles.get(column)) != null) {

            if (area) {

              meanControlStats.addValue(rowPeak.getPeak(
                  referenceDataFiles.get(column)).getArea());
            } else {

              meanControlStats
                  .addValue(rowPeak.getPeak(
                      referenceDataFiles.get(column))
                      .getHeight());
            }

          }
        }

        // Divide the area or height of each peak by the average of the
        // area or height of the reference peaks in each row
        int columnIndex = 0;
        for (int column = 0; column < groups.size(); column++) {
          String group = groups.get(column);
          meanGroupStats.clear();
          if (!group.equals(referenceGroup)) {

            for (int dataColumn = 0; dataColumn < shownDataFiles
                .size(); dataColumn++) {

              Object paramValue = project.getParameterValue(
                  selectedParameter,
                  shownDataFiles.get(dataColumn));
              if (rowPeak.getPeak(shownDataFiles.get(dataColumn)) != null
                  && String.valueOf(paramValue).equals(group)) {
View Full Code Here

TOP

Related Classes of net.sf.mzmine.project.MZmineProject

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.