diff --git a/translate2modelcif.py b/translate2modelcif.py index ef2bd8d7447d198e0df60f3c3b6c3e4fa9b984c4..77f93e71f17cf605017b762c1e86d9659f739a6b 100644 --- a/translate2modelcif.py +++ b/translate2modelcif.py @@ -46,9 +46,10 @@ def _parse_args(): + "'<UniProtKB AC>-<UniProtKB AC>'", ) parser.add_argument( - "--rank", type=str, + "--rank", + type=str, default=None, - help="Only process the model with this rank." + help="Only process the model with this rank.", ) parser.add_argument( "--out_dir", @@ -946,12 +947,14 @@ def _main(): config_data = _parse_colabfold_config(cnfg) # iterate model directory + found_ranked = False for fle in sorted(os.listdir(opts.model_dir)): # iterate PDB files if not fle.endswith(".pdb"): continue if opts.rank is not None and f"rank_{opts.rank}" not in fle: continue + found_ranked = True print(f" translating {fle}...") pdb_start = timer() file_prfx, uid = _check_model_extra_files_present(opts.model_dir, fle) @@ -983,6 +986,8 @@ def _main(): ) print(f" ... done with {fle} ({timer()-pdb_start:.2f}s).") + if opts.rank and not found_ranked: + _abort_msg(f"Could not find model of requested rank '{opts.rank}'") print(f"... done with {opts.model_dir}.")