Search in sources :

Example 1 with IonizationType

use of net.sf.mzmine.datamodel.IonizationType in project mzmine2 by mzmine.

the class MzRangeFormulaCalculatorModule method getMzRangeFromFormula.

@Nullable
public static Range<Double> getMzRangeFromFormula(ParameterSet myParameters) {
    String formula = myParameters.getParameter(MzRangeFormulaCalculatorParameters.formula).getValue().trim();
    IonizationType ionType = myParameters.getParameter(MzRangeFormulaCalculatorParameters.ionType).getValue();
    MZTolerance mzTolerance = myParameters.getParameter(MzRangeFormulaCalculatorParameters.mzTolerance).getValue();
    Integer charge = myParameters.getParameter(MzRangeFormulaCalculatorParameters.charge).getValue();
    return getMzRangeFromFormula(formula, ionType, mzTolerance, charge);
}
Also used : MZTolerance(net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance) IonizationType(net.sf.mzmine.datamodel.IonizationType) Nullable(javax.annotation.Nullable)

Example 2 with IonizationType

use of net.sf.mzmine.datamodel.IonizationType in project mzmine2 by mzmine.

the class NeutralMassComponent method updateNeutralMass.

private void updateNeutralMass() {
    Integer charge = getCharge();
    if (charge == null)
        return;
    Double ionMass = getIonMass();
    if (ionMass == null)
        return;
    IonizationType ionType = getIonType();
    double neutral = (ionMass.doubleValue() - ionType.getAddedMass()) * charge.intValue();
    neutralMassField.setText(MZmineCore.getConfiguration().getMZFormat().format(neutral));
}
Also used : IonizationType(net.sf.mzmine.datamodel.IonizationType)

Aggregations

IonizationType (net.sf.mzmine.datamodel.IonizationType)2 Nullable (javax.annotation.Nullable)1 MZTolerance (net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance)1