pdbtbx
pdbtbx copied to clipboard
Add ReadOptions implementation
This is to address #125, where we pass in ReadOptions
to the open()
functions instead of just StrictnessLevel
for future extensibility.
- [x] PDB parser with
ReadOptions
- [x] mmCIF parser with
ReadOptions
- [x] Route to
open_gz
whenoptions.decompress
is true - [x] Remove hydrogens from the model when
options.discard_hydrogens
is true - [x] Skip other models when
options.only_first_model
is true - [x] Only parse
ATOM
records whenoptions.only_atomic_coords
is true
Some things up for discussion:
- What is the intention of
capitalise_chains
? If I recall correctly all uppercase letters, lowercase letters, and numbers are valid chain identifiers. - Can I modify the signatures of
open_pdb_raw
andopen_mmcif_raw
? They are public functions but it seems they are only meant to be called byopen_pdb
andopen_mmcif
. If we maintainopen_pdb_raw_with_options
andopen_mcif_raw_with_options
there's going to be a lot of duplicated code (or we extract common methods into another core function).