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

IMolecule org::openscience::cdk::tools::GenerateFragments::addFragmentBonds ( IMolecule  targetMolecule,
IMolecule  mainMolecule 
) [inline, private]

add bonds to the murcko fragments

Parameters:
targetMoleculemurcko fragment storage
mainMoleculeoriginal molecule
Returns:
IMolecule murcko fragment

Definition at line 343 of file GenerateFragments.java.

References org::openscience::cdk::interfaces::IAtomContainer::addBond(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IAtomContainer::getAtomNumber(), org::openscience::cdk::interfaces::IAtomContainer::getBond(), and org::openscience::cdk::CDKConstants::ISAROMATIC.

Referenced by generateMurckoFragments().

                                                                                          {
            int firstAtomNumber=0;
            int secondAtomNumber=0;
            for (int i=0;i<targetMolecule.getAtomCount()-1;i++){
                  for (int j = i+1; j < targetMolecule.getAtomCount(); j++) {
                        
                        if (mainMolecule.getBond(targetMolecule.getAtom(i),targetMolecule.getAtom(j)) !=null){
                              firstAtomNumber=targetMolecule.getAtomNumber(targetMolecule.getAtom(i));
                              secondAtomNumber=targetMolecule.getAtomNumber(targetMolecule.getAtom(j));
                              targetMolecule.addBond(firstAtomNumber,secondAtomNumber,mainMolecule.getBond(targetMolecule.getAtom(i),targetMolecule.getAtom(j)).getOrder());
                              if (mainMolecule.getBond(targetMolecule.getAtom(i),targetMolecule.getAtom(j)).getFlag(CDKConstants.ISAROMATIC) == true){
                                    targetMolecule.getBond(targetMolecule.getAtom(firstAtomNumber),targetMolecule.getAtom(secondAtomNumber)).setFlag(CDKConstants.ISAROMATIC, true);
                              }
                        }
                  }
            }
            return targetMolecule;
      }

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