flatironinstitute / inferelator

Task-based gene regulatory network inference using single-cell or bulk gene expression data conditioned on a prior network.
BSD 2-Clause "Simplified" License
46 stars 12 forks source link

Unhashable type: 'Index' #49

Closed spficklin closed 2 years ago

spficklin commented 2 years ago

When running Inferelator I get the following:

~/.local/lib/python3.9/site-packages/inferelator/amusr_workflow.py in _gene_names(self)
     73     def _gene_names(self):
     74         if self._task_objects is not None:
---> 75             return set().union([t if t is not None else [] for t in map(lambda x: x.data.gene_names, self._task_objects)])
     76         else:

TypeError: unhashable type: 'Index'

I'm using Python3. I can fix the problem by changing this line

https://github.com/flatironinstitute/inferelator/blob/2a33c741c4ba7a6bf3d18a3c14d583af0e0705e8/inferelator/amusr_workflow.py#L75

To this:

   return set(pd.concat([t if t is not None else [] for t in map(lambda x: pd.Series(x.data.gene_names), self._task_objects)]).drop_duplicates())
asistradition commented 2 years ago

Good catch, thanks.

The dev branch is currently failing testing (due to changes in how some of the indexing is handled in dependencies), so I'm going to merge a fix into release and cut a minor version update. Otherwise this will wait until I get around to fixing dev, which should happen sometime in the next six months unless it doesn't.

asistradition commented 2 years ago

Aight, should be fixed and released as v0.5.8. Let me know if there are any other problems.

Thanks!

spficklin commented 2 years ago

Thank you!