User 3898c01b63
		09-10-2014 00:33:09
	 
	
	
	Regularly, BindingDB populates new molecules to the database.  BindingDB uses JChem APIs for this process.  A enclosed molfile from US Patents Office is converted to a wrong SMILES.
BindingDB_111821.mol    OC(=O)CCC(=O)N1CCc2cc(ccc12)S(=O)(=O)N1CCN(CC1)c1cccc(Cl)c1
BindingDB_111837.mol    OC(=O)CCC(=O)N1CCc2cc(ccc12)S(=O)(=O)N1CCN(CC1)c1cccc(Cl)c1
BindingDB_111837M.mol OC(=O)CNC(=O)N1CCc2cc(ccc12)S(=O)(=O)N1CCN(CC1)c1cccc(Cl)c1
  BindingDB_111821.mol and BindingDB_111837.mol  are converted to the same SMILES.
BindingDB_111837.mol has a section in its MOL file:
A   28
HN
BindingDB_111837.mol is imported to a Marvin applet, whose N (28) is replaced with C, and back to N, and exported to BindingDB_111837M.mo.
Is there a way in JChem programmatically reorganizing the HN part like BindingDB_111837M.mol to retain the molecule?
Thank you in advance for your help.
	
	 
 
	
		ChemAxon 044c6721bc
		09-10-2014 11:19:57
	 
	
	
	Hi,
The "A 28 NH" part is an atom alias. What do you want to do exactly? Do you want to get a smiles with this NH part except the C?
Janos
	
	 
 
	
		User 3898c01b63
		09-10-2014 17:12:43
	 
	
	
	Hi Janos,
  Yes, I would like to get the correct SMILES with NH not C.  It is very important to us.
	
	 
 
	
		ChemAxon 044c6721bc
		10-10-2014 09:59:31
	 
	
	
	Hi,
It is possible from API, with the following method:
-after import, iterate over the atoms
-check if the atom is an alias atom
-process the atom alias string  and convert it to an atomic number
-change the atomic numbert from alias atom to the new one
-export to smiles
Can you write the code, or do you want a code example?
Janos
	
	 
 
	
		User 3898c01b63
		10-10-2014 13:05:12
	 
	
	
	Hi Janos,
  Thank you for the kind reply.
  Please give the example codes to do that at your convenience.
	
	 
 
	
		ChemAxon 044c6721bc
		13-10-2014 11:02:25
	 
	
	
	Hi,
Try this:
        MolImporter molImporter = new MolImporter(filename);
        Molecule molecule = molImporter.read();
        for(MolAtom molAtom : molecule.getAtomArray()) {
            String alias = molAtom.getAliasstr();
            if(alias != null) {
                alias = alias.replace("H", "");
                molAtom.setAtno(PeriodicSystem.findAtomicNumber(alias));
            }
        }
        System.out.println(MolExporter.exportToFormat(molecule, "smiles"));
 
Janos