@Test public void testSetCovalentRadius_Double() { IAtomType at = (IAtomType) newChemObject(); at.setCovalentRadius(1.0); Assert.assertEquals(1.0, at.getCovalentRadius(), 0.001); }
radiusTarget = getCovalentRadius(symbol, ac.getMaximumBondOrder(target)); } else { radiusTarget = type.getCovalentRadius(); radius = getCovalentRadius(symbol, ac.getMaximumBondOrder(atom)); } else { radius = type.getCovalentRadius();
radiusTarget = getCovalentRadius(symbol, ac.getMaximumBondOrder(target)); } else { radiusTarget = type.getCovalentRadius(); radius = getCovalentRadius(symbol, ac.getMaximumBondOrder(atom)); } else { radius = type.getCovalentRadius();
/** * Constructs an isotope by copying the symbol, atomic number, * flags, identifier, exact mass, natural abundance and mass * number from the given IIsotope. It does not copy the * listeners and properties. If the element is an instance of * IAtomType, then the maximum bond order, bond order sum, * van der Waals and covalent radii, formal charge, hybridization, * electron valency, formal neighbour count and atom type name * are copied too. * * @param element IIsotope to copy information from */ public AtomType(IElement element) { super(element); if (element instanceof IAtomType) { this.maxBondOrder = ((IAtomType) element).getMaxBondOrder(); this.bondOrderSum = ((IAtomType) element).getBondOrderSum(); this.covalentRadius = ((IAtomType) element).getCovalentRadius(); this.formalCharge = ((IAtomType) element).getFormalCharge(); this.hybridization = ((IAtomType) element).getHybridization(); this.electronValency = ((IAtomType) element).getValency(); this.formalNeighbourCount = ((IAtomType) element).getFormalNeighbourCount(); this.identifier = ((IAtomType) element).getAtomTypeName(); } }
/** * Constructs an isotope by copying the symbol, atomic number, * flags, identifier, exact mass, natural abundance and mass * number from the given IIsotope. It does not copy the * listeners and properties. If the element is an instanceof * IAtomType, then the maximum bond order, bond order sum, * van der Waals and covalent radii, formal charge, hybridization, * electron valency, formal neighbour count and atom type name * are copied too. * * @param element IIsotope to copy information from */ public AtomType(IElement element) { super(element); if (element instanceof IAtomType) { this.maxBondOrder = ((IAtomType) element).getMaxBondOrder(); this.bondOrderSum = ((IAtomType) element).getBondOrderSum(); this.covalentRadius = ((IAtomType) element).getCovalentRadius(); this.formalCharge = ((IAtomType) element).getFormalCharge(); this.hybridization = ((IAtomType) element).getHybridization(); this.electronValency = ((IAtomType) element).getValency(); this.formalNeighbourCount = ((IAtomType) element).getFormalNeighbourCount(); this.identifier = ((IAtomType) element).getAtomTypeName(); } }
/** * Constructs an isotope by copying the symbol, atomic number, * flags, identifier, exact mass, natural abundance and mass * number from the given IIsotope. It does not copy the * listeners and properties. If the element is an instance of * IAtomType, then the maximum bond order, bond order sum, * van der Waals and covalent radii, formal charge, hybridization, * electron valency, formal neighbour count and atom type name * are copied too. * * @param element IIsotope to copy information from */ public AtomType(IElement element) { super(element); if (element instanceof IAtomType) { this.maxBondOrder = ((IAtomType) element).getMaxBondOrder(); this.bondOrderSum = ((IAtomType) element).getBondOrderSum(); this.covalentRadius = ((IAtomType) element).getCovalentRadius(); this.formalCharge = ((IAtomType) element).getFormalCharge(); this.hybridization = ((IAtomType) element).getHybridization(); this.electronValency = ((IAtomType) element).getValency(); this.formalNeighbourCount = ((IAtomType) element).getFormalNeighbourCount(); this.identifier = ((IAtomType) element).getAtomTypeName(); } }
/** * Constructs an isotope by copying the symbol, atomic number, * flags, identifier, exact mass, natural abundance and mass * number from the given IIsotope. It does not copy the * listeners and properties. If the element is an instanceof * IAtomType, then the maximum bond order, bond order sum, * van der Waals and covalent radii, formal charge, hybridization, * electron valency, formal neighbour count and atom type name * are copied too. * * @param element IIsotope to copy information from */ public AtomType(IElement element) { super(element); if (element instanceof IAtomType) { this.maxBondOrder = ((IAtomType) element).getMaxBondOrder(); this.bondOrderSum = ((IAtomType) element).getBondOrderSum(); this.covalentRadius = ((IAtomType) element).getCovalentRadius(); this.formalCharge = ((IAtomType) element).getFormalCharge(); this.hybridization = ((IAtomType) element).getHybridization(); this.electronValency = ((IAtomType) element).getValency(); this.formalNeighbourCount = ((IAtomType) element).getFormalNeighbourCount(); this.identifier = ((IAtomType) element).getAtomTypeName(); } }
radiusTarget = getCovalentRadius(symbol, ac.getMaximumBondOrder(target)); } else { radiusTarget = type.getCovalentRadius(); radius = getCovalentRadius(symbol, ac.getMaximumBondOrder(allAtoms[a])); } else { radius = type.getCovalentRadius();
symbol = atom.getSymbol(); type = factory.getAtomType(symbol); radiusTarget = type.getCovalentRadius(); } catch (Exception execption) { logger.debug(execption); radius = type.getCovalentRadius(); partial += radius * radius; partial += (radiusTarget * radiusTarget);
String symbol = atom.getSymbol(); IAtomType type = factory.getAtomType(symbol); covalentradius = type.getCovalentRadius();
String symbol = atom.getSymbol(); IAtomType type = factory.getAtomType(symbol); covalentradius = type.getCovalentRadius();
/** * Method to test the clone() method */ @Test public void testClone_CovalentRadius() throws Exception { IAtomType at = (IAtomType) newChemObject(); at.setCovalentRadius(1.0); IAtomType clone = (IAtomType) at.clone(); at.setCovalentRadius(2.0); Assert.assertEquals(1.0, clone.getCovalentRadius(), 0.001); }
ImmutableAtomType(IAtomType type) { this.element = type.getSymbol(); this.atomicNumber = type.getAtomicNumber(); this.naturalAbundance = type.getNaturalAbundance(); this.exactMass = type.getExactMass(); this.massNumber = type.getMassNumber(); this.formalCharge = type.getFormalCharge(); this.hybridization = type.getHybridization(); this.formalNeighbourCount = type.getFormalNeighbourCount(); this.identifier = type.getAtomTypeName(); this.maxBondOrder = type.getMaxBondOrder(); this.bondOrderSum = type.getBondOrderSum(); this.covalentRadius = type.getCovalentRadius(); this.flags = (short)type.getFlagValue(); this.properties = Collections.unmodifiableMap(type.getProperties()); if (type.getValency() != null) { this.electronValency = type.getValency(); } else { Integer piBondCount = type.getProperty(CDKConstants.PI_BOND_COUNT, Integer.class); if (piBondCount != null && formalNeighbourCount != null) { this.electronValency = piBondCount + formalNeighbourCount; } else { this.electronValency = null; } } }
ImmutableAtomType(IAtomType type) { this.element = type.getSymbol(); this.atomicNumber = type.getAtomicNumber(); this.naturalAbundance = type.getNaturalAbundance(); this.exactMass = type.getExactMass(); this.massNumber = type.getMassNumber(); this.formalCharge = type.getFormalCharge(); this.hybridization = type.getHybridization(); this.formalNeighbourCount = type.getFormalNeighbourCount(); this.identifier = type.getAtomTypeName(); this.maxBondOrder = type.getMaxBondOrder(); this.bondOrderSum = type.getBondOrderSum(); this.covalentRadius = type.getCovalentRadius(); this.flags = (short)type.getFlagValue(); this.properties = Collections.unmodifiableMap(type.getProperties()); if (type.getValency() != null) { this.electronValency = type.getValency(); } else { Integer piBondCount = type.getProperty(CDKConstants.PI_BOND_COUNT, Integer.class); if (piBondCount != null && formalNeighbourCount != null) { this.electronValency = piBondCount + formalNeighbourCount; } else { this.electronValency = null; } } }
atom.setMaxBondOrder(atomType.getMaxBondOrder()); atom.setBondOrderSum(atomType.getBondOrderSum()); atom.setCovalentRadius(atomType.getCovalentRadius()); atom.setHybridization(atomType.getHybridization()); Object color = atomType.getProperty("org.openscience.cdk.renderer.color");
atom.setMaxBondOrder(atomType.getMaxBondOrder()); atom.setBondOrderSum(atomType.getBondOrderSum()); atom.setCovalentRadius(atomType.getCovalentRadius()); atom.setHybridization(atomType.getHybridization()); Object color = atomType.getProperty("org.openscience.cdk.renderer.color");
if (atom.getBondOrderSum() == CDKConstants.UNSET && atomType.getBondOrderSum() != CDKConstants.UNSET) atom.setBondOrderSum(atomType.getBondOrderSum()); if (atom.getCovalentRadius() == CDKConstants.UNSET && atomType.getCovalentRadius() != CDKConstants.UNSET) atom.setCovalentRadius(atomType.getCovalentRadius()); if (atom.getValency() == CDKConstants.UNSET && atomType.getValency() != CDKConstants.UNSET) atom.setValency(atomType.getValency());
totalDiff.addChild(IntegerDifference.construct("NC", firstElem.getFormalNeighbourCount(), secondElem.getFormalNeighbourCount())); totalDiff.addChild(DoubleDifference.construct("CR", firstElem.getCovalentRadius(), secondElem.getCovalentRadius())); totalDiff.addChild(IntegerDifference.construct("V", firstElem.getValency(), secondElem.getValency())); totalDiff.addChild(IsotopeDiff.difference(first, second));
atom.setMaxBondOrder(atomType.getMaxBondOrder()); atom.setBondOrderSum(atomType.getBondOrderSum()); atom.setCovalentRadius(atomType.getCovalentRadius()); atom.setValency(atomType.getValency()); atom.setFormalCharge(atomType.getFormalCharge());
/** * This method calculates the Covalent radius of an atom. * *@param atom The IAtom for which the DescriptorValue is requested *@param container The {@link IAtomContainer} for which the descriptor is to be calculated *@return The Covalent radius of the atom */ @Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { if (factory == null) try { factory = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/jmol_atomtypes.txt", container.getBuilder()); } catch (Exception exception) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), getDescriptorNames(), exception); } double covalentradius; try { String symbol = atom.getSymbol(); IAtomType type = factory.getAtomType(symbol); covalentradius = type.getCovalentRadius(); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( covalentradius), getDescriptorNames()); } catch (Exception exception) { logger.debug(exception); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), getDescriptorNames(), exception); } }