Class NMRCalculator

java.lang.Object
chemaxon.calculator.ProgressableCalculator<Molecule,NMRSpectrum>
chemaxon.calculations.nmr.NMRCalculator
All Implemented Interfaces:
chemaxon.calculator.Calculator<Molecule,NMRSpectrum>, TaggedCalculator, chemaxon.license.Licensable

@PublicAPI public class NMRCalculator extends chemaxon.calculator.ProgressableCalculator<Molecule,NMRSpectrum>
Class for NMR spectrum calculation.

API example for 1H NMR:

    // input molecule for 1H NMR prediction
    Molecule mol = MolImporter.importMol("c1c(Cl)cccc1C=O");
    // instantiate builder
    NMRCalculator.Builder builder = new NMRCalculator.Builder();
    // settings
    builder.setFrequency(400.0);
    builder.setUnit(NMRSpectrum.Unit.Hz);
    builder.setNucleus(NMRSpectrum.Nucleus.H1);
    builder.setCoupled(true);
    // instantiate calculator
    NMRCalculator nmrCalc = builder.build();
    // spectrum calculation
    NMRSpectrum spectrum = nmrCalc.calculate(mol);
    // explicit hydrogen mode
    spectrum.setImplicitHydrogenMode(false);
    // multiplets of the NMR spectrum
    Multiplet[] multiplets = spectrum.getMultiplets();
    for (Multiplet m: multiplets) {
        System.out.println(m.getShift()+"\t"+m.getNetIntensity());
        for (int i=0; i < m.getNumberOfLines(); i++) {
              System.out.println(m.getPosition(i)+"\t"+m.getIntensity(i));
                }
            }
    // exporting the NMR spectrum into JCAMP-DX format
    String jcamp = NMRExporter.exportToJcampDX(spectrum);
    // exporting the NMR spectrum into Molecule with an NMR property
    String propertyName = "1H NMR shifts";
    Molecule molWithNMR = NMRExporter.exportToMol(spectrum, propertyName);

 
API example for 1H NMR:
    // input molecule for 13C NMR prediction
    Molecule mol = MolImporter.importMol("c1c(Cl)cccc1C=O");
    // instantiate NMRCalculator, the default settings are used
    NMRCalculator nmrCalc = new NMRCalculator.Builder().build();
    // spectrum calculation
    NMRSpectrum spectrum = nmrCalc.calculate(mol);
    // chemical shifts with atom indexes
    Shift[] shifts = spectrum.getShifts();
    for (Shift s: shifts) {
        System.out.println(s.getAtomIndex()+"\t"+s.getShift());
    }
    // sampling the NMR spectrum and integrated NMR spectrum functions
    double domainMin = spectrum.getDomainMin();
    double domainMax = spectrum.getDomainMax();
    double resolution = 0.1;
    for (double x = domainMin; x <= domainMax; x += resolution) {
        System.out.println(x+"\t"+spectrum.getValueAt(x)+"\t"+spectrum.getIntegralValueAt(x));
    }
    // or exporting the x and y values of the NMR spectrum function directly
    double[][] xy = NMRExporter.export(spectrum, domainMin, domainMax, resolution);
 
Since:
5.8
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder class for NMRCalculator.

    Nested classes/interfaces inherited from class chemaxon.calculator.ProgressableCalculator

    chemaxon.calculator.ProgressableCalculator.CalculatorMProgressMonitor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the 13C chemical shift atom property.
    static final String
    Name of the 1H chemical shift atom property.

    Fields inherited from class chemaxon.calculator.ProgressableCalculator

    cancelled, licenseEnvironment, PROGRESS, running, RUNNING
  • Method Summary

    Modifier and Type
    Method
    Description
    Calculates NMR spectrum for the given input molecule.
     
    chemaxon.calculator.CalculatorFormatter
     
    double
    Returns NMR measurement frequency.
    Returns the NMR active nucleus.
     
    Returns NMR spectrum unit.
    boolean
    Coupled/decoupled spectrum.
    Returns the set of tags reported by this calculator.

    Methods inherited from class chemaxon.calculator.ProgressableCalculator

    addPropertyChangeListener, addPropertyChangeListener, cancel, cancelCalculation, checkData, checkLicense, finishCalculation, getErrorMessage, isCancelled, isLicensed, isRunning, removePropertyChangeListener, removePropertyChangeListener, sendProgress, setLicenseEnvironment, startCalculation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • C_SHIFT_PROP_NAME

      public static final String C_SHIFT_PROP_NAME
      Name of the 13C chemical shift atom property.
      See Also:
    • H_SHIFT_PROP_NAME

      public static final String H_SHIFT_PROP_NAME
      Name of the 1H chemical shift atom property.
      See Also:
  • Method Details

    • getNucleus

      public NMRSpectrum.Nucleus getNucleus()
      Returns the NMR active nucleus. NMRSpectrum.Nucleus.C13.
      Returns:
      NMRSpectrum.Nucleus.C13 or NMRSpectrum.Nucleus.H1
    • getUnit

      public NMRSpectrum.Unit getUnit()
      Returns NMR spectrum unit. Default value is NMRSpectrum.Unit.ppm
      Returns:
      NMRSpectrum.Unit.ppm or NMRSpectrum.Unit.Hz
    • isCoupled

      public boolean isCoupled()
      Coupled/decoupled spectrum. Default value is true.
      Returns:
      True if spectrum is coupled, false otherwise.
    • getFrequency

      public double getFrequency()
      Returns NMR measurement frequency. Default value is 500 MHz.
      Returns:
      NMR frequency in MHz.
    • calculate

      public NMRSpectrum calculate(Molecule data) throws LicenseException
      Calculates NMR spectrum for the given input molecule.
      Returns:
      Calculated NMR spectrum.
      Throws:
      LicenseException
    • getFormatter

      public chemaxon.calculator.CalculatorFormatter getFormatter()
    • check

      public List<CalculatorError> check(Molecule data)
    • getProductName

      public String getProductName()
      Specified by:
      getProductName in class chemaxon.calculator.ProgressableCalculator<Molecule,NMRSpectrum>
    • tags

      public Set<CalculatorTag> tags()
      Description copied from interface: TaggedCalculator
      Returns the set of tags reported by this calculator. The same tags should be returned unless the calculator is modified using a mutator method, e.g. if some settings are changed.

      New tags can be introduced and reported in the future by existing calculators, so do not depend on the exact set of reported tags, only check for the presence of certain tags.

      Returns:
      the tags