Mercurial > repos > bgruening > ctb_rdkit_descriptors
comparison rdkit_descriptors.py @ 2:6674260c1459 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdkit commit 3372cca3d07562b643b8152d489dcbd2325acf4a
author | bgruening |
---|---|
date | Thu, 23 May 2019 18:57:30 -0400 |
parents | 749cc765636b |
children | a1c53f0533b0 |
comparison
equal
deleted
inserted
replaced
1:13c6f797f1c3 | 2:6674260c1459 |
---|---|
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 |