aberystwythsystemsbiology / pymean Goto Github PK
View Code? Open in Web Editor NEWA Python package for metabolite enrichment analysis.
License: GNU General Public License v3.0
A Python package for metabolite enrichment analysis.
License: GNU General Public License v3.0
Hello,
I run the commands with my data like your template. However, I have faced with this errors. Could you please help me to solve my problem?
KeyError Traceback (most recent call last)
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\indexes\base.py:3803, in Index.get_loc(self, key, method, tolerance)
3802 try:
-> 3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
File ~\anaconda3\envs\torch\lib\site-packages\pandas_libs\index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()
File ~\anaconda3\envs\torch\lib\site-packages\pandas_libs\index.pyx:165, in pandas._libs.index.IndexEngine.get_loc()
File pandas_libs\hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas_libs\hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'fdr_bh adj. p-value'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In [28], line 1
----> 1 plot_enrichment_analysis_results(results, "fdr_bh")
Cell In [27], line 2, in plot_enrichment_analysis_results(results, adj_method)
1 def plot_enrichment_analysis_results(results: pd.DataFrame, adj_method:str):
----> 2 fold_enrichment = np.abs(np.log(results["%s adj. p-value" % (adj_method)]))
3 plt.figure()
4 plt.title("Metabolite Sets Enrichment Overview")
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\frame.py:3804, in DataFrame.getitem(self, key)
3802 if self.columns.nlevels > 1:
3803 return self._getitem_multilevel(key)
-> 3804 indexer = self.columns.get_loc(key)
3805 if is_integer(indexer):
3806 indexer = [indexer]
File ~\anaconda3\envs\torch\lib\site-packages\pandas\core\indexes\base.py:3805, in Index.get_loc(self, key, method, tolerance)
3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
-> 3805 raise KeyError(key) from err
3806 except TypeError:
3807 # If we have a listlike key, _check_indexing_error will raise
3808 # InvalidIndexError. Otherwise we fall through and re-raise
3809 # the TypeError.
3810 self._check_indexing_error(key)
KeyError: 'fdr_bh adj. p-value'
p_value = 1-hypergeom.cdf(
num_hits-1,
population-num_dbids,
num_cpds,
num_dbids)
According to scipy doc: cdf or sf take for argument : (k, M, n, N, loc=0)
where M is the total number of objects (and not n=N-m like in R phyper
, so here it should be the population.
Also the fisher_exact
test could take an alternative
param 'greater' so that both p-value would be the same, as Fischer is based on hypergeometric distribution.
I hope this package is still maintain :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.