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

我会有2个不同的GWASes的数据。要模拟绘图,可以使用此数据集(https://cran.r-project.org/web/packages/qqman/vignettes/qqman.html):
require(qqman)
head(gwasResults)任何帮助都将不胜感激!非常感谢!
发布于 2021-01-19 04:39:40
你可以做类似这样的事情
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)

发布于 2021-06-29 21:59:46
你可以试试
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))

发布于 2020-05-13 16:43:54
用于创建镜像曼哈顿图的R包是hudson (https://github.com/anastasia-lucas/hudson),函数是hudson::gmirror。示例(在GitHub中提供)
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")https://stackoverflow.com/questions/58138323
复制相似问题