Showing
3 changed files
with
14 additions
and
1 deletions
... | @@ -2488,7 +2488,20 @@ def work_mmcif(pdb_id): | ... | @@ -2488,7 +2488,20 @@ def work_mmcif(pdb_id): |
2488 | # if not, read the CIF header and register the structure | 2488 | # if not, read the CIF header and register the structure |
2489 | if not len(r): | 2489 | if not len(r): |
2490 | # Load the MMCIF file with Biopython | 2490 | # Load the MMCIF file with Biopython |
2491 | - mmCif_info = pdb.MMCIF2Dict.MMCIF2Dict(final_filepath) | 2491 | + try: |
2492 | + mmCif_info = pdb.MMCIF2Dict.MMCIF2Dict(final_filepath) | ||
2493 | + except ValueError: | ||
2494 | + # mmcif file is empty or wrong. This happens when you interrupt RNANet while it | ||
2495 | + # downloads. Retry to download it properly. | ||
2496 | + subprocess.run( | ||
2497 | + ["wget", f'http://files.rcsb.org/download/{pdb_id}.cif', "-O", final_filepath], | ||
2498 | + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL | ||
2499 | + ) | ||
2500 | + try: | ||
2501 | + mmCif_info = pdb.MMCIF2Dict.MMCIF2Dict(final_filepath) | ||
2502 | + except ValueError: | ||
2503 | + warn(f"Empty or wrong {final_filepath.split('/')[-1]} file. Ignoring this structure.") | ||
2504 | + return 1 | ||
2492 | 2505 | ||
2493 | # Get info about that structure | 2506 | # Get info about that structure |
2494 | try: | 2507 | try: | ... | ... |
known_issues.txt
0 → 100644
This diff is collapsed. Click to expand it.
known_issues_reasons.txt
0 → 100644
This diff could not be displayed because it is too large.
-
Please register or login to post a comment