使用 R 中的 eVenn 计算列表的矩阵比较
有许多包含相交元素列对的列表,这里假设集合 1、2、3,它们可以具有 1 对 1、1 对多和多对多关系:
df1 = data.frame(
X1 = paste('set100',sample(10,8,replace=TRUE),sep=''),
X2 = paste('set200',sample(10,8,replace=TRUE),sep='')
)
df2 = data.frame(
X1 = paste('set100',sample(10,8,replace=TRUE),sep=''),
X3 = paste('set300',sample(10,8,replace=TRUE),sep='')
)
df3 = data.frame(
X2 = paste('set100',sample(10,8,replace=TRUE),sep=''),
X3 = paste('set300',sample(10,8,replace=TRUE),sep='')
)
我 想要创建一个两列列表的合并矩阵,以将它们用作 eVenn 的输入。在 eVenn 的 4 路示例中,列表已经位于如下所示的对象中:
> head(res3)
liste_1_.194. liste_2_.149. liste_3_.366. Total_lists ratios
10345445 1 0 0 1 2.159987
10345762 1 1 0 2 2.223848
10345791 1 1 1 3 2.519503
10345824 0 0 0 0 NA
10346191 0 0 0 0 NA
10346843 0 0 0 0 NA
ratios ratios
10345445 NA NA
10345762 2.085687 2.264225
10345791 2.518024 2.668271
10345824 NA 36.246703
10346191 NA 2.527424
10346843 NA 3.852753
我希望能够对合并数据调用 eVenn 命令,如下所示:
mergedmatrix <- create_the_merged_matrix_somehow(df1,df2,df3)
evenn(path_lists="test",res=mergedmatrix,ud=TRUE)
有什么想法吗?
I've got a number of lists with pairs of columns of intersecting elements, here supposing sets 1, 2, 3, that can have a 1-to-1, 1-to-many and many-to-many relationship:
df1 = data.frame(
X1 = paste('set100',sample(10,8,replace=TRUE),sep=''),
X2 = paste('set200',sample(10,8,replace=TRUE),sep='')
)
df2 = data.frame(
X1 = paste('set100',sample(10,8,replace=TRUE),sep=''),
X3 = paste('set300',sample(10,8,replace=TRUE),sep='')
)
df3 = data.frame(
X2 = paste('set100',sample(10,8,replace=TRUE),sep=''),
X3 = paste('set300',sample(10,8,replace=TRUE),sep='')
)
And I want to create a merged matrix of the two-column lists to use them as input for eVenn. In eVenn's 4-way example, the lists are already in an object like this:
> head(res3)
liste_1_.194. liste_2_.149. liste_3_.366. Total_lists ratios
10345445 1 0 0 1 2.159987
10345762 1 1 0 2 2.223848
10345791 1 1 1 3 2.519503
10345824 0 0 0 0 NA
10346191 0 0 0 0 NA
10346843 0 0 0 0 NA
ratios ratios
10345445 NA NA
10345762 2.085687 2.264225
10345791 2.518024 2.668271
10345824 NA 36.246703
10346191 NA 2.527424
10346843 NA 3.852753
I want to be able to call the eVenn command on the merged data like this:
mergedmatrix <- create_the_merged_matrix_somehow(df1,df2,df3)
evenn(path_lists="test",res=mergedmatrix,ud=TRUE)
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,你的例子很难遵循。我建议您避免使用
eVenn
包。包文档非常有限,并且示例非常神秘。它不会在标准 X11(在 UNIX 系统上)显示中生成图形,并且只会将结果打印到文件中。我建议您考虑
limma
包,可用来自Bioconductor。它具有制作漂亮的维恩图的功能。您可以在此处查看一些示例。我猜你所说的
create_the_merged_matrix_somehow()
可以通过limma
中的vennCounts()
来解决。Unfortunately your example is difficult to follow. I would suggest that you avoid using the
eVenn
package. The package documentation is very limited, and the examples are very cryptic. It does not produce a figure in the standard X11 (on unix systems) display, and will only print the results to file.I would suggest you consider the
limma
package, available from Bioconductor. It has functionality to make nice Venn diagrams. You can see some examples here.I guess that what you call
create_the_merged_matrix_somehow()
would be solved byvennCounts()
inlimma
.