作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在使用 rpy2
在 Python 中加载 R 包 edgeR
时遇到问题。
当我运行时:
import rpy2.robjects as robjects
robjects.r('''
library(edgeR)
''')
我收到以下错误:
/home/user/.local/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: Loading required package: limma
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/user/.local/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/data/scratch/user/source/anaconda/lib/R/library/edgeR/libs/edgeR.so':
/data/scratch/user/source/anaconda/lib/R/library/edgeR/libs/edgeR.so: undefined symbol: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev
res = super(Function, self).__call__(*new_args, **new_kwargs)
/home/user/.local/lib/python2.7/site-packages/rpy2/robjects/functions.py:106: UserWarning: Error: package or namespace load failed for ‘edgeR’
res = super(Function, self).__call__(*new_args, **new_kwargs)
Traceback (most recent call last):
File "differential_expression.py", line 221, in <module>
diff_expr_object.run_edgeR()
File "differential_expression.py", line 127, in run_edgeR
probs = call_edger(data, groups, sizes, genes)
File "differential_expression.py", line 64, in call_edger
''')
File "/home/user/.local/lib/python2.7/site-packages/rpy2/robjects/__init__.py", line 321, in __call__
res = self.eval(p)
File "/home/user/.local/lib/python2.7/site-packages/rpy2/robjects/functions.py", line 178, in __call__
return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)
File "/home/user/.local/lib/python2.7/site-packages/rpy2/robjects/functions.py", line 106, in __call__
res = super(Function, self).__call__(*new_args, **new_kwargs)
rpy2.rinterface.RRuntimeError: Error: package or namespace load failed for ‘edgeR’
主要问题是:
rpy2.rinterface.RRuntimeError: Error: package or namespace load failed for ‘edgeR’
但是,当我运行以下命令时:
R
> library(edgeR)
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.5 (Final)
locale:
[1] LC_CTYPE=en_ZA.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_ZA.UTF-8 LC_COLLATE=en_ZA.UTF-8
[5] LC_MONETARY=en_ZA.UTF-8 LC_MESSAGES=en_ZA.UTF-8
[7] LC_PAPER=en_ZA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_ZA.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] edgeR_3.12.0 limma_3.26.9
>
我可以看到 edgeR
已成功安装并在 R
中运行。为什么它不能在 Python 中工作?我试图从 rpy2
加载其他包,例如library(tools)
运行良好。
最佳答案
错误是:
UserWarning: Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/data/scratch/user/source/anaconda/lib/R/library/edgeR/libs/edgeR.so':
/data/scratch/user/source/anaconda/lib/R/library/edgeR/libs/edgeR.so: undefined symbol: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev
无法加载 edgeR 的 C 库。您是否了解如何安装 R 和 edgeR 的详细信息? (我可以看到涉及anaconda)。
关于Python rpy2 错误加载 edgeR R 包,但它已安装并在 R 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36468707/
我在 EdgeR 中创建 MDS 图以用颜色可视化实验组(白血病)和对照组(健康捐赠者)时遇到问题。 我使用 htseq 文件作为 edgeR 的输入。每个文件由两列组成 -gene_ID 和读取计数
我在使用 rpy2 在 Python 中加载 R 包 edgeR 时遇到问题。 当我运行时: import rpy2.robjects as robjects robjects.r(''' l
我是一名优秀的程序员,十分优秀!