If I run the following script with this CIF file:
from pathlib import Path
import gemmi
def load_structure(cif_path: Path):
block: gemmi.cif.Block = gemmi.cif.read(str(cif_path))[0]
structure: gemmi.Structure = gemmi.make_structure_from_block(block)
structure.remove_waters()
structure.transform_to_assembly(
assembly_name="1",
how=gemmi.HowToNameCopiedChain.Dup,
)
return structure
load_structure(Path("./1AK5.cif"))
On 0.6.5 the file loads successfully, but on 0.7.5 I get RuntimeError: no subchain C:
root@devbox-jack:/workspaces/models# uv pip install gemmi==0.6.5 && python gemmi_test.py
Using Python 3.11.15 environment at: /opt/venv
Audited 1 package in 3ms
root@devbox-jack:/workspaces/models# uv pip install gemmi==0.7.5 && python gemmi_test.py
Using Python 3.11.15 environment at: /opt/venv
Resolved 1 package in 1ms
Uninstalled 1 package in 1ms
Installed 1 package in 8ms
- gemmi==0.6.5
+ gemmi==0.7.5
Traceback (most recent call last):
File "/workspaces/models/gemmi_test.py", line 17, in <module>
load_structure(Path("./1AK5.cif"))
File "/workspaces/models/gemmi_test.py", line 10, in load_structure
structure.transform_to_assembly(
RuntimeError: no subchain C
Note that if I change the order of removing the waters and transforming assembly, the test case also passes on 0.7.5:
from pathlib import Path
import gemmi
def load_structure(cif_path: Path):
block: gemmi.cif.Block = gemmi.cif.read(str(cif_path))[0]
structure: gemmi.Structure = gemmi.make_structure_from_block(block)
structure.transform_to_assembly(
assembly_name="1",
how=gemmi.HowToNameCopiedChain.Dup,
)
structure.remove_waters() # N.B. order changed!
return structure
load_structure(Path("./1AK5.cif"))
Is this change expected? What is the "right" order to call these operations in?
If I run the following script with this CIF file:
On
0.6.5the file loads successfully, but on0.7.5I getRuntimeError: no subchain C:Note that if I change the order of removing the waters and transforming assembly, the test case also passes on
0.7.5:Is this change expected? What is the "right" order to call these operations in?