首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在R中绘制迈阿密图(GWAS)?

如何在R中绘制迈阿密图(GWAS)?
EN

Stack Overflow用户
提问于 2019-09-28 00:26:32
回答 3查看 1.9K关注 0票数 3

我正在寻找一个函数来运行迈阿密图(GWAS),它看起来像这样:

我会有2个不同的GWASes的数据。要模拟绘图,可以使用此数据集(https://cran.r-project.org/web/packages/qqman/vignettes/qqman.html):

代码语言:javascript
复制
require(qqman)
head(gwasResults)

任何帮助都将不胜感激!非常感谢!

EN

回答 3

Stack Overflow用户

发布于 2021-01-19 04:39:40

你可以做类似这样的事情

代码语言:javascript
复制
library(qqman)
par(mfrow=c(2,1))
par(mar=c(0,5,3,3))
manhattan(gwasResults,ylim=c(0,10),cex=2.2,cex.lab=2.5,font.lab=2,font.axis=2,cex.axis=1.6,las=2,font=4)
par(mar=c(5,5,3,3))
manhattan(gwasResults,ylim=c(10,0),cex=2.2,cex.lab=2.5,font.lab=2,font.axis=2,cex.axis=1.6,las=2,font=4,xlab="",xaxt="n")
dev.off()

R中的迈阿密图(GWAS)

票数 1
EN

Stack Overflow用户

发布于 2021-06-29 21:59:46

你可以试试

代码语言:javascript
复制
library(tidyverse)
library(ggfastman)
data("gwas_data")
gwas_data %>% 
  mutate( gr= "Study 1") %>% 
  mutate(pvalue=-log10(pvalue)) %>% 
  # rbind a second study with pvalues with other sign.
  bind_rows(., mutate(., gr= "Study 2",
                      pvalue = -pvalue)) %>% 
  # plot the points 
  fast_manhattan(., build = "hg18", speed = "fast",log10p = F, dodge_x = T,pointsize = 2.1, pixels = c(1000,500)) + 
  # add significance line
  geom_hline(data= . %>% group_by(gr) %>% slice(1), aes(yintercept = ifelse(pvalue>0, -log10(5e-08),log10(5e-08))),color ="deeppink") + 
  facet_wrap(~gr, scales = "free_y",ncol = 1,strip.position = "right")+
  scale_y_continuous(expression(-log[10](italic(p))),breaks= seq(-90,80,10), labels = abs(seq(-90,80,10)), expand = c(0.01, 0))

票数 1
EN

Stack Overflow用户

发布于 2020-05-13 16:43:54

用于创建镜像曼哈顿图的R包是hudson (https://github.com/anastasia-lucas/hudson),函数是hudson::gmirror。示例(在GitHub中提供)

代码语言:javascript
复制
library(hudson)
data(gwas.t)
data(gwas.b)
gmirror(top=gwas.t, bottom=gwas.b, tline=0.05/nrow(gwas.t), bline=0.05/nrow(gwas.b), 
toptitle="GWAS Comparison Example: Data 1", bottomtitle = "GWAS Comparison Example: Data 2", 
highlight_p = c(0.05/nrow(gwas.t),0.05/nrow(gwas.b)), highlighter="green")
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58138323

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档