private void mapInputMoleculeToInchiMolgraph ( IAtomContainer inchiMolGraph , IAtomContainer mol ) throws CDKException { Iterator < Map < IAtom , IAtom > > iter = org . openscience . cdk . isomorphism . VentoFoggia . findIdentical ( inchiMolGraph , AtomMatcher . forElement ( ) , BondMatcher . forAny ( ) ) . matchAll ( mol ) . limit ( 1 ) . toAtomMap ( ) . iterator ( ) ; if ( iter . hasNext ( ) ) { for ( Map . Entry < IAtom , IAtom > e : iter . next ( ) . entrySet ( ) ) { IAtom src = e . getKey ( ) ; IAtom dst = e . getValue ( ) ; String position = src . getID ( ) ; dst . setID ( position ) ; LOGGER . debug ( "Mapped InChI " , src . getSymbol ( ) , " " , src . getID ( ) , " to " , dst . getSymbol ( ) , " " + dst . getID ( ) ) ; } } else { throw new IllegalArgumentException ( CANSMI . create ( inchiMolGraph ) + " " + CANSMI . create ( mol ) ) ; } }
Atom - atom mapping of the input molecule to the bare container constructed from the InChI connection table . This makes it possible to map the positions of the mobile hydrogens in the InChI back to the input molecule .