dekoning-lab / slim-tree

4 stars 1 forks source link

Weird bug in selection denominators #89

Open ebrintn opened 6 months ago

ebrintn commented 6 months ago

Every once in a while I get this, I can rerun and it works but I think that there may be an issue somewhere in calculating the selection denominators

Traceback (most recent call last): File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexes/range.py", line 355, in get_loc return self._range.index(new_key) ValueError: 49 is not in range

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/erin.brintnell/slim-tree/main.py", line 5, in SLiMTree() File "/home/erin.brintnell/slim-tree/SLiMTree.py", line 26, in init start_params = self.process_fitness(start_params) File "/home/erin.brintnell/slim-tree/SLiMTree.py", line 100, in process_fitness start_params["fitness_profile_nums"], start_params["mutation_rate"], start_params["mutation_matrix"]) File "/home/erin.brintnell/slim-tree/utils/calculateSelectionDenominators.py", line 34, in init self.dN_denom, self.dS_denom = self.calculate_selection_denominators(fitness_profile_nums) File "/home/erin.brintnell/slim-tree/utils/calculateSelectionDenominators.py", line 128, in calculate_selection_denominators ds_dn = np.array(list(map(lambda x: self.get_dist_ds_dn(x, num_each_profile.loc[x,1]), ndists))) File "/home/erin.brintnell/slim-tree/utils/calculateSelectionDenominators.py", line 128, in ds_dn = np.array(list(map(lambda x: self.get_dist_ds_dn(x, num_each_profile.loc[x,1]), ndists))) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 873, in getitem return self._getitem_tuple(key) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1044, in _getitem_tuple return self._getitem_lowerdim(tup) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 786, in _getitem_lowerdim section = self._getitem_axis(key, axis=i) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1110, in _getitem_axis return self._get_label(key, axis=axis) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1059, in _get_label return self.obj.xs(label, axis=axis) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 3493, in xs loc = self.index.get_loc(key) File "/home/erin.brintnell/.local/lib/python3.6/site-packages/pandas/core/indexes/range.py", line 357, in get_loc raise KeyError(key) from err KeyError: 49

ebrintn commented 1 month ago

I haven't had for a while - keep it open but low priority.