I was hoping someone here might be able to help me. I am using the python library gseapy for enrichment analysis using enrichr. I have a pandas series with some gene names with the following values:

I keep running into a Key Error that tells me that there is a problem with the 'Adjusted P-values', but I don't necessarily know where to fix this problem. The error I'm getting is as follows:

~/venv/lib/python3.7/site-packages/gseapy/enrichr.py in run(self)
418 top_term=self.__top_term, color="salmon",
419 title=self._gs,
--> 420 ofname=outfile.replace("txt", self.format))
421 if msg is not None : self._logger.warning(msg)
422 self._logger.info('Done.n')

~/venv/lib/python3.7/site-packages/gseapy/plot.py in barplot(df,
column, title, cutoff, top_term, figsize, color, ofname, **kwargs)
498 if colname in ['Adjusted P-value', 'P-value']:
499 # check if any values in df[colname] can't be coerced to floats
--> 500 can_be_coerced = df[colname].map(isfloat)
501 if np.sum(~can_be_coerced) > 0:
502 raise ValueError('some value in %s could not be typecast to float'%colname)

/shared-libs/python3.7/py/lib/python3.7/site-packages/pandas/core/frame.py
in __getitem__(self, key) 3022 if self.columns.nlevels

1: 3023 return self._getitem_multilevel(key)
-> 3024 indexer = self.columns.get_loc(key) 3025 if is_integer(indexer): 3026 indexer = [indexer]

/shared-libs/python3.7/py/lib/python3.7/site-packages/pandas/core/indexes/base.py
in get_loc(self, key, method, tolerance) 3080
return self._engine.get_loc(casted_key) 3081 except
KeyError as err:
-> 3082 raise KeyError(key) from err 3083 3084 if tolerance is not None:

KeyError: 'Adjusted P-value'



Source link