Package org.openscience.cdk.config
Class IsotopeFactory
java.lang.Object
org.openscience.cdk.config.IsotopeFactory
- Direct Known Subclasses:
Isotopes
,XMLIsotopeFactory
Used to store and return data of a particular isotope. The classes
Isotopes
extends this class and is to be used to get isotope
information.- Author:
- steinbeck
- Source code:
- main
- Belongs to CDK module:
- core
- Created on:
- 2001-08-29
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Protected methods only to be used by classes extending this class to add an IIsotope.Configures an atom.Configures an atom to have all the data of the given isotope.void
configureAtoms
(IAtomContainer container) Configures atoms in an AtomContainer to carry all the correct data according to their element type.getElement
(int atomicNumber) Returns an element according to a given atomic number.getElement
(String symbol) Returns an Element with a given element symbol.getElementSymbol
(int atomicNumber) Returns the symbol matching the element with the given atomic number.double
getExactMass
(Integer atomicNumber, Integer massNumber) Get the exact mass of a specified isotope for an atom.getIsotope
(String symbol, double exactMass, double tolerance) Get an isotope based on the element symbol and exact mass.getIsotope
(String symbol, int massNumber) Get isotope based on element symbol and mass number.IIsotope[]
Gets a array of all isotopes known to the IsotopeFactory.IIsotope[]
getIsotopes
(double exactMass, double difference) Gets an array of all isotopes matching the searched exact mass within a certain difference.IIsotope[]
getIsotopes
(int elem) Gets an array of all isotopes known to the IsotopeFactory for the given element symbol.IIsotope[]
getIsotopes
(String symbol) Gets an array of all isotopes known to the IsotopeFactory for the given element symbol.getMajorIsotope
(int elem) Returns the most abundant (major) isotope with a given atomic number.getMajorIsotope
(String symbol) Returns the most abundant (major) isotope whose symbol equals element.double
getMajorIsotopeMass
(int elem) Get the mass of the most abundant (major) isotope, if there is no major isotopes 2*elem is returned.double
getNaturalMass
(int atomicNum) Gets the natural mass of this element, defined as average of masses of isotopes, weighted by abundance.double
getNaturalMass
(IElement element) Gets the natural mass of this element, defined as average of masses of isotopes, weighted by abundance.int
getSize()
Returns the number of isotopes defined by this class.boolean
Checks whether the given element exists.
-
Field Details
-
EMPTY_ISOTOPE_ARRAY
-
logger
-
-
Constructor Details
-
IsotopeFactory
public IsotopeFactory()
-
-
Method Details
-
getSize
public int getSize()Returns the number of isotopes defined by this class.- Returns:
- The size value
-
add
Protected methods only to be used by classes extending this class to add an IIsotope. -
getIsotopes
Gets an array of all isotopes known to the IsotopeFactory for the given element symbol.- Parameters:
elem
- atomic number- Returns:
- An array of isotopes that matches the given element symbol
-
getIsotopes
Gets an array of all isotopes known to the IsotopeFactory for the given element symbol.- Parameters:
symbol
- An element symbol to search for- Returns:
- An array of isotopes that matches the given element symbol
-
getIsotopes
Gets a array of all isotopes known to the IsotopeFactory.- Returns:
- An array of all isotopes
-
getIsotopes
Gets an array of all isotopes matching the searched exact mass within a certain difference.- Parameters:
exactMass
- search massdifference
- mass the isotope is allowed to differ from the search mass- Returns:
- An array of all isotopes
-
getIsotope
Get isotope based on element symbol and mass number.- Parameters:
symbol
- the element symbolmassNumber
- the mass number- Returns:
- the corresponding isotope
-
getIsotope
Get an isotope based on the element symbol and exact mass.- Parameters:
symbol
- the element symbolexactMass
- the mass numbertolerance
- allowed difference from provided exact mass- Returns:
- the corresponding isotope
-
getMajorIsotope
Returns the most abundant (major) isotope with a given atomic number. Note that some high mass elements do not have a major isotopes (0% abundance) and this method will return null for those.- Parameters:
elem
- The atomicNumber for which an isotope is to be returned- Returns:
- The isotope corresponding to the given atomic number
- See Also:
-
getMajorIsotopeMass
public double getMajorIsotopeMass(int elem) Get the mass of the most abundant (major) isotope, if there is no major isotopes 2*elem is returned.- Parameters:
elem
- the atomic number- Returns:
- the major isotope mass
-
getExactMass
Get the exact mass of a specified isotope for an atom. If there is no isotope with that mass number then it is returned.- Parameters:
atomicNumber
- atomic numbermassNumber
- the mass number- Returns:
- the exact mass
-
isElement
Checks whether the given element exists.- Parameters:
elementName
- The element name to test- Returns:
- True is the element exists, false otherwise
-
getMajorIsotope
Returns the most abundant (major) isotope whose symbol equals element.- Parameters:
symbol
- the symbol of the element in question- Returns:
- The Major Isotope value
-
getElement
Returns an Element with a given element symbol.- Parameters:
symbol
- The element symbol for the requested element- Returns:
- The configured element
-
getElement
Returns an element according to a given atomic number.- Parameters:
atomicNumber
- The elements atomic number- Returns:
- The Element
-
getElementSymbol
Returns the symbol matching the element with the given atomic number.- Parameters:
atomicNumber
- The elements atomic number- Returns:
- The symbol of the Element
-
configure
Configures an atom. Finds the correct element type by looking at the atoms element symbol. If the element symbol is not recognised, it will throw anIllegalArgumentException
.- Parameters:
atom
- The atom to be configured- Returns:
- The configured atom
-
configure
Configures an atom to have all the data of the given isotope.- Parameters:
atom
- The atom to be configureisotope
- The isotope to read the data from- Returns:
- The configured atom
-
configureAtoms
Configures atoms in an AtomContainer to carry all the correct data according to their element type.- Parameters:
container
- The AtomContainer to be configured
-
getNaturalMass
public double getNaturalMass(int atomicNum) Gets the natural mass of this element, defined as average of masses of isotopes, weighted by abundance.- Parameters:
atomicNum
- the element in question- Returns:
- The natural mass value
-
getNaturalMass
Gets the natural mass of this element, defined as average of masses of isotopes, weighted by abundance.- Parameters:
element
- the element in question- Returns:
- The natural mass value
-