kmcluskey / FlyMet

A multi-omics web app for Drosophila tissues
MIT License
3 stars 0 forks source link

List index out of range #50

Open joewandy opened 4 years ago

joewandy commented 4 years ago

Not sure why i'm now getting this when accessing the pathway explorer

Traceback (most recent call last):
  File "C:\Users\joewa\.virtualenvs\FlyMet-fLQaCvEH\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
    response = get_response(request)
  File "C:\Users\joewa\.virtualenvs\FlyMet-fLQaCvEH\lib\site-packages\django\core\handlers\base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\views.py", line 622, in pathway_explorer
    view_df, pals_min, pals_mean, pals_max = get_pals_view_data()
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\views.py", line 954, in get_pals_view_data
    pals_df = get_cache_df()
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\pathway_analysis.py", line 61, in get_cache_df
    cache.set('pals_df', get_pals_df(), 60 * 180000)
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\pathway_analysis.py", line 48, in get_pals_df
    ds = get_cache_ds()
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\pathway_analysis.py", line 38, in get_cache_ds
    cache.set('pals_ds', get_pals_ds(), 60 * 180000)
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\pathway_analysis.py", line 26, in get_pals_ds
    fly_exp_design = get_pals_experimenal_design()
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\pathway_analysis.py", line 385, in get_pals_experimenal_design
    control_dict = cmpd_selector.get_list_view_column_names(controls)
  File "C:\Users\joewa\Work\git\FlyMet\met_explore\compound_selection.py", line 234, in get_list_view_column_names
    sample = Sample.objects.filter(group=g)[0]  # Get the first sample of this group.
  File "C:\Users\joewa\.virtualenvs\FlyMet-fLQaCvEH\lib\site-packages\django\db\models\query.py", line 325, in __getitem__
    return qs._result_cache[0]

Exception Type: IndexError at /met_explore/pathway_explorer
Exception Value: list index out of range

Created using the following command on the performance branch:

$ python reset_data.py && python manage.py migrate && python manage.py initialisedb data\tissues_life_stages_no_whole.csv data\67_peak_cmpd_export_1.json data\67_peak_int_export.json

The resulting database and pickled data from running above command is attached.

db.sqlite3.zip

data.zip

kmcluskey commented 4 years ago

I think this is because the controls are hard coded as “Whole_f, Whole_m and Whole_l” and this dataset doesn’t have any Whole_l. I guess this needs to be inputted somewhere or a control column added to the DB? To fix just now the Whole_l could be removed..

joewandy commented 4 years ago

Thanks, I'll leave the other data from slack that has 'Whole_l' to run overnight. Will see tomorrow if that works.

joewandy commented 4 years ago

It works fine now with the other data that has 'Whole_l'. I'll make this part more flexible later, https://github.com/kmcluskey/FlyMet/blob/master/met_explore/pathway_analysis.py#L391-L393, so the controls are configurable from somewhere.