Mercurial > repos > bgruening > ctb_rdkit_descriptors
comparison rdkit_descriptors.py @ 2:81233a9053f5 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdkit commit 3372cca3d07562b643b8152d489dcbd2325acf4a
| author | bgruening |
|---|---|
| date | Thu, 23 May 2019 18:56:48 -0400 |
| parents | 054d7b0de5c1 |
| children | 2d051db1f561 |
comparison
equal
deleted
inserted
replaced
| 1:7b3e535f905b | 2:81233a9053f5 |
|---|---|
| 63 supplier = get_supplier( args.infile, format = 'inchi' ) | 63 supplier = get_supplier( args.infile, format = 'inchi' ) |
| 64 | 64 |
| 65 functions = get_rdkit_descriptor_functions() | 65 functions = get_rdkit_descriptor_functions() |
| 66 | 66 |
| 67 if args.header: | 67 if args.header: |
| 68 args.outfile.write( '%s\n' % '\t'.join( [name for name, f in functions] ) ) | 68 args.outfile.write( '%s\n' % '\t'.join( ['MoleculeID'] + [name for name, f in functions] ) ) |
| 69 | 69 |
| 70 for mol in supplier: | 70 for mol in supplier: |
| 71 if not mol: | 71 if not mol: |
| 72 continue | 72 continue |
| 73 descs = descriptors( mol, functions ) | 73 descs = descriptors( mol, functions ) |
| 74 molecule_id = mol.GetProp("_Name") | 74 molecule_id = mol.GetProp("_Name") |
| 75 args.outfile.write( "%s\n" % '\t'.join( [molecule_id]+ [str(res) for name, res in descs] ) ) | 75 args.outfile.write( "%s\n" % '\t'.join( [molecule_id]+ [str(round(res, 6)) for name, res in descs] ) ) |
| 76 | 76 |
