comparison sdf_to_tab.py @ 5:5f35d8bd62a0 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdkit commit 09b22cceacb34dd4c6c1b42890f93232df128208"
author bgruening
date Sat, 21 Mar 2020 18:02:30 +0000
parents 8922aa062403
children 287e8e0d1e3d
comparison
equal deleted inserted replaced
4:fcc88ab4f1d3 5:5f35d8bd62a0
14 if vars.props.strip() == '': # none specified, return all 14 if vars.props.strip() == '': # none specified, return all
15 d = {prop: val for (prop, val) in d.items() if not any(x in str(val) for x in ['\n', '\t'])} # remove items containing newlines or tabs 15 d = {prop: val for (prop, val) in d.items() if not any(x in str(val) for x in ['\n', '\t'])} # remove items containing newlines or tabs
16 else: 16 else:
17 d = {prop: val for (prop, val) in d.items() if prop in vars.props.replace(' ', '').split(',')} # remove items not requested via CLI 17 d = {prop: val for (prop, val) in d.items() if prop in vars.props.replace(' ', '').split(',')} # remove items not requested via CLI
18 if vars.name: 18 if vars.name:
19 d['Name'] = mols[n].GetProp('_Name') 19 d['SDFMoleculeName'] = mols[n].GetProp('_Name')
20 if vars.smiles: 20 if vars.smiles:
21 d['SMILES'] = Chem.MolToSmiles(mols[n], isomericSmiles=False) 21 d['SMILES'] = Chem.MolToSmiles(mols[n], isomericSmiles=False)
22 d['Index'] = int(n) 22 d['Index'] = int(n)
23 23
24 df = df.append(d, ignore_index=True) 24 df = df.append(d, ignore_index=True)