Jhsmit / PyHDX

Derive ΔG for single residues from HDX-MS data
http://pyhdx.readthedocs.io
MIT License
28 stars 12 forks source link

Single and Batch fit losses result doesnt mix (or can be concatenated) #286

Closed Jhsmit closed 2 years ago

Jhsmit commented 2 years ago

Not sure yet how to reproduce exactly but it seems to be an issue where users have a single fit already done and then add a batch fit

Traceback:

Traceback (most recent call last):
  File "C:\Users\jhs\Miniconda3\envs\py38_pyhdx_040\lib\site-packages\tornado\ioloop.py", line 741, in _run_callback
    ret = callback()
  File "C:\Users\jhs\Miniconda3\envs\py38_pyhdx_040\lib\site-packages\tornado\ioloop.py", line 765, in _discard_future_result
    future.result()
  File "C:\Users\jhs\Miniconda3\envs\py38_pyhdx_040\lib\site-packages\panel\io\server.py", line 116, in wrapper
    return await func(*args, **kw)
  File "C:\Users\jhs\Programming\pyhdx_stable\pyhdx\web\controllers.py", line 1299, in _batch_fit
    self.src.add(result, name)
  File "C:\Users\jhs\Programming\pyhdx_stable\pyhdx\web\sources.py", line 82, in add
    self._add_dG_fit(obj, name)
  File "C:\Users\jhs\Programming\pyhdx_stable\pyhdx\web\sources.py", line 168, in _add_dG_fit
    self._add_table(df, "loss")
  File "C:\Users\jhs\Programming\pyhdx_stable\pyhdx\web\sources.py", line 207, in _add_table
    new.columns = multiindex_astype(new.columns, 0, "category")
  File "C:\Users\jhs\Programming\pyhdx_stable\pyhdx\support.py", line 117, in multiindex_astype
    new_index = multiindex_apply_function(index, level, "astype", args=[dtype])
  File "C:\Users\jhs\Programming\pyhdx_stable\pyhdx\support.py", line 77, in multiindex_apply_function
    new_index = index.set_levels(
AttributeError: 'Index' object has no attribute 'set_levels'