tanghaibao / goatools

Python library to handle Gene Ontology (GO) terms
BSD 2-Clause "Simplified" License
781 stars 210 forks source link

TypeError when running runs.sh (Python 3.5) #136

Closed tanghaibao closed 5 years ago

tanghaibao commented 5 years ago

Received from user ichrak cchouarfia


Dear Dr Tang, Many thanks for providing us with the goatools software, I am interested by Gene Ontology, I installed it but when testing the package by executing run.sh, I had these errors, please let me know where is the problem ?

I'll happy to use this tool, Thanks in advance. Best regards Ichrak

select the test from below
1) Test enrichment             3) Test mapslim
2) Test plotting go terms      4) Test mapslim on assocation
#? 1
go-basic.obo: fmt(1.2) rel(2019-07-01) 47,413 GO Terms
HMS:0:00:01.174755 128,975 annotations READ: data/association
Study: 276 vs. Population 33239

Load BP Gene Ontology Analysis ...
Propagating term counts up: is_a
 87% 28,991 of 33,239 population items found in association

Load CC Gene Ontology Analysis ...
Propagating term counts up: is_a
 86% 28,574 of 33,239 population items found in association

Load MF Gene Ontology Analysis ...
Propagating term counts up: is_a
 87% 28,910 of 33,239 population items found in association

Run BP Gene Ontology Analysis: current study set of 276 IDs ...
 86%    237 of    276 study items found in association
100%    276 of    276 study items found in population(33239)
Calculating 3,486 uncorrected p-values using fisher
       0 GO terms are associated with      0 of 33,239 population items
   3,020 GO terms are associated with      0 of    276 study items
  METHOD bonferroni:
       3 GO terms found significant (< 0.05=alpha) (  3 enriched +   0
purified): local bonferroni
      33 study items associated with significant GO IDs (enriched)
       0 study items associated with significant GO IDs (purified)
  METHOD sidak:
       3 GO terms found significant (< 0.05=alpha) (  3 enriched +   0
purified): local sidak
      33 study items associated with significant GO IDs (enriched)
       0 study items associated with significant GO IDs (purified)
  METHOD holm:
       3 GO terms found significant (< 0.05=alpha) (  3 enriched +   0
purified): local holm
      33 study items associated with significant GO IDs (enriched)
       0 study items associated with significant GO IDs (purified)
Traceback (most recent call last):
  File "scripts/find_enrichment.py", line 44, in <module>
    main()
  File "scripts/find_enrichment.py", line 31, in main
    obj = GoeaCliFnc(GoeaCliArgs().args)
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/cli/find_enrichment.py",
line 233, in __init__
    self.results_all = self.objgoeans.run_study(_study)
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/goea/go_enrichment_ns.py",
line 20, in run_study
    ns2results = {ns:o.run_study(study_ids) for ns, o in
sorted(self.ns2objgoea.items())}
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/goea/go_enrichment_ns.py",
line 20, in <dictcomp>
    ns2results = {ns:o.run_study(study_ids) for ns, o in
sorted(self.ns2objgoea.items())}
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/go_enrichment.py",
line 312, in run_study
    self._run_multitest_corr(results, methods, alpha, study, log)
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/go_enrichment.py",
line 395, in _run_multitest_corr
    self._run_multitest[nt_method.source](ntmt)
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/go_enrichment.py",
line 427, in _run_multitest_statsmodels
    multipletests = self.methods.get_statsmodels_multipletests()
  File "/usr/local/lib/python3.5/dist-packages/goatools-0.9.7-py3.5.egg/goatools/multiple_testing.py",
line 142, in get_statsmodels_multipletests
    from statsmodels.sandbox.stats.multicomp import multipletests
  File "/usr/local/lib/python3.5/dist-packages/statsmodels/sandbox/__init__.py",
line 4, in <module>
    from statsmodels.tools._testing import PytestTester
  File "/usr/local/lib/python3.5/dist-packages/statsmodels/tools/__init__.py",
line 1, in <module>
    from .tools import add_constant, categorical
  File "/usr/local/lib/python3.5/dist-packages/statsmodels/tools/tools.py",
line 7, in <module>
    import pandas as pd
  File "/usr/local/lib/python3.5/dist-packages/pandas/__init__.py",
line 55, in <module>
    from pandas.core.api import (
  File "/usr/local/lib/python3.5/dist-packages/pandas/core/api.py",
line 5, in <module>
    from pandas.core.arrays.integer import (
  File "/usr/local/lib/python3.5/dist-packages/pandas/core/arrays/__init__.py",
line 1, in <module>
    from .array_ import array  # noqa: F401
  File "/usr/local/lib/python3.5/dist-packages/pandas/core/arrays/array_.py",
line 7, in <module>
    from pandas.core.dtypes.common import (
  File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/common.py",
line 11, in <module>
    from pandas.core.dtypes.dtypes import (
  File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/dtypes.py",
line 53, in <module>
    class Registry:
  File "/usr/local/lib/python3.5/dist-packages/pandas/core/dtypes/dtypes.py",
line 84, in Registry
    self, dtype: Union[Type[ExtensionDtype], str]
  File "/usr/lib/python3.5/typing.py", line 552, in __getitem__
    dict(self.__dict__), parameters, _root=True)
  File "/usr/lib/python3.5/typing.py", line 512, in __new__
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 512, in <genexpr>
    for t2 in all_params - {t1} if not isinstance(t2, TypeVar)):
  File "/usr/lib/python3.5/typing.py", line 1077, in __subclasscheck__
    if super().__subclasscheck__(cls):
  File "/usr/lib/python3.5/abc.py", line 225, in __subclasscheck__
    for scls in cls.__subclasses__():
TypeError: descriptor '__subclasses__' of 'type' object needs an argument
#?
dvklopfenstein commented 5 years ago

Ichrak,

Thank you for interest in GOATOOLS and taking the time to write us. I will examine this tomorrow. Thank you for the detailed logging and full set of the resulting output. Hopefully, we should have you up and running soon.

DV

dvklopfenstein commented 5 years ago

Ichrak, I ran the shell script successfully locally, so then looked into this error:

TypeError: descriptor '__subclasses__' of 'type' object needs an argument

And found this on StackOverflow, which advises upgrading your Python version if your version of Python is 3.5 or below.

Please give that a try. If it does not work, please let us know.

Thank you for your interest exploring Gene Ontology using GOATOOLS.

tanghaibao commented 5 years ago

From Ichrak:

Thank you so much for your help, the problem is solved by upgrading the python version to 3.6.3 and installing the requirements. I really enjoy, Many thanks.