diff --git a/layer3/Executive.cpp b/layer3/Executive.cpp index 8f61a049c..dcbacc726 100644 --- a/layer3/Executive.cpp +++ b/layer3/Executive.cpp @@ -3693,6 +3693,7 @@ ExecutiveLoadPrepareArgs(PyMOLGlobals * G, case cLoadTypeSDF2Str: case cLoadTypeXYZStr: case cLoadTypeDXStr: + case cLoadTypeBCIFStr: if (!content) { return pymol::Error("content is nullptr"); } @@ -3715,6 +3716,7 @@ ExecutiveLoadPrepareArgs(PyMOLGlobals * G, case cLoadTypeSDF2: case cLoadTypeXYZ: case cLoadTypeDXMap: + case cLoadTypeBCIF: if (content) { fname_null_ok = true; break; diff --git a/modules/pymol/constants.py b/modules/pymol/constants.py index 4d7ca8e24..dc19cdebc 100644 --- a/modules/pymol/constants.py +++ b/modules/pymol/constants.py @@ -84,7 +84,8 @@ def _reverse_lookup(cls, number): loadable.map : loadable.mapstr, loadable.dx : loadable.dxstr, loadable.xyz : loadable.xyzstr, - loadable.sdf2 : loadable.sdf2str} + loadable.sdf2 : loadable.sdf2str, + loadable.bcif : loadable.bcifstr} sanitize_alpha_list_re = re.compile(r"[^a-zA-Z0-9_\'\"\.\-\[\]\,]+") nt_hidden_path_re = re.compile(r"\$[\/\\]") diff --git a/modules/pymol/importing.py b/modules/pymol/importing.py index b6abd61cf..da323aa02 100644 --- a/modules/pymol/importing.py +++ b/modules/pymol/importing.py @@ -91,6 +91,9 @@ def filename_to_format(filename): format = 'cif' elif ext in ('bcif',): format = 'bcif' + elif ext in ('bcifgz',): + format = 'bcif' + zipped = 'gz' elif re.match(r'pdb\d+$', ext): format = 'pdb' elif re.match(r'xyz_\d+$', ext): diff --git a/testing/data/115d.bcif.gz b/testing/data/115d.bcif.gz new file mode 100644 index 000000000..08a37fcde Binary files /dev/null and b/testing/data/115d.bcif.gz differ diff --git a/testing/tests/api/test_importing.py b/testing/tests/api/test_importing.py new file mode 100644 index 000000000..6a34c2c52 --- /dev/null +++ b/testing/tests/api/test_importing.py @@ -0,0 +1,8 @@ +from pymol import cmd +from pymol import test_utils + + +@test_utils.requires_version("3.0") +def test_bcif(): + cmd.load(test_utils.datafile("115d.bcif.gz")) + assert cmd.count_atoms() == 407