@ Override public DescriptorValue calculate ( IBond bond , IAtomContainer atomContainer ) { double value = 0 ; // FIXME: for now I'll cache a few modified atomic properties, and restore them at the end of this method String originalAtomtypeName1 = bond . getBegin ( ) . getAtomTypeName ( ) ; Integer originalNeighborCount1 = bond . getBegin ( ) . getFormalNeighbourCount ( ) ; IAtomType . Hybridization originalHybridization1 = bond . getBegin ( ) . getHybridization ( ) ; Integer originalValency1 = bond . getBegin ( ) . getValency ( ) ; String originalAtomtypeName2 = bond . getEnd ( ) . getAtomTypeName ( ) ; Integer originalNeighborCount2 = bond . getEnd ( ) . getFormalNeighbourCount ( ) ; IAtomType . Hybridization originalHybridization2 = bond . getEnd ( ) . getHybridization ( ) ; Integer originalValency2 = bond . getEnd ( ) . getValency ( ) ; Double originalBondOrderSum1 = bond . getBegin ( ) . getBondOrderSum ( ) ; Order originalMaxBondOrder1 = bond . getBegin ( ) . getMaxBondOrder ( ) ; Double originalBondOrderSum2 = bond . getEnd ( ) . getBondOrderSum ( ) ; Order originalMaxBondOrder2 = bond . getEnd ( ) . getMaxBondOrder ( ) ; if ( ! isCachedAtomContainer ( atomContainer ) ) { try { AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( atomContainer ) ; LonePairElectronChecker lpcheck = new LonePairElectronChecker ( ) ; lpcheck . saturate ( atomContainer ) ; } catch ( CDKException e ) { return getDummyDescriptorValue ( e ) ; } } if ( ! bond . getOrder ( ) . equals ( IBond . Order . SINGLE ) ) { try { value = IonizationPotentialTool . predictIP ( atomContainer , bond ) ; } catch ( CDKException e ) { return getDummyDescriptorValue ( e ) ; } } bond . getBegin ( ) . setAtomTypeName ( originalAtomtypeName1 ) ; bond . getBegin ( ) . setHybridization ( originalHybridization1 ) ; bond . getBegin ( ) . setValency ( originalValency1 ) ; bond . getBegin ( ) . setFormalNeighbourCount ( originalNeighborCount1 ) ; bond . getEnd ( ) . setAtomTypeName ( originalAtomtypeName2 ) ; bond . getEnd ( ) . setHybridization ( originalHybridization2 ) ; bond . getEnd ( ) . setValency ( originalValency2 ) ; bond . getEnd ( ) . setFormalNeighbourCount ( originalNeighborCount2 ) ; bond . getBegin ( ) . setMaxBondOrder ( originalMaxBondOrder1 ) ; bond . getBegin ( ) . setBondOrderSum ( originalBondOrderSum1 ) ; bond . getEnd ( ) . setMaxBondOrder ( originalMaxBondOrder2 ) ; bond . getEnd ( ) . setBondOrderSum ( originalBondOrderSum2 ) ; return new DescriptorValue ( getSpecification ( ) , getParameterNames ( ) , getParameters ( ) , new DoubleResult ( value ) , DESCRIPTOR_NAMES ) ; }
This method calculates the ionization potential of a bond .