Skip to content

Commit

Permalink
Merge pull request #158 from ihmwg/rebranding
Browse files Browse the repository at this point in the history
Rebrand PDB-Dev to PDB-IHM, add support for BMRbig database
benmwebb authored Nov 26, 2024
2 parents e7a4525 + 3516934 commit 3ceeb43
Showing 7 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/introduction.rst
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ that is compliant with the
`IHMCIF extension <https://github.com/ihmwg/IHMCIF>`_
to the `PDBx/mmCIF dictionary <https://mmcif.wwpdb.org/>`_,
suitable for deposition in the
`PDB-Dev repository <https://pdb-dev.wwpdb.org/>`_. The files are best viewed
`PDB-IHM repository <https://pdb-ihm.org/>`_. The files are best viewed
in a viewer that supports IHMCIF, such as
`UCSF ChimeraX <https://www.cgl.ucsf.edu/chimerax/>`_, although they may be
partially viewable in regular PDBx mmCIF viewers (likely only the atomic
8 changes: 4 additions & 4 deletions examples/validate_pdb_dev.py → examples/validate_pdb_ihm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This example demonstrates the use of the Python IHM library's validator.
# A structure is downloaded from the PDB-Dev database and checked against
# A structure is downloaded from the PDB-IHM database and checked against
# the PDBx and IHM dictionaries for compliance. This validator can be used
# to perform basic integrity checking against any mmCIF dictionary; for an
# example of using it to validate homology models against the ModelCIF
@@ -36,9 +36,9 @@
# Validate a structure against PDBx+IHM.
# A correct structure here should result in no output; an invalid structure
# will result in a ValidatorError Python exception.
# Here, a structure from PDB-Dev (which should be valid) is used.
acc = 'PDBDEV_00000001'
cif = urllib2.urlopen('https://pdb-dev.wwpdb.org/cif/%s.cif' % acc).read()
# Here, a structure from PDB-IHM (which should be valid) is used.
acc = '8zz1'
cif = urllib2.urlopen('https://pdb-ihm.org/cif/%s.cif' % acc).read()

# The encoding for mmCIF files isn't strictly defined, so first try UTF-8
# and if that fails, strip out any non-ASCII characters. This ensures that
4 changes: 2 additions & 2 deletions ihm/__init__.py
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ class System(object):
:param str model_details: Detailed description of the system, like an
abstract.
:param databases: If this system is part of one or more official
databases (e.g. PDB, PDB-Dev, SwissModel), details of
databases (e.g. PDB, SwissModel), details of
the database identifiers.
:type databases: sequence of :class:`Database`
"""
@@ -690,7 +690,7 @@ class Database(object):
"""Information about a System that is part of an official database.
If a :class:`System` is part of one or more official databases
(e.g. PDB, PDB-Dev, SwissModel), this class contains details of the
(e.g. PDB, SwissModel), this class contains details of the
database identifiers. It should be passed to the :class:`System`
constructor.
11 changes: 11 additions & 0 deletions ihm/location.py
Original file line number Diff line number Diff line change
@@ -100,6 +100,10 @@ class PDBLocation(DatabaseLocation):

class PDBDevLocation(DatabaseLocation):
"""Something stored in the PDB-Dev database.
This should only be used for legacy entries. All former PDB-Dev entries
(now PDB-IHM) should now have PDB identifiers; use :class:`PDBLocation`
instead.
See :class:`DatabaseLocation` for a description of the parameters
and :class:`Location` for discussion of the usage of these objects."""
db_name = 'PDB-Dev'
@@ -189,6 +193,13 @@ class ProteomeXchangeLocation(DatabaseLocation):
db_name = 'ProteomeXchange'


class BMRbigLocation(DatabaseLocation):
"""Something stored in the BMRbig database.
See :class:`DatabaseLocation` for a description of the parameters
and :class:`Location` for discussion of the usage of these objects."""
db_name = 'BMRbig'


class FileLocation(Location):
"""Base class for an individual file or directory stored externally.
2 changes: 1 addition & 1 deletion ihm/model.py
Original file line number Diff line number Diff line change
@@ -459,7 +459,7 @@ def _write_frame(self, x, y, z):
b'Produced by python-ihm, https://github.com/ihmwg/python-ihm',
b'This file is designed to be used in combination with an '
b'mmCIF file',
b'See PDB-Dev at https://pdb-dev.wwpdb.org/ for more details']
b'See PDB-IHM at https://pdb-ihm.org/ for more details']
self._write_header(self.ncoord, remarks)
else:
if len(x) != self.ncoord:
4 changes: 2 additions & 2 deletions test/test_examples.py
Original file line number Diff line number Diff line change
@@ -24,11 +24,11 @@ class Tests(unittest.TestCase):
@unittest.skipIf('APPVEYOR' in os.environ,
"AppVeyor environments have old SSL certs")
@unittest.skipIf('GITHUB_ACTIONS' in os.environ,
"Example is slow and fails when PDB-Dev is down")
"Example is slow and fails when PDB-IHM is down")
def test_validator_example(self):
"""Test validator example"""
subprocess.check_call([sys.executable,
get_example_path("validate_pdb_dev.py")])
get_example_path("validate_pdb_ihm.py")])

def test_simple_docking_example(self):
"""Test simple-docking example"""
9 changes: 9 additions & 0 deletions test/test_location.py
Original file line number Diff line number Diff line change
@@ -123,6 +123,15 @@ def test_proteome_xchange_location(self):
self.assertEqual(d.version, 1)
self.assertEqual(d.details, 'foo')

def test_bmr_big_location(self):
"""Test BMRbigLocation class"""
d = ihm.location.BMRbigLocation(
'abc', version=1, details='foo')
self.assertEqual(d.db_name, 'BMRbig')
self.assertEqual(d.access_code, 'abc')
self.assertEqual(d.version, 1)
self.assertEqual(d.details, 'foo')

def test_empiar_location(self):
"""Test EMPIARLocation class"""
d = ihm.location.EMPIARLocation('abc', version=1, details='foo')

0 comments on commit 3ceeb43

Please sign in to comment.