ViennaRNA / ernwin

Sample and predict coarse grain 3D RNA structures
GNU Affero General Public License v3.0
8 stars 5 forks source link

Fix KeyError exception in reconstruction of all-atom structures #8

Closed fncnt closed 1 year ago

fncnt commented 2 years ago

This fixes a KeyError exception caued by a typo:

Running on python 2.7.18 (default, Oct 10 2021, 22:29:32) 
[GCC 11.1.0], the following error occurred:
KeyError: u'reconstruct_cache_dir'
Traceback (most recent call last):
  File "/home/user/ernwin/fess/scripts/ernwin.py", line 110, in main
    run(args, cg, main_dir, reference_cg)
  File "/home/user/ernwin/fess/scripts/ernwin.py", line 139, in run
    sampler = setup_sampler(args, sm, stat_source, sampling_energy, i, reference_cg)
  File "/home/user/ernwin/fess/scripts/ernwin.py", line 215, in setup_sampler
    monitor = fbm.from_args(args, original_cg, sampling_energy, stat_source, out_dir, show_min_rmsd)
  File "/home/user/ernwin/fess/builder/monitor.py", line 1091, in from_args
    output_directory=out_dir, options=options, args=args)
  File "/home/user/ernwin/fess/builder/monitor.py", line 884, in __init__
    self.options["reconstruct_cache_dir"])
KeyError: u'reconstruct_cache_dir'

Steps to reproduce

  1. Setup ernwin to reconstruct all-atom structures
  2. Follow the tutorial but include the reconstruction options:
    ernwin.py 2mis.fa --source-cg-dir CGS_DIR --source-pdb-dir PDB_DIR --reconstruct-every-n 100 --reconstruction-cache-dir CACHE_DIR

Fix

The solution consists of adjusting the relevant key in the options dictionary in monitor.py. The reconstructor is constructed using the key reconstruct_cache_dir which did not exist (cf. this line).

Bernhard10 commented 1 year ago

Thanks for the fix.