R语言qqman包绘制曼哈顿图

1. 载入包

library(qqman)
head(gwasResults)# 包中的颜色数据

2.manhattan函数做曼哈顿图

Usage

manhattan(
  x,
  chr = "CHR",
  bp = "BP",
  p = "P",
  snp = "SNP",
  col = c("gray10", "gray60"),
  chrlabs = NULL,
  suggestiveline = -log10(1e-05),
  genomewideline = -log10(5e-08),
  highlight = NULL,
  logp = TRUE,
  annotatePval = NULL,
  annotateTop = TRUE,
  ...
)

Arguments

x

A data.frame with columns "BP," "CHR," "P," and optionally, "SNP."

chr

A string denoting the column name for the chromosome. Defaults to PLINK's "CHR." Said column must be numeric. If you have X, Y, or MT chromosomes, be sure to renumber these 23, 24, 25, etc.

bp

A string denoting the column name for the chromosomal position. Defaults to PLINK's "BP." Said column must be numeric.

p

A string denoting the column name for the p-value. Defaults to PLINK's "P." Said column must be numeric.

snp

A string denoting the column name for the SNP name (rs number). Defaults to PLINK's "SNP." Said column should be a character.

col

A character vector indicating which colors to alternate.

chrlabs

A character vector equal to the number of chromosomes specifying the chromosome labels (e.g., c(1:22, "X", "Y", "MT")).

suggestiveline

Where to draw a "suggestive" line. Default -log10(1e-5). Set to FALSE to disable.

genomewideline

Where to draw a "genome-wide sigificant" line. Default -log10(5e-8). Set to FALSE to disable.

highlight

A character vector of SNPs in your dataset to highlight. These SNPs should all be in your dataset.

logp

If TRUE, the -log10 of the p-value is plotted. It isn't very useful to plot raw p-values, but plotting the raw value could be useful for other genome-wide plots, for example, peak heights, bayes factors, test statistics, other "scores," etc.

annotatePval

If set, SNPs below this p-value will be annotated on the plot. If logp is FALSE, SNPs above the specified value will be annotated.

annotateTop

If TRUE, only annotates the top hit on each chromosome that is below the annotatePval threshold (or above if logp is FALSE).

...

Arguments passed on to other plot/points functions

manhattan(
  gwasResults,
  chr = "CHR",
  bp = "BP",
  p = "P",
  snp = "SNP",
  col = c("gray10", "gray60"),
  chrlabs = NULL,
  suggestiveline = -log10(1e-05),
  genomewideline = -log10(5e-08),
  highlight = NULL,
  logp = TRUE,
  annotatePval = NULL,
  annotateTop = TRUE
)

曼哈顿图是散点图,横坐标为染色体上的位置,纵坐标为-log10 p-value,也可以通过ggplot2包绘制。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值