Logo Search packages:      
Sourcecode: cdk version File versions  Download package

double org::openscience::cdk::charges::StabilizationCharges::calculatePositive ( IAtomContainer  atomContainer,
IAtom  atom 
) [inline]

calculate the stabilization of orbitals when they contain deficiency of charge.

Parameters:
atomContainerIAtomContainer
atomIAtom for which effective atom StabilizationCharges factor should be calculated
Returns:
stabilizationValue

Definition at line 70 of file StabilizationCharges.java.

References org::openscience::cdk::interfaces::IAtomContainerSet::atomContainers(), org::openscience::cdk::interfaces::IAtomContainer::atoms(), org::openscience::cdk::charges::PiElectronegativity::calculatePiElectronegativity(), org::openscience::cdk::interfaces::IAtomContainer::contains(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::interfaces::IAtomContainerSet::getAtomContainer(), org::openscience::cdk::interfaces::IAtomContainerSet::getAtomContainerCount(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IAtomContainer::getAtomNumber(), org::openscience::cdk::tools::StructureResonanceGenerator::getContainers(), org::openscience::cdk::tools::StructureResonanceGenerator::getReactions(), org::openscience::cdk::tools::StructureResonanceGenerator::getStructures(), org::openscience::cdk::interfaces::IAtomContainerSet::removeAtomContainer(), org::openscience::cdk::charges::PiElectronegativity::setMaxIterations(), and org::openscience::cdk::tools::StructureResonanceGenerator::setReactions().

Referenced by org::openscience::cdk::qsar::descriptors::atomic::StabilizationPlusChargeDescriptor::calculate(), and org::openscience::cdk::tools::IonizationPotentialTool::getQSARs().

                                                                             {
      /*restrictions*/
//          if(atomContainer.getConnectedSingleElectronsCount(atom) > 0 || atom.getFormalCharge() != 1){
      if(atom.getFormalCharge() != 1){
            return 0.0;
      }

      // only must be generated all structures which stabilize the atom in question.
      StructureResonanceGenerator gRI = new StructureResonanceGenerator();
      try {
            List<IReactionProcess> reactionList = gRI.getReactions();
            reactionList.add(new HyperconjugationReaction());
            gRI.setReactions(reactionList);
            } catch (CDKException e) {
                  e.printStackTrace();
            }
      IAtomContainerSet resonanceS = gRI.getStructures((IMolecule) atomContainer);
      IAtomContainerSet containerS = gRI.getContainers((IMolecule) atomContainer);
      if(resonanceS.getAtomContainerCount() < 2)// meaning it was not find any resonance structure
                  return 0.0;
            
            int positionStart = atomContainer.getAtomNumber(atom);
            
            List<Double> result1 = new ArrayList<Double>();
      List<Integer> distance1 = new ArrayList<Integer>();
      
      resonanceS.removeAtomContainer(0);// the first is the initial structure
      for(Iterator<IAtomContainer> itA = resonanceS.atomContainers().iterator(); itA.hasNext();){
                  IAtomContainer resonance = itA.next();

                  if(resonance.getAtomCount() < 2) // resonance with only one atom donnot have resonance
                        continue;
                  
                /*search positive charge*/
                  
            PiElectronegativity electronegativity = new PiElectronegativity();
            
            for(Iterator<IAtom> itAtoms = resonance.atoms().iterator(); itAtoms.hasNext();){
                         IAtom atomP = itAtoms.next();
                         IAtom atomR = atomContainer.getAtom(resonance.getAtomNumber(atomP));
                         if(containerS.getAtomContainer(0).contains(atomR)){
                                           
                                     electronegativity.setMaxIterations(6);
                                     double result = electronegativity.calculatePiElectronegativity(resonance, atomP);
                                   result1.add(result);
                                      
                                     int dis = calculateBondsToAtom(resonance.getAtom(positionStart),atomP, resonance);
                                     distance1.add(dis);
                              }
                         
                   }
            }
      /*logarithm*/
      double value = 0.0;
      double sum = 0.0;
      Iterator<Integer> itDist = distance1.iterator();
      for(Iterator<Double> itElec = result1.iterator(); itElec.hasNext();){
            double suM = itElec.next();
            if(suM < 0)
                  suM = -1*suM;
            sum += suM*Math.pow(0.67,itDist.next().intValue());
      }
      value = sum;
            
      return value;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index