Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird bug in selection denominators #89

Open
ebrintn opened this issue Mar 21, 2024 · 0 comments
Open

Weird bug in selection denominators #89

ebrintn opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ebrintn
Copy link
Collaborator

ebrintn commented Mar 21, 2024

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 ebrintn added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant