Created
January 10, 2018 16:15
-
-
Save sverhoeven/1fdb27c2d0418895101a3eba3274461d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Script to swap donor/acceptor in pharmacophore database file | |
original enum is | |
Enum({'LIPO': 0, 'POSC': 1, 'HACC': 4, 'NEGC': 2, 'AROM': 5, 'HDON': 3}) | |
corrected enum is | |
Enum({'LIPO': 0, 'POSC': 1, 'HACC': 3, 'NEGC': 2, 'AROM': 5, 'HDON': 4}) | |
""" | |
import sys | |
from kripodb.pharmacophores import PharmacophoresDb | |
orig_fn = sys.argv[1] | |
swapped_fn = sys.argv[2] | |
with PharmacophoresDb(orig_fn) as orig: | |
with PharmacophoresDb(swapped_fn, 'w', expectedrows=len(orig.points)) as swapped: | |
row = swapped.points.table.row | |
for orig_row in orig.points.table.iterrows(): | |
row['frag_id'] = orig_row['frag_id'] | |
row['x'] = orig_row['x'] | |
row['y'] = orig_row['y'] | |
row['z'] = orig_row['z'] | |
row['type'] = orig_row['type'] | |
row.append() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment