使用RSID值在两个数据集之间绘制重叠

发布于 2025-01-23 22:22:20 字数 1625 浏览 4 评论 0 原文

我想在两个数据集之间绘制重叠。 我的第一个数据集是: dput(rsid_en_vcf [1:43,]) C(“ RS782629217”,“ RS782403204”,“ RS199529001”,“ RS147880041”, “ RS141826009”,“ RS199826048”,“ RS200558688”,“ RS782114919”,“ RS41304577”,“ “ RS200311430”,“ RS147114528”,“ RS200635479”,“ RS41288741”,“ RS782167952”,“ “ RS6560827”,“ RS200242637”,“ RS144539776”,“ RS41305669”,“ RS41288743”,“ “ RS41288743”,“ RS369736529”,“ RS148025238”,“ RS41298226”,“ RS782272071”,“ “ RS9329304”,“ RS9329305”,“ RS137895574”,“ RS142619172”,“ RS144154384”,“ “ RS782777737”,“ RS782796368”,“ RS782443786”,“ RS782246853”,“ RS150779790”,“ “ RS782304204”,“ RS9329306”,“ RS144740103”,“ RS4431953”,“ RS189892388; RS75953774” “ RS61839057”,“ RS61839058”,“ RS145405488”,“ RS782307404”)

我的第二个数据集是:

dput(en_brain_cortex7 [1:10,]) 结构(列表(rsid1 = c(“ RS2085346”,“ RS12765102”,“ RS11250286”, “ RS1876899”,“ RS11250293”,“ RS4880776”,“ RS7094850”,“ RS883660”,“ “ RS4880780”,“ RS4880487”),row.names = C(Na,-10l),class = C(“ TBL_DF”, “ tbl”,“ data.frame”))) 我想为这两个数据集绘制带有重叠的Venndiagram。 这就是我所做的:

venn.diagram(
    x = list(rsid_en_vcf,en_Brain_Cortex7),
    category.names = c("elasticnet_model","rsid_vcf"),
    filename = 'venn_diagramm.png',
    output=TRUE
)

但是它给出了一个错误: 错误: 呢必须使用有效的下标向量子集。 I逻辑下标必须匹配索引输入的大小。 X输入具有157608的大小,但是subscript !重复(x,froflast = fromlast,...)的大小为0。

I want to plot overlap between two datasets.
My first dataset is:
enter image description here
dput(rsid_en_vcf[1:43,])
c("rs782629217", "rs782403204", "rs199529001", "rs147880041",
"rs141826009", "rs199826048", "rs200558688", "rs782114919", "rs41304577",
"rs200311430", "rs147114528", "rs200635479", "rs41288741", "rs782167952",
"rs6560827", "rs200242637", "rs144539776", "rs41305669", "rs41288743",
"rs41288743", "rs369736529", "rs148025238", "rs41298226", "rs782272071",
"rs9329304", "rs9329305", "rs137895574", "rs142619172", "rs144154384",
"rs782777737", "rs782796368", "rs782443786", "rs782246853", "rs150779790",
"rs782304204", "rs9329306", "rs144740103", "rs4431953", "rs189892388;rs75953774",
"rs61839057", "rs61839058", "rs145405488", "rs782307404")

My second dataset is:

enter image description here
dput(en_Brain_Cortex7[1:10,])
structure(list(RSID1 = c("rs2085346", "rs12765102", "rs11250286",
"rs1876899", "rs11250293", "rs4880776", "rs7094850", "rs883660",
"rs4880780", "rs4880487")), row.names = c(NA, -10L), class = c("tbl_df",
"tbl", "data.frame"))
I want to plot a venndiagram with overlap for these two datasets.
This is what I did:

venn.diagram(
    x = list(rsid_en_vcf,en_Brain_Cortex7),
    category.names = c("elasticnet_model","rsid_vcf"),
    filename = 'venn_diagramm.png',
    output=TRUE
)

But it gives an error:
Error:
! Must subset rows with a valid subscript vector.
i Logical subscripts must match the size of the indexed input.
x Input has size 157608 but subscript !duplicated(x, fromLast = fromLast, ...) has size 0.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑饮青盏花 2025-01-30 22:22:20

帮助页面说X参数的输入应为向量列表。您的 X 是向量和data.frame。

成功:

library(VennDiagram)
venn.diagram(
+     x = list(rsid_en_vcf,en_Brain_Cortex7$RSID1),
+     category.names = c("elasticnet_model","rsid_vcf"),
+     filename = 'venn_diagramm.png',
+     output=TRUE
+ )
[1] 1

图像文件是PNG类型,但为36 MB,因此拒绝上传。

您的图像太大而无法上传(超过2 MIB)。

将分辨率更改为72和ht,然后将宽度更改为700,我得到:

The help page says the input to the x argument should be a list of vectors. Your x was a vector and a data.frame.

This succeeds:

library(VennDiagram)
venn.diagram(
+     x = list(rsid_en_vcf,en_Brain_Cortex7$RSID1),
+     category.names = c("elasticnet_model","rsid_vcf"),
+     filename = 'venn_diagramm.png',
+     output=TRUE
+ )
[1] 1

The image file was of type png but was 36 MB and SO refuses to upload it.

Your image is too large to upload (over 2 MiB).

Changing the resolution to 72 and ht and width to 700 I get:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文