Get isotope based on element symbol and mass number.

@param symbol the element symbol
@param massNumber the mass number
@return the corresponding isotope
547544
public IIsotope getIsotope(String symbol, int massNumber) {
        int elem = Elements.ofString(symbol).number();
        List<IIsotope> isotopes = this.isotopes[elem];
        if (isotopes == null)
            return null;
        for (IIsotope isotope : isotopes) {
            if (isotope.getSymbol().equals(symbol) && isotope.getMassNumber() == massNumber) {
                return clone(isotope);
            }
        }
        return null;
    }
1000879
public IAtom configure(IAtom atom, IIsotope isotope) {
        atom.setMassNumber(isotope.getMassNumber());
        atom.setSymbol(isotope.getSymbol());
        atom.setExactMass(isotope.getExactMass());
        atom.setAtomicNumber(isotope.getAtomicNumber());
        atom.setNaturalAbundance(isotope.getNaturalAbundance());
        return atom;
    }
482253
public double getAtomicSoftnessCore(IAtomContainer ac, int atomPosition) throws CDKException {
        if (factory == null) {
            factory = AtomTypeFactory
                    .getInstance("org/openscience/cdk/config/data/jmol_atomtypes.txt", ac.getBuilder());
        }
        IAtom target = null;
        double core = 0;
        double radiusTarget = 0;
        target = ac.getAtom(atomPosition);
        double partial = 0;
        double radius = 0;
        String symbol = null;
        IAtomType type = null;
        try {
            symbol = ac.getAtom(atomPosition).getSymbol();
            type = factory.getAtomType(symbol);
            if (getCovalentRadius(symbol, ac.getMaximumBondOrder(target)) > 0) {
                radiusTarget = getCovalentRadius(symbol, ac.getMaximumBondOrder(target));
            } else {
                radiusTarget = type.getCovalentRadius();
            }

        } catch (Exception ex1) {
            logger.debug(ex1);
            throw new CDKException("Problems with AtomTypeFactory due to " + ex1.getMessage(), ex1);
        }

        Iterator<IAtom> atoms = ac.atoms().iterator();
        while (atoms.hasNext()) {
            IAtom atom = atoms.next();
            if (!target.equals(atom)) {
                symbol = atom.getSymbol();
                partial = 0;
                try {
                    type = factory.getAtomType(symbol);
                } catch (Exception ex1) {
                    logger.debug(ex1);
                    throw new CDKException("Problems with AtomTypeFactory due to " + ex1.getMessage(), ex1);
                }
                if (getCovalentRadius(symbol, ac.getMaximumBondOrder(atom)) > 0) {
                    radius = getCovalentRadius(symbol, ac.getMaximumBondOrder(atom));
                } else {
                    radius = type.getCovalentRadius();
                }
                partial += radius * radius;
                partial += (radiusTarget * radiusTarget);
                partial = partial / (calculateSquaredDistanceBetweenTwoAtoms(target, atom));
                core += partial;
            }
        }
        core = 2 * core;
        core = 0.172 * core;
        return core;
    }
255486
def __update_molar_mass(self, compound='', element=''):
        
        _molar_mass_element = 0
        list_ratio = self.stack[compound][element]['isotopes']['isotopic_ratio']
        list_mass = self.stack[compound][element]['isotopes']['mass']['value']
        ratio_mass = zip(list_ratio, list_mass)
        for _ratio, _mass in ratio_mass:
            _molar_mass_element += np.float(_ratio) * np.float(_mass)
        self.stack[compound][element]['molar_mass']['value'] = _molar_mass_element
500496
public static MarkedElement markupAtom(IRenderingElement elem, IAtom atom) {
        if (elem == null)
            return null;
        MarkedElement tagElem = markupChemObj(elem, atom);
        tagElem.aggClass("atom");
        return tagElem;
    }
536335
public static Symbol symbol(Object o) {
        if (o instanceof Symbol)
            return (Symbol) o;
        else if (o instanceof String) {
            String s = (String) o;
            if (s.charAt(0) == ':')
                return new SymbolImpl(s.substring(1));
            else
                return new SymbolImpl(s);
        }
        else throw new IllegalArgumentException("Cannot make symbol from " + o.getClass().getSimpleName());
    }
478480
public AnalyticProductInterface getCalibrationProductForSymbol(String symbol) {

		/*
		 * The internal data structure is not optimal here (a map would make more sense here),
		 * if the user does not require access to the products, we would allow non-unique symbols.
		 * Hence we store both in two side by side vectors.
		 */
		for(int i=0; i<calibrationProductsSymbols.size(); i++) {
			String calibrationProductSymbol = calibrationProductsSymbols.get(i);
			if(calibrationProductSymbol.equals(symbol)) {
				return calibrationProducts.get(i);
			}
		}

		return null;
	}
299621
@DefinedBy(Api.COMPILER)
    public long getLineNumber() {
        if (sourcePosition == null) {
            sourcePosition = new SourcePosition();
        }
        return sourcePosition.getLineNumber();
    }
1067370
private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) {
        IMolecularFormulaSet solutions_new = null;

        if (formulaSet.size() != 0) {

            double valueMin = 100;
            int i_final = 0;
            solutions_new = formulaSet.getBuilder().newInstance(IMolecularFormulaSet.class);
            List<Integer> listI = new ArrayList<Integer>();
            for (int j = 0; j < formulaSet.size(); j++) {
                for (int i = 0; i < formulaSet.size(); i++) {
                    if (listI.contains(i)) continue;

                    double value = MolecularFormulaManipulator.getTotalExactMass(formulaSet.getMolecularFormula(i));
                    double diff = Math.abs(mass - Math.abs(value));
                    if (valueMin > diff) {
                        valueMin = diff;
                        i_final = i;
                    }

                }
                valueMin = 100;
                solutions_new.addMolecularFormula(formulaSet.getMolecularFormula(i_final));
                listI.add(i_final);
            }
        }

        return solutions_new;
    }
991329
private List<IIsotope> orderList(List<IIsotope> isotopes_TO) {
        List<IIsotope> newOrderList = new ArrayList<IIsotope>();
        for (int i = 0; i < orderElements.length; i++) {
            String symbol = orderElements[i];
            Iterator<IIsotope> itIso = isotopes_TO.iterator();
            while (itIso.hasNext()) {
                IIsotope isotopeToCo = itIso.next();
                if (isotopeToCo.getSymbol().equals(symbol)) {
                    newOrderList.add(isotopeToCo);
                }
            }
        }
        return newOrderList;
    }
49516
public static IsotopePattern sortAndNormalizedByIntensity(IsotopePattern isotopeP) {
        IsotopePattern isoNorma = normalize(isotopeP);
        return sortByIntensity(isoNorma);
    }
1046732
public List<IIsotope> readIsotopes() {
        List<IIsotope> isotopes = new ArrayList<IIsotope>();
        try {
            parser.setFeature("http://xml.org/sax/features/validation", false);
            logger.info("Deactivated validation");
        } catch (SAXException exception) {
            logger.warn("Cannot deactivate validation: ", exception.getMessage());
            logger.debug(exception);
        }
        IsotopeHandler handler = new IsotopeHandler(builder);
        parser.setContentHandler(handler);
        try {
            parser.parse(new InputSource(input));
            isotopes = handler.getIsotopes();
        } catch (IOException exception) {
            logger.error("IOException: ", exception.getMessage());
            logger.debug(exception);
        } catch (SAXException saxe) {
            logger.error("SAXException: ", saxe.getClass().getName());
            logger.error(saxe.getMessage());
            logger.debug(saxe);
        }
        return isotopes;
    }
288154
public static ClassSymbol outermostClass(Symbol symbol) {
    ClassSymbol curr = symbol.enclClass();
    while (curr.owner != null) {
      ClassSymbol encl = curr.owner.enclClass();
      if (encl == null) {
        break;
      }
      curr = encl;
    }
    return curr;
  }
749284
public static ImmutableSet<String> getGeneratedBy(ClassSymbol symbol, VisitorState state) {
    checkNotNull(symbol);
    Optional<Compound> c =
        Stream.of("javax.annotation.Generated", "javax.annotation.processing.Generated")
            .map(state::getSymbolFromString)
            .filter(a -> a != null)
            .map(symbol::attribute)
            .filter(a -> a != null)
            .findFirst();
    if (!c.isPresent()) {
      return ImmutableSet.of();
    }
    Optional<Attribute> values =
        c.get().getElementValues().entrySet().stream()
            .filter(e -> e.getKey().getSimpleName().contentEquals("value"))
            .map(e -> e.getValue())
            .findAny();
    if (!values.isPresent()) {
      return ImmutableSet.of();
    }
    ImmutableSet.Builder<String> suppressions = ImmutableSet.builder();
    values
        .get()
        .accept(
            new SimpleAnnotationValueVisitor8<Void, Void>() {
              @Override
              public Void visitString(String s, Void aVoid) {
                suppressions.add(s);
                return super.visitString(s, aVoid);
              }

              @Override
              public Void visitArray(List<? extends AnnotationValue> vals, Void aVoid) {
                vals.stream().forEachOrdered(v -> v.accept(this, null));
                return super.visitArray(vals, aVoid);
              }
            },
            null);
    return suppressions.build();
  }
425047
public static String getDescription(String symbol)
    {
        CharInfo info = (CharInfo) fSymbolMap.get(symbol);
        return (info != null) ? info.fDescription : null;
    }
469138
private IIsotope getIsotope(IIsotope isotope) {
        for (Iterator<IIsotope> it = isotopes().iterator(); it.hasNext();) {
            IIsotope thisIsotope = it.next();
            if (isTheSame(isotope, thisIsotope)) return thisIsotope;
        }
        return null;
    }
1177943
@Override
    public Iterable<IIsotope> isotopes() {
        return new Iterable<IIsotope>() {

            @Override
            public Iterator<IIsotope> iterator() {
                return isotopesList().iterator();
            }
        };
    }