diff --git a/src/bundles/pdb/src/__init__.py b/src/bundles/pdb/src/__init__.py
index af759f8..7a83083 100644
|
a
|
b
|
from .pdb import process_chem_name, format_nonstd_res_info
|
| 17 | 17 | |
| 18 | 18 | from chimerax.core.toolshed import BundleAPI |
| 19 | 19 | |
| | 20 | def _fetch_wrapper_dummy(fetch_func): |
| | 21 | def fetch(session, pdb_id, fetch_source='rcsb', ignore_cache=False, |
| | 22 | structure_factors=False, over_sampling=1.5, **kw): |
| | 23 | if structure_factors: |
| | 24 | from chimerax.core.errors import UserError |
| | 25 | raise UserError('Loading structure factors requires the ChimeraX-Clipper plugin ' |
| | 26 | 'available from the Tool Shed.') |
| | 27 | return fetch_func(session, pdb_id, ignore_cache=ignore_cache, **kw) |
| | 28 | return fetch |
| | 29 | |
| 20 | 30 | class _PDBioAPI(BundleAPI): |
| 21 | 31 | |
| 22 | 32 | from chimerax.core.commands import EnumOf |
| … |
… |
class _PDBioAPI(BundleAPI):
|
| 29 | 39 | # returns (list of models, status message) |
| 30 | 40 | from . import pdb |
| 31 | 41 | fetcher = pdb.fetch_pdb_pdbe if database_name == "pdbe" else pdb.fetch_pdb |
| 32 | | return fetcher(session, identifier, ignore_cache=ignore_cache, **kw) |
| | 42 | try: |
| | 43 | from chimerax.clipper.io import fetch_cif |
| | 44 | return fetch_cif.fetch_wrapper(fetcher)(session, identifier, ignore_cache=ignore_cache, **kw) |
| | 45 | except ImportError: |
| | 46 | return _fetch_wrapper_dummy(fetcher)(session, identifier, ignore_cache=ignore_cache, **kw) |
| | 47 | |
| | 48 | # return fetcher(session, identifier, ignore_cache=ignore_cache, **kw) |
| 33 | 49 | |
| 34 | 50 | @staticmethod |
| 35 | 51 | def open_file(session, stream, file_name, *, auto_style=True, coordsets=False, atomic=True, |
| 36 | | max_models=None, log_info=True, combine_sym_atoms=True): |
| | 52 | max_models=None, log_info=True, combine_sym_atoms=True, |
| | 53 | structure_factors=False, over_sampling=None): |
| 37 | 54 | # 'open_file' is called by session code to open a file |
| 38 | 55 | # returns (list of models, status message) |
| | 56 | if structure_factors or over_sampling: |
| | 57 | from chimerax.core.errors import UserError |
| | 58 | raise UserError('structureFactors and overSampling arguments are only ' |
| | 59 | 'valid when fetching models from an online database.') |
| 39 | 60 | from . import pdb |
| 40 | 61 | return pdb.open_pdb(session, stream, file_name, auto_style=auto_style, |
| 41 | 62 | coordsets=coordsets, atomic=atomic, max_models=max_models, log_info=log_info, |