comparison mordred_descriptors.py @ 1:e2f40a02f31a draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/mordred commit 7c47e7409a8cb19e20b4424329f5d0d9470f3b00
author bgruening
date Tue, 04 Jun 2019 10:29:10 -0400
parents ea68b86303e2
children d074b0c2b54f
comparison
equal deleted inserted replaced
0:ea68b86303e2 1:e2f40a02f31a
28 if ext == 'sdf': 28 if ext == 'sdf':
29 return [n for n in SDMolSupplier(filename)] 29 return [n for n in SDMolSupplier(filename)]
30 with open(filename) as f: 30 with open(filename) as f:
31 mols = f.read().split('\n') 31 mols = f.read().split('\n')
32 if ext == 'smi': 32 if ext == 'smi':
33 return [Chem.MolFromSmiles(mol, sanitize=True) for mol in mols] 33 return [Chem.MolFromSmiles(mol, sanitize=True) for mol in mols if mol != '']
34 if ext == 'inchi': 34 if ext == 'inchi':
35 return [Chem.inchi.MolFromInchi(mol, sanitize=True) for mol in mols] 35 return [Chem.inchi.MolFromInchi(mol, sanitize=True) for mol in mols if mol != '']
36 36
37 37
38 def mordred_descriptors(mols, output, header, use_3d): 38 def mordred_descriptors(mols, output, header, use_3d):
39 """ 39 """
40 Calculate Mordred descriptors and save as tabular 40 Calculate Mordred descriptors and save as tabular