Package net.sf.mzmine.parameters.parametertypes

Examples of net.sf.mzmine.parameters.parametertypes.MZTolerance


        FormulaPredictionParameters.neutralMass).getValue();
    charge = parameters.getParameter(
        FormulaPredictionParameters.neutralMass).getCharge();
    ionType = parameters.getParameter(
        FormulaPredictionParameters.neutralMass).getIonType();
    MZTolerance mzTolerance = parameters.getParameter(
        FormulaPredictionParameters.mzTolerance).getValue();

    checkIsotopes = parameters.getParameter(
        FormulaPredictionParameters.isotopeFilter).getValue();
    isotopeParameters = parameters.getParameter(
        FormulaPredictionParameters.isotopeFilter)
        .getEmbeddedParameters();

    checkMSMS = parameters.getParameter(
        FormulaPredictionParameters.msmsFilter).getValue();
    msmsParameters = parameters.getParameter(
        FormulaPredictionParameters.msmsFilter).getEmbeddedParameters();

    checkRDBE = parameters.getParameter(
        FormulaPredictionParameters.rdbeRestrictions).getValue();
    rdbeParameters = parameters.getParameter(
        FormulaPredictionParameters.rdbeRestrictions)
        .getEmbeddedParameters();

    checkRatios = parameters.getParameter(
        FormulaPredictionParameters.elementalRatios).getValue();
    ratiosParameters = parameters.getParameter(
        FormulaPredictionParameters.elementalRatios)
        .getEmbeddedParameters();

    Set<ElementRule> rulesSet = new HashSet<ElementRule>();

    massRange = mzTolerance.getToleranceRange(searchedMass);

    String elements = parameters.getParameter(
        FormulaPredictionParameters.elements).getValue();

    String elementsArray[] = elements.split(",");
View Full Code Here


   * Returns a calculated similarity score of
   */
  public static MSMSScore evaluateMSMS(IMolecularFormula parentFormula,
      Scan msmsScan, ParameterSet parameters) {

    MZTolerance msmsTolerance = parameters.getParameter(
        MSMSScoreParameters.msmsTolerance).getValue();
    String massListName = parameters.getParameter(
        MSMSScoreParameters.massList).getValue();

    MassList massList = msmsScan.getMassList(massListName);

    if (massList == null) {
      throw new IllegalArgumentException("Scan #"
          + msmsScan.getScanNumber()
          + " does not have a mass list called '" + massListName
          + "'");
    }

    DataPoint msmsIons[] = massList.getDataPoints();

    if (msmsIons == null) {
      throw new IllegalArgumentException("Mass list " + massList
          + " does not contain data for scan #"
          + msmsScan.getScanNumber());
    }
    // Sorted by mass in descending order
    ArrayList<ElementRule> rulesSet = new ArrayList<ElementRule>();
    for (IIsotope isotope : parentFormula.isotopes()) {
      ElementRule rule = new ElementRule(isotope.getSymbol(), 0,
          parentFormula.getIsotopeCount(isotope));
      rulesSet.add(rule);
    }
    ElementRule msmsElementRules[] = rulesSet.toArray(new ElementRule[0]);

    int totalMSMSpeaks = 0, interpretedMSMSpeaks = 0;
    Map<DataPoint, String> msmsAnnotations = new Hashtable<DataPoint, String>();

    msmsCycle : for (DataPoint dp : msmsIons) {

      // Check if this is an isotope
      Range isotopeCheckRange = new Range(dp.getMZ() - 1.4,
          dp.getMZ() - 0.6);
      for (DataPoint dpCheck : msmsIons) {
        // If we have any MS/MS peak with 1 neutron mass smaller m/z
        // and higher intensity, it means the current peak is an
        // isotope and we should ignore it
        if (isotopeCheckRange.contains(dpCheck.getMZ())
            && (dpCheck.getIntensity() > dp.getIntensity())) {
          continue msmsCycle;
        }
      }

      // We don't know the charge of the fragment, so we will simply
      // assume 1
      double neutralLoss = msmsScan.getPrecursorMZ()
          * msmsScan.getPrecursorCharge() - dp.getMZ();

      // Ignore negative neutral losses and parent ion, <5 may be a
      // good threshold
      if (neutralLoss < 5)
        continue;

      Range msmsTargetRange = msmsTolerance
          .getToleranceRange(neutralLoss);

      FormulaGenerator msmsEngine = new FormulaGenerator(msmsTargetRange,
          msmsElementRules);

View Full Code Here

    Vector<AlignStructMol> alignMol = new Vector<AlignStructMol>();

    for (PeakListRow row : peakListX.getRows()) {

      // Calculate limits for a row with which the row can be aligned
      MZTolerance mzTolerance = super.parameterSet.getParameter(
          RansacAlignerParameters.MZTolerance).getValue();
      RTTolerance rtTolerance = super.parameterSet.getParameter(
          RansacAlignerParameters.RTToleranceBefore).getValue();
      Range mzRange = mzTolerance.getToleranceRange(row.getAverageMZ());
      Range rtRange = rtTolerance.getToleranceRange(row.getAverageRT());

      // Get all rows of the aligned peaklist within parameter limits
      PeakListRow candidateRows[] = peakListY
          .getRowsInsideScanAndMZRange(rtRange, mzRange);
View Full Code Here

    String formula = myParameters.getParameter(
        MzRangeCalculatorParameters.formula).getValue();
    IonizationType ionType = myParameters.getParameter(
        MzRangeCalculatorParameters.ionType).getValue();
    MZTolerance mzTolerance = myParameters.getParameter(
        MzRangeCalculatorParameters.mzTolerance).getValue();
    Integer charge = myParameters.getParameter(
        MzRangeCalculatorParameters.charge).getValue();

    if ((formula == null) || (ionType == null) || (mzTolerance == null)
        || (charge == null))
      return null;

    String ionizedFormula = FormulaUtils.ionizeFormula(formula, ionType,
        charge);
    double calculatedMZ = FormulaUtils.calculateExactMass(ionizedFormula,
        charge) / charge;

    Range mzRange = mzTolerance.getToleranceRange(calculatedMZ);

    return mzRange;
  }
View Full Code Here

      IsotopePattern ip2, ParameterSet parameters) {

    assert ip1 != null;
    assert ip2 != null;

    MZTolerance mzTolerance = parameters.getParameter(
        IsotopePatternScoreParameters.mzTolerance).getValue();

    assert mzTolerance != null;

    final double patternIntensity = Math.max(ip1.getHighestIsotope()
        .getIntensity(), ip2.getHighestIsotope().getIntensity());
    final double noiseIntensity = parameters.getParameter(
        IsotopePatternScoreParameters.isotopeNoiseLevel).getValue();

    // Normalize the isotopes to intensity 0..1
    IsotopePattern nip1 = IsotopePatternCalculator
        .normalizeIsotopePattern(ip1);
    IsotopePattern nip2 = IsotopePatternCalculator
        .normalizeIsotopePattern(ip2);

    // Merge the data points from both isotope patterns into a single array.
    // Data points from first pattern will have positive intensities, data
    // points from second pattern will have negative intensities.
    ArrayList<DataPoint> mergedDataPoints = new ArrayList<DataPoint>();
    for (DataPoint dp : nip1.getDataPoints()) {
      if (dp.getIntensity() * patternIntensity < noiseIntensity)
        continue;
      mergedDataPoints.add(dp);
    }
    for (DataPoint dp : nip2.getDataPoints()) {
      if (dp.getIntensity() * patternIntensity < noiseIntensity)
        continue;
      DataPoint negativeDP = new SimpleDataPoint(dp.getMZ(),
          dp.getIntensity() * -1);
      mergedDataPoints.add(negativeDP);
    }
    DataPoint mergedDPArray[] = mergedDataPoints.toArray(new DataPoint[0]);

    // Sort the merged data points by m/z
    Arrays.sort(mergedDPArray, new DataPointSorter(SortingProperty.MZ,
        SortingDirection.Ascending));

    // Iterate the merged data points and sum all isotopes within m/z
    // tolerance
    for (int i = 0; i < mergedDPArray.length - 1; i++) {

      Range toleranceRange = mzTolerance
          .getToleranceRange(mergedDPArray[i].getMZ());

      if (!toleranceRange.contains(mergedDPArray[i + 1].getMZ()))
        continue;

View Full Code Here

TOP

Related Classes of net.sf.mzmine.parameters.parametertypes.MZTolerance

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.