Python program "genipe" - TypeError: __init__() got an unexpected keyword argument 'normalize'

Python program "genipe" - TypeError: __init__() got an unexpected keyword argument 'normalize'

我正在尝试 运行 程序 genipe 进行一些全基因组生存分析。我已经安装了 genipe 和所有相关目录。但是,当我转到 运行 程序时出现错误:

"TypeError: _ init _() got an unexpected keyword argument 'normalize'"

我没有编辑任何 genipe 脚本,而且我 运行 genipe 在不同的服务器上没有问题,所以我不确定出了什么问题!任何帮助将不胜感激。

非常感谢,

卡拉

编辑: 我正在使用 python 版本 3.6.1

回溯如下:

Traceback (most recent call last):
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 965, in process_impute2_site
    use_ml=site_info.use_ml,
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 1048, in fit_cox
    cf = CoxPHFitter(alpha=0.95, tie_method="Efron", normalize=False)
TypeError: __init__() got an unexpected keyword argument 'normalize'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 811, in compute_statistics
    for result in pool.map(process_impute2_site, sites_to_process):
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 260, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 608, in get
    raise self._value
TypeError: __init__() got an unexpected keyword argument 'normalize'

[2017-05-31 14:18:53 ERROR] __init__() got an unexpected keyword argument 'normalize'
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 965, in process_impute2_site
    use_ml=site_info.use_ml,
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 1048, in fit_cox
    cf = CoxPHFitter(alpha=0.95, tie_method="Efron", normalize=False)
TypeError: __init__() got an unexpected keyword argument 'normalize'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/bin/imputed-stats", line 11, in <module>
    sys.exit(main())
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 161, in main
    options=args,
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/site-packages/genipe/tools/imputed_stats.py", line 811, in compute_statistics
    for result in pool.map(process_impute2_site, sites_to_process):
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 260, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/users/k1640238/miniconda/envs/genipe_pyvenv/lib/python3.6/multiprocessing/pool.py", line 608, in get
    raise self._value
TypeError: __init__() got an unexpected keyword argument 'normalize'

根据 lifeline changelog this keyword argument has been removed from this particular function. Lifeline is a package which contains this particular function and is used by genipe 判断。

您可以自己安装以前版本的生命线,看看是否有帮助,或者等待 genipe 库的更新。

从您的评论中查看更多错误,似乎 this is problematic code。您正在尝试使用 dmatrices,但它似乎未定义。可能是因为提到的 try/catch 块找不到 statsmodel 安装,因此 patsy 也没有导入。

尝试从

开始手动安装更多软件包

然后看看您是否会遇到任何错误...

参见上面勘误表的回答,我使用了一些依赖项的错误版本,但即便如此,程序仍然给我错误。然而,当我恢复到 python 3.4 时,程序运行正常。