code: 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;
  
  	}
docs: Converts molfile with the given attachments in smiles with atom mapping
  
  @param molfile
  given molfile
  @param attachments
  given attachments of the molfile
  @return smiles with atom mapping
  @throws CTKException
  if the molfile can not be converted to smiles
  @throws ChemistryException
  if the Chemistry Engine can not be initialized