Skip to content

Commit

Permalink
fix res dict building
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-hh committed Nov 15, 2024
1 parent 994366b commit 13e8203
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bio_datasets/structure/residue.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def from_ccd(
chem_component_3to1 = get_component_3to1()
chem_component_categories = get_component_categories(get_component_types())
frequencies = get_residue_frequencies()
res_names = np.unique(ccd_data["chem_comp_atom"]["comp_id"].as_array(str))
res_names = list(np.unique(ccd_data["chem_comp_atom"]["comp_id"].as_array(str)))

def keep_res(res_name):
res_filter = frequencies.get(res_name, 0) >= minimum_pdb_entries
Expand All @@ -326,6 +326,9 @@ def keep_res(res_name):
res_filter = res_filter and (
keep_hydrogens or res_name not in ["H", "D", "D8U"]
)
res_filter = res_filter and (
res_name in chem_component_3to1 and res_name in chem_component_categories
)
return res_filter

res_names = [res for res in res_names if keep_res(res)]
Expand Down

0 comments on commit 13e8203

Please sign in to comment.