public static String convertMolToSMILESWithAtomMapping ( String molfile , List < Attachment > attachments ) throws CTKException , ChemistryException { String smiles = Chemistry . getInstance ( ) . getManipulator ( ) . convertMolIntoSmilesWithAtomMapping ( molfile ) ; for ( Attachment attachment : attachments ) { int r = Integer . valueOf ( attachment . getLabel ( ) . replaceAll ( "\\D+" , "" ) ) ; smiles = smiles . replace ( "[*:" + r + "]" , "[" + attachment . getCapGroupName ( ) + ":" + r + "]" ) ; } return smiles ; }
Converts molfile with the given attachments in smiles with atom mapping