Code Monkey home page Code Monkey logo

pymean's People

Contributors

keirono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wudangbio hcji

pymean's Issues

I have problem plot out my result?

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'

Hypergeometric test from scipy does not have the right parameters fed

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 :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.