@@ -762,6 +762,7 @@ def _check_file_hash(
762
762
if file_hash and file_hash != calculate_sha256 (file_path ):
763
763
logfunc (key , f"Invalid hash for file { filename } " )
764
764
else :
765
+ logger .debug ("missing file: %s" , file_path )
765
766
logfunc (
766
767
key ,
767
768
f"{ key } referenced in { METADATA_FILE } : { obj_identifier } but not found in archive" ,
@@ -1505,11 +1506,14 @@ def process_site_observation(
1505
1506
"cmpd" : compound ,
1506
1507
"xtalform_site" : xtalform_site ,
1507
1508
"canon_site_conf" : canon_site_conf ,
1508
- "smiles" : smiles ,
1509
+ # "smiles": smiles,
1509
1510
"seq_id" : ligand ,
1510
1511
"chain_id" : chain ,
1511
1512
}
1512
1513
1514
+ # smiles removed from check fields aand removed to defaults as
1515
+ # part of 1670
1516
+
1513
1517
defaults = {
1514
1518
"bound_file" : str (self ._get_final_path (bound_file )),
1515
1519
"apo_solv_file" : str (self ._get_final_path (apo_solv_file )),
@@ -1524,6 +1528,7 @@ def process_site_observation(
1524
1528
"ligand_smiles" : str (self ._get_final_path (ligand_smiles )),
1525
1529
"ligand_sdf" : str (self ._get_final_path (ligand_sdf )),
1526
1530
"pdb_header_file" : None ,
1531
+ "smiles" : smiles ,
1527
1532
}
1528
1533
1529
1534
index_data = {
@@ -2015,9 +2020,30 @@ def process_bundle(self):
2015
2020
f"{ val .instance .canon_site .canon_site_num } "
2016
2021
+ f"{ next (numerators [val .instance .canon_site .canon_site_num ])} "
2017
2022
)
2018
- so_list = [
2019
- site_observation_objects [k ].instance for k in val .index_data ["members" ]
2020
- ]
2023
+
2024
+ so_list = []
2025
+ for k in val .index_data ["members" ]:
2026
+ try :
2027
+ so_list .append (site_observation_objects [k ].instance )
2028
+ except KeyError as exc :
2029
+ # this is something that started happening, people
2030
+ # removing experiments. check if exists:
2031
+ # the key looks something like A71EV2A-x4922/A/201/5
2032
+ exp_code = k .split ("/" )[0 ]
2033
+ if exp_code not in experiment_objects .keys ():
2034
+ # this is the root cause, that's the situation
2035
+ # that's been happening
2036
+ self .report .log (
2037
+ logging .ERROR ,
2038
+ f"Experiment { exp_code } missing from { METADATA_FILE } " ,
2039
+ )
2040
+ else :
2041
+ # this has not, handling it just in case
2042
+ self .report .log (
2043
+ logging .ERROR ,
2044
+ f"SiteObservation { k } missing from { METADATA_FILE } " ,
2045
+ )
2046
+
2021
2047
# tag = val.instance.name.split('+')[0]
2022
2048
tag = val .instance .name
2023
2049
try :
@@ -2132,9 +2158,29 @@ def process_bundle(self):
2132
2158
f"F{ val .instance .xtalform .xtalform_num } "
2133
2159
+ f"{ val .instance .xtalform_site_num } "
2134
2160
)
2135
- so_list = [
2136
- site_observation_objects [k ].instance for k in val .index_data ["residues" ]
2137
- ]
2161
+
2162
+ so_list = []
2163
+ for k in val .index_data ["residues" ]:
2164
+ try :
2165
+ so_list .append (site_observation_objects [k ].instance )
2166
+ except KeyError as exc :
2167
+ # this is something that started happening, people
2168
+ # removing experiments. check if exists:
2169
+ # the key looks something like A71EV2A-x4922/A/201/5
2170
+ exp_code = k .split ("/" )[0 ]
2171
+ if exp_code not in experiment_objects .keys ():
2172
+ # this is the root cause, that's the situation
2173
+ # that's been happening
2174
+ self .report .log (
2175
+ logging .ERROR ,
2176
+ f"Experiment { exp_code } missing from { METADATA_FILE } " ,
2177
+ )
2178
+ else :
2179
+ # this has not, handling it just in case
2180
+ self .report .log (
2181
+ logging .ERROR ,
2182
+ f"SiteObservation { k } missing from { METADATA_FILE } " ,
2183
+ )
2138
2184
tag = val .versioned_key
2139
2185
try :
2140
2186
# remove protein name and 'x'
0 commit comments