Mercurial > repos > bgruening > openbabel_addh
comparison ob_filter.py @ 2:1b1e6531edc2 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/openbabel commit 78ac0521d7df684e96c1b9c1ba2a17b02e681608
| author | bgruening |
|---|---|
| date | Sat, 20 May 2017 19:58:06 -0400 |
| parents | c6f3cedfe301 |
| children | 60f63e659a32 |
comparison
equal
deleted
inserted
replaced
| 1:3f6693e76b0b | 2:1b1e6531edc2 |
|---|---|
| 93 # To keep it readable in the xml file, many white-spaces are included in that string it needs to be removed. | 93 # To keep it readable in the xml file, many white-spaces are included in that string it needs to be removed. |
| 94 # Also the last loop creates a ',{' that is not an valid jason expression. | 94 # Also the last loop creates a ',{' that is not an valid jason expression. |
| 95 filters = json.loads((args.filters).replace(' ', '').replace(',}', '}')) | 95 filters = json.loads((args.filters).replace(' ', '').replace(',}', '}')) |
| 96 if args.iformat == 'sdf': | 96 if args.iformat == 'sdf': |
| 97 # Check if the sdf file contains all of the required metadata to invoke the precalculation filtering | 97 # Check if the sdf file contains all of the required metadata to invoke the precalculation filtering |
| 98 mol = pybel.readfile('sdf', args.input).next() | 98 mol = next(pybel.readfile('sdf', args.input)) |
| 99 for key, elem in filters.items(): | 99 for key, elem in filters.items(): |
| 100 property = cheminfolib.ColumnNames[key] | 100 property = cheminfolib.ColumnNames[key] |
| 101 if not property in mol.data: | 101 if not property in mol.data: |
| 102 break | 102 break |
| 103 else: | 103 else: |
