private static List < List < Integer > > getUniqueBondSubgraphs ( List < List < RMap > > subgraphs , IAtomContainer ac ) { List < List < Integer >> bondList = new ArrayList < List < Integer > > ( ) ; for ( List < RMap > subgraph : subgraphs ) { List < RMap > current = subgraph ; List < Integer > ids = new ArrayList < Integer > ( ) ; for ( RMap aCurrent : current ) { RMap rmap = ( RMap ) aCurrent ; ids . add ( rmap . getId1 ( ) ) ; } Collections . sort ( ids ) ; bondList . add ( ids ) ; } // get the unique set of bonds HashSet < List < Integer > > hs = new HashSet < List < Integer > > ( bondList ) ; bondList = new ArrayList < List < Integer > > ( hs ) ; List < List < Integer > > paths = new ArrayList < List < Integer > > ( ) ; for ( List < Integer > aBondList1 : bondList ) { List < Integer > aBondList = aBondList1 ; List < Integer > tmp = new ArrayList < Integer > ( ) ; for ( Object anABondList : aBondList ) { int bondNumber = ( Integer ) anABondList ; for ( IAtom atom : ac . getBond ( bondNumber ) . atoms ( ) ) { Integer atomInt = ac . indexOf ( atom ) ; if ( ! tmp . contains ( atomInt ) ) tmp . add ( atomInt ) ; } } paths . add ( tmp ) ; } return paths ; }
Converts a set of bond mappings to a unique set of atom paths .