Package net.sf.mzmine.util

Examples of net.sf.mzmine.util.Range


      // Search for peaks.
      Arrays.sort(scanNumbers);
      final ChromatographicPeak[] resolvedOriginalPeaks = peaksSearch(
          chromatogram, scanNumbers, secondDerivative, noiseThreshold);

      final Range peakDuration = parameters.getParameter(PEAK_DURATION)
          .getValue();
      final double minimumPeakHeight = parameters.getParameter(
          MIN_PEAK_HEIGHT).getValue();

      // Apply final filter of detected peaks, according with setup
      // parameters.
      for (final ChromatographicPeak p : resolvedOriginalPeaks) {

        if (peakDuration
            .contains(p.getRawDataPointsRTRange().getSize())
            && p.getHeight() >= minimumPeakHeight) {

          resolvedPeaks.add(p);
        }
View Full Code Here


        SortingDirection.Descending));

    // Compare each three rows against each other
    for (int i = 0; i < totalRows; i++) {

      Range testRTRange = rtTolerance.getToleranceRange(rows[i]
          .getAverageRT());
      PeakListRow testRows[] = peakList
          .getRowsInsideScanRange(testRTRange);

      for (int j = 0; j < testRows.length; j++) {
View Full Code Here

   */
  private boolean checkComplex(PeakListRow complexRow, PeakListRow row1,
      PeakListRow row2) {

    // Check retention time condition
    Range rtRange = rtTolerance
        .getToleranceRange(complexRow.getAverageRT());
    if (!rtRange.contains(row1.getAverageRT()))
      return false;
    if (!rtRange.contains(row2.getAverageRT()))
      return false;

    // Check mass condition
    double expectedMass = row1.getAverageMZ() + row2.getAverageMZ()
        - (2 * ionType.getAddedMass());
    double detectedMass = complexRow.getAverageMZ()
        - ionType.getAddedMass();
    Range mzRange = mzTolerance.getToleranceRange(detectedMass);
    if (!mzRange.contains(expectedMass))
      return false;

    // Check height condition
    if ((complexRow.getAverageHeight() > row1.getAverageHeight()
        * maxComplexHeight)
 
View Full Code Here

  public synchronized String[] findCompounds(double mass,
      MZTolerance mzTolerance, int numOfResults, ParameterSet parameters)
      throws IOException {

    Range toleranceRange = mzTolerance.getToleranceRange(mass);

    MetlinServiceLocator locator = new MetlinServiceLocator();
    MetlinPortType serv;
    try {
      serv = locator.getMetlinPort();
    } catch (ServiceException e) {
      throw (new IOException(e));
    }

    // Search mass as float[]
    float searchMass[] = new float[]{(float) toleranceRange.getAverage()};
    float searchTolerance = (float) (toleranceRange.getSize() / 2.0);

    final String token = parameters.getParameter(
        MetLinParameters.SECURITY_TOKEN).getValue();

    MetaboliteSearchRequest searchParams = new MetaboliteSearchRequest(
View Full Code Here

  private static final String met3DStructureAddress2 = ".pdb";

  public String[] findCompounds(double mass, MZTolerance mzTolerance,
      int numOfResults, ParameterSet parameters) throws IOException {

    Range toleranceRange = mzTolerance.getToleranceRange(mass);

    String queryAddress = keggFindAddress1 + toleranceRange.getMin() + "-"
        + toleranceRange.getMax() + keggFindAddress2;

    URL queryURL = new URL(queryAddress);

    String queryResult = InetUtils.retrieveData(queryURL);
View Full Code Here

    } else {

      LOG.finest("Processing peak matrix...");

      final Range peakDuration = parameters.getParameter(PEAK_DURATION)
          .getValue();

      // Process peak matrix.
      resolvedPeaks = new ArrayList<ResolvedPeak>(peakMatrix.length);

      for (final double[] peakRow : peakMatrix) {

        // Get peak start and end.
        final int peakLeft = findRTIndex(retentionTimes, peakRow[4]);
        final int peakRight = findRTIndex(retentionTimes, peakRow[5]);

        // Partition into sections bounded by null data points, creating
        // a peak for each.
        for (int start = peakLeft; start < peakRight; start++) {

          if (chromatogram.getDataPoint(scanNumbers[start]) != null) {

            int end = start;
            while (end < peakRight
                && chromatogram
                    .getDataPoint(scanNumbers[end + 1]) != null) {

              end++;
            }

            if (peakDuration.contains(retentionTimes[end]
                - retentionTimes[start])) {

              resolvedPeaks.add(new ResolvedPeak(chromatogram,
                  start, end));
            }
View Full Code Here

      return;
    String minText = minNodes.item(0).getTextContent();
    String maxText = maxNodes.item(0).getTextContent();
    double min = Double.valueOf(minText);
    double max = Double.valueOf(maxText);
    value = new Range(min, max);
  }
View Full Code Here

   * non-zero charge.
   */
  public String[] findCompounds(double mass, MZTolerance mzTolerance,
      int numOfResults, ParameterSet parameters) throws IOException {

    Range toleranceRange = mzTolerance.getToleranceRange(mass);

    StringBuilder pubchemUrl = new StringBuilder();

    pubchemUrl
        .append("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?usehistory=n&db=pccompound&sort=cida&retmax=");
    pubchemUrl.append(numOfResults);
    pubchemUrl.append("&term=");
    pubchemUrl.append(toleranceRange.getMin());
    pubchemUrl.append(":");
    pubchemUrl.append(toleranceRange.getMax());
    pubchemUrl.append("[MonoisotopicMass]");

    NodeList cidElements;

    try {
View Full Code Here

  private static final String hmdbEntryAddress = "http://www.hmdb.ca/metabolites/";

  public String[] findCompounds(double mass, MZTolerance mzTolerance,
      int numOfResults, ParameterSet parameters) throws IOException {

    Range toleranceRange = mzTolerance.getToleranceRange(mass);

    String queryAddress = hmdbSeachAddress + "&query_from="
        + toleranceRange.getMin() + "&query_to="
        + toleranceRange.getMax();

    URL queryURL = new URL(queryAddress);

    // Submit the query
    String queryResult = InetUtils.retrieveData(queryURL);
View Full Code Here

   *            Intensity values to set
   */
  public void setDataPoints(DataPoint[] dataPoints) {

    this.dataPoints = dataPoints;
    mzRange = new Range(0, 0);
    basePeak = null;
    totalIonCurrent = 0;

    // find m/z range and base peak
    if (dataPoints.length > 0) {

      basePeak = dataPoints[0];
      mzRange = new Range(dataPoints[0].getMZ(), dataPoints[0].getMZ());

      for (DataPoint dp : dataPoints) {

        if (dp.getIntensity() > basePeak.getIntensity())
          basePeak = dp;
View Full Code Here

TOP

Related Classes of net.sf.mzmine.util.Range

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.