@@ -106,6 +106,14 @@ def _GPCRdbDataFrame2conlabs(tablefile,
106
106
assert scheme in df .keys (), ValueError ("'%s' isn't an available scheme.\n Available schemes are %s" % (
107
107
scheme , [key for key in df .keys () if key in _GPCR_available_schemes + ["display_generic_number" ]]))
108
108
AA2conlab = {key : str (val ) for key , val in df [["AAresSeq" , scheme ]].values }
109
+ dgn_other = df [df [scheme ].isna () & ~ df ["display_generic_number" ].isna ()][["AAresSeq" , "display_generic_number" ]]
110
+ if len (dgn_other )> 0 :
111
+ AA2dgn = {key : str (val ) for key , val in df [["AAresSeq" , "display_generic_number" ]].values }
112
+ for ii , key in enumerate (AA2conlab .keys ()):
113
+ if str (AA2conlab [key ]) == "None" and AA2dgn .get (key ,None ) is not None :
114
+ AA2conlab [key ]= AA2dgn [key ]
115
+ #print(f"Some labels of the 'display_generic_number' column would be lost by choosing scheme='{scheme}'.")
116
+
109
117
# Locate definition lines and use their indices
110
118
fragments = _defdict (list )
111
119
@@ -1246,7 +1254,7 @@ def __init__(self, UniProt_name,
1246
1254
including the extension "xslx", then the lookup will
1247
1255
fail. This what the `format` parameter is for
1248
1256
write_to_disk : bool, default is False
1249
- Save an excel file with the nomenclature
1257
+ Save an Excel file with the nomenclature
1250
1258
information
1251
1259
"""
1252
1260
@@ -1258,7 +1266,8 @@ def __init__(self, UniProt_name,
1258
1266
write_to_disk = write_to_disk
1259
1267
)
1260
1268
# Re-introduce the "." in the GPS label
1261
- self ._dataframe = self ._dataframe .replace ("B.GPS-2" ,"B.GPS.-2" ).replace ("B.GPS-1" ,"B.GPS.-1" ).replace ("B.GPS+1" ,"B.GPS.+1" )
1269
+ self ._dataframe = self ._dataframe .replace ("B.GPS-2" , "B.GPS.-2" ).replace ("B.GPS-1" , "B.GPS.-1" ).replace ("B.GPS+1" , "B.GPS.+1" )
1270
+
1262
1271
# Check for GPS in the middle of S14
1263
1272
if "B.S14" in self .dataframe .protein_segment .values :
1264
1273
assert self .dataframe [self .dataframe .protein_segment == "B.S14" ].index .diff ().fillna (1 ).unique () == 1 , (
0 commit comments