Multi-Trait Analysis of GWAS

多性状 GWAS 分析 (Multi-Trait Analysis of GWAS)
mtag
是一款基于 Python 的命令行工具,用于联合分析多组 GWAS summary data,该方法由 Turley 等人 2018 提出。It can also be used as a tool to meta-analyze GWAS results.
安装程序
To run mtag
, you will need to have Python 2.7
installed with the following packages:
numpy (>=1.13.1)
scipy
pandas (>=0.18.1)
argparse
bitarray
(forldsc
)joblib
(Note: if you already have the Python 3 version of the Anaconda distribution installed, then you will need to create and activate a Python 2.7 environment to run mtag
. See here for details.)
基于 Linux 环境 (未完整测试)
mtag
may be downloaded by cloning this github repository:
1 | git clone https://github.com/omeed-maghzian/mtag.git |
To test that the tool has been successfully installed, type:
1 | /tools/Python-2.7.16/python mtag.py -h |
基于 Windows 环境 (测试通过)
mtag
may be downloaded by cloning this github repository:
1 | git clone https://github.com/omeed-maghzian/mtag.git |
安装 Python 环境:
1 | MTAG_install() |
To test that the tool has been successfully installed, type:
1 | C:/Users/Administrator/.conda/envs/MTAG/python.exe E:/tools/mtag/mtag.py -h |
官方手册
Tutorial 1: The Basics
这部分入门教程旨在帮助练习如何在命令行中使用mtag
,但它并不全面。在开始之前,先按照安装程序部署好环境,并查看帮助文档信息。
示例数据
当对多个 GWAS summary data 进行数据分析时,使用 MATG 是非常有用的。GWAS 的汇总统计数据必须按照mtag
能够读取的格式进行整理。这里所用的示例数据已经完成了这些预处理,只需要将压缩文件解压到mtag
目录的文件夹中,即可直接运行下方的mtag
命令。
这里以 Okbay et. al. (2016) 关于神经质 (Neuroticism) 和主观幸福感 (Subjective well-being) 的 GWAS 结果为例,演示mtag
的使用方法。这里使用了原始 GWAS 结果中,来自 Hapmap3 中随机抽取的一部分 SNP 的子集。神经质和主观幸福感的 GWAS summary data 可以从这里下载:https://thessgac.com/ (Note: requires registering for an account).
这些示例文件已经按命令行工具默认输出格式整理好了,也就是说,它们是以空白字符分隔的 .txt 文件,包含以下这些列,顺序不限:
1 | 以下列是 MTAG 正常运行所必需的: |
- snpid:唯一的 SNP 标识符,通常为 rsid 编号,多个 GWAS 文件会通过该列进行匹配。当对 GWAS 数据进行标准化和估算残差协方差矩阵时,该 SNP 标识符也会传递给 ldsc,也可以通过
--snp_name
选项指定其他列名。
a1/a2:该位点观测到的等位基因,a1 被视为效应等位基因,其符号也应反映在 Z 分数上,这两列也会传递给 ldsc 程序;mtag 会检查并调整 a1 与 a2,确保在所有输入文件中保持一致,也可以用
--a1_name
和--a2_name
指定其他列名。freq:效应等位基因(a1)的频率,用于过滤稀有变异并用于将 MTAG 结果转换为非标准化效应值,可通过
--eaf_name
指定其他列名。z:与 SNP 效应值相关的 Z 分数,与样本量列一起,几乎在 mtag 程序的每一个关键步骤中都会用到;可通过
--z_name
指定其他列名。注意:如果输入的 GWAS 数据中同时包含效应值(beta)和标准误,则 MTAG 不再强制要求 z 列;要使用该选项,请确保仓库为最新版本,并指定
--use_beta_se
标志,默认的列名分别是 beta 和 se,可通过--beta_name
和--se_name
指定。
- n:该 SNP 的样本量,和 z 一样,是分析的核心组成部分,可通过
--n_name
指定其他列名。其他列虽然不是 mtag.py 直接使用,但在 ldsc 实现的数据标准化过程中会用到。因此,至少需要保证这些列的格式能够被 ldsc 识别,详见这里。染色体编号 (chr) 和碱基对位置 (bpos) 也会作为参考列写入结果文件,也可以分别通过
--chr_name
和--bpos_name
选项指定其他列名。
Tutorial 2: Special Options
Tutorial 3: maxFDR Calculation
封装函数
- Title: Multi-Trait Analysis of GWAS
- Author: Xing Abao
- Created at : 2025-05-02 23:33:04
- Updated at : 2025-05-04 12:47:38
- Link: https://bioinformatics.vip/2025/05/02/post-GWAS/Multi-Trait Analysis of GWAS/
- License: This work is licensed under CC BY-NC-SA 4.0.