public IAtomContainer getCyclicFragmentsContainer ( ) { IAtomContainer fragContainer = this . molecule . getBuilder ( ) . newInstance ( IAtomContainer . class ) ; IAtomContainer spt = getSpanningTree ( ) ; for ( int i = 0 ; i < totalEdgeCount ; i ++ ) if ( ! bondsInTree [ i ] ) { IRing ring = getRing ( spt , molecule . getBond ( i ) ) ; for ( int b = 0 ; b < ring . getBondCount ( ) ; b ++ ) { IBond ringBond = ring . getBond ( b ) ; if ( ! fragContainer . contains ( ringBond ) ) { for ( int atomCount = 0 ; atomCount < ringBond . getAtomCount ( ) ; atomCount ++ ) { IAtom atom = ringBond . getAtom ( atomCount ) ; if ( ! fragContainer . contains ( atom ) ) { atom . setFlag ( CDKConstants . ISINRING , true ) ; fragContainer . addAtom ( atom ) ; } } fragContainer . addBond ( ringBond ) ; } } } return fragContainer ; }
Returns an IAtomContainer which contains all the atoms and bonds which are involved in ring systems .