File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,11 +56,14 @@ def _prune_records(fhandle: TextIO) -> Generator[str]:
5656 "HSD" : "HIS" ,
5757 }
5858
59- for record in fhandle :
59+ for i , record in enumerate ( fhandle ) :
6060 resname = record [_RESNAME_COLS ]
61- if record .startswith (atomic_record ) and resname != water :
61+ if record .startswith (atomic_record ) and resname != water and i not in _find_low_occ_records (fhandle ):
62+ # TODO: if within a single file mixed residue nomenclature is used, it is not detected by _find_low_occ_records
63+ # probably fix this by running these in separate functions rather than all at once.
6264 standardized_resname = standard_resnames .get (resname , resname )
63- yield record [:17 ] + standardized_resname + record [20 :]
65+ record = record [: _RESNAME_COLS .start ] + standardized_resname + record [_RESNAME_COLS .stop :] # noqa: PLW2901
66+ yield record
6467
6568
6669def _find_low_occ_records (pdb : list [str ]) -> list [int ]:
You can’t perform that action at this time.
0 commit comments