diff --git a/src/bundles/mmcif/src/mmcif.py b/src/bundles/mmcif/src/mmcif.py
index 2531678e5..f58e1fe68 100644
|
a
|
b
|
_mmcif_sources = {
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
| 274 | | def fetch_mmcif(session, pdb_id, fetch_source="rcsb", ignore_cache=False, **kw): |
| | 274 | def fetch_mmcif(session, pdb_id, fetch_source="rcsb", ignore_cache=False, |
| | 275 | structure_factors = False, over_sampling = 1.5, # for ChimeraX-Clipper plugin |
| | 276 | **kw): |
| 275 | 277 | """Get mmCIF file by PDB identifier via the Internet""" |
| 276 | 278 | if not _initialized: |
| 277 | 279 | _initialize() |
| 278 | 280 | |
| 279 | 281 | if len(pdb_id) != 4: |
| 280 | 282 | raise UserError('PDB identifiers are 4 characters long, got "%s"' % pdb_id) |
| | 283 | if structure_factors: |
| | 284 | try: |
| | 285 | from chimerax.clipper.io import fetch_cif |
| | 286 | except ImportError: |
| | 287 | raise UserError('Working with structure factors requires the ' |
| | 288 | 'ChimeraX_Clipper plugin, available from the Tool Shed') |
| | 289 | |
| 281 | 290 | import os |
| 282 | 291 | pdb_id = pdb_id.lower() |
| 283 | 292 | filename = None |
| … |
… |
def fetch_mmcif(session, pdb_id, fetch_source="rcsb", ignore_cache=False, **kw):
|
| 314 | 323 | session.logger.status("Opening mmCIF %s" % (pdb_id,)) |
| 315 | 324 | from chimerax.core import io |
| 316 | 325 | models, status = io.open_data(session, filename, format='mmcif', name=pdb_id, **kw) |
| | 326 | if structure_factors: |
| | 327 | sf_file = fetch_cif.fetch_structure_factors(session, pdb_id, fetch_source=fetch_source, |
| | 328 | ignore_cache=ignore_cache) |
| | 329 | from chimerax.clipper import get_map_mgr |
| | 330 | mmgr = get_map_mgr(models[0], create=True) |
| | 331 | if over_sampling < 1: |
| | 332 | warn_str = ('Map over-sampling rate cannot be less than 1. Resetting to 1.0') |
| | 333 | session.logger.warning(warn_str) |
| | 334 | over_sampling = 1 |
| | 335 | mmgr.add_xmapset_from_file(sf_file, oversampling_rate=over_sampling) |
| | 336 | return [mmgr.crystal_mgr], status |
| 317 | 337 | return models, status |
| 318 | 338 | |
| 319 | 339 | |