Files
biopython/Tests/test_PDB_binary_cif.py
Will Tyler 4fe6640e46 Add BinaryCIF parser (#4707)
Also fixes a structure comparison bug
2024-06-11 04:35:46 +01:00

26 lines
753 B
Python

"""
Tests for BinaryCIF code in the PDB package.
"""
import unittest
from Bio.PDB import MMCIFParser
from Bio.PDB.binary_cif import BinaryCIFParser
class TestBinaryCIFParser(unittest.TestCase):
def test_get_structure(self):
mmcif_parser = MMCIFParser(auth_chains=False)
bcif_parser = BinaryCIFParser()
for entry in ["1GBT", "6WG6", "3JQH"]:
mmcif_structure = mmcif_parser.get_structure(entry, f"PDB/{entry}.cif")
bcif_structure = bcif_parser.get_structure(
entry, f"PDB/{entry.lower()}.bcif.gz"
)
self.assertTrue(
mmcif_structure.strictly_equals(
bcif_structure, compare_coordinates=True
)
)