Mercurial > repos > bgruening > enumerate_charges
comparison sdf_to_tab.py @ 1:d84dc786ccb9 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/rdkit commit 09b22cceacb34dd4c6c1b42890f93232df128208"
| author | bgruening |
|---|---|
| date | Sat, 21 Mar 2020 18:01:47 +0000 |
| parents | 759010d2e9cd |
| children | 5981893078ad |
comparison
equal
deleted
inserted
replaced
| 0:759010d2e9cd | 1:d84dc786ccb9 |
|---|---|
| 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) |
