File: test_PDB_binary_cif.py

package info (click to toggle)
python-biopython 1.85%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 126,372 kB
  • sloc: xml: 1,047,995; python: 332,722; ansic: 16,944; sql: 1,208; makefile: 140; sh: 81
file content (25 lines) | stat: -rw-r--r-- 753 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
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
                )
            )