From 8c9555af77920c7d6811c98a76d2910d219a044c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fa=CC=81bio=20Madeira?= Date: Wed, 27 Sep 2017 15:17:11 +0100 Subject: [PATCH] Python types are now converted to Numpy Data types. --- prointvar/library.py | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/prointvar/library.py b/prointvar/library.py index 399f3a9..45df517 100755 --- a/prointvar/library.py +++ b/prointvar/library.py @@ -15,7 +15,7 @@ """ -mmcif_types = { +_mmcif_types = { 'group_PDB': str, 'id': int, 'type_symbol': str, @@ -52,7 +52,7 @@ 'contact_indexes': str, } -dssp_types = { +_dssp_types = { 'LINE': int, 'RES': str, 'CHAIN': str, @@ -85,7 +85,7 @@ 'Z-CA': float } -sifts_types = { +_sifts_types = { 'PDB_regionId': int, 'PDB_regionStart': int, 'PDB_regionEnd': int, @@ -127,7 +127,7 @@ 'Pfam_dbAccessionId': str } -hbplus_types = { +_hbplus_types = { "CHAIN_D": str, "RES_D": str, "INSCODE_D": str, @@ -147,7 +147,7 @@ "ID": int } -arpeggio_types = { +_arpeggio_types = { "ENTRY_A": str, "CHAIN_A": str, "RES_A": str, @@ -180,9 +180,9 @@ "ENTITIES": str } -probe_types = {} +_probe_types = {} -stamp_types = { +_stamp_types = { "Domain1": str, "Domain2": str, "Fits": int, @@ -199,13 +199,28 @@ "Pm": float, } -uni_ens_var_types = { +_uni_ens_var_types = { 'begin': int, 'end': int, 'polyphenScore': float, 'siftScore': float, } +_dtypes_convert = { + int: 'int64', + float: 'float64', + str: 'object' +} + +mmcif_types = {k: _dtypes_convert[v] for k, v in _mmcif_types.items()} +dssp_types = {k: _dtypes_convert[v] for k, v in _dssp_types.items()} +sifts_types = {k: _dtypes_convert[v] for k, v in _sifts_types.items()} +hbplus_types = {k: _dtypes_convert[v] for k, v in _hbplus_types.items()} +arpeggio_types = {k: _dtypes_convert[v] for k, v in _arpeggio_types.items()} +probe_types = {k: _dtypes_convert[v] for k, v in _probe_types.items()} +stamp_types = {k: _dtypes_convert[v] for k, v in _stamp_types.items()} +uni_ens_var_types = {k: _dtypes_convert[v] for k, v in _uni_ens_var_types.items()} + arpeggio_col_renames = { "STERIC_CLASH": "Steric-Clash", "COVALENT": "Covalent-Bond",