GPU加速GWAS分析–quickdraw

quickdraw是一种可扩展的方法,可以进行数量和二元性状的全基因组关联研究(GWAS)。研究人员将Quickdraws应用于405088个英国生物库样本的79个定量性状和50个二元性状,发现比REGENIE多出4.97%和3.25%的关联,分别比FastGWA多出22.71%和7.07%。Quickdraws的计算成本与REGENIE、FastGWA和SAIGE在英国生物库研究分析平台服务上的成本相当,同时比BOLT-LMM显著更快。这些结果凸显了在不牺牲统计能力或稳健性的前提下,利用机器学习技术进行可扩展全基因组关联研究(GWAS)的潜力。

安装

强烈建议设置 python 虚拟环境或 conda 环境:

Python 虚拟环境

python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel

Conda 环境

conda create -n quickdraws python=3.11 -y
conda activate quickdraws
pip install --upgrade pip setuptools wheel

安装 pytorch 和 quickdraws

任何比toy示例更大的数据都必须使用支持 cuda 的 pytorch 版本。 使用 pytorch 配置帮助程序[1]查找适合您系统的安装说明。 下面的代码片段可能适用于大多数系统:

pip install torch --index-url https://download.pytorch.org/whl/cu118
pip install quickdraws

使用

详细可参考官网教程[2]

数量性状

第 1 步

使用 spike-and-slab 贝叶斯线性回归来估计遗传效应。

quickdraws-step-1 
    --out ${output_step1} 
    --hdf5 master.hdf5
    --bed ${bed} 
    --phenoFile ${pheno} 
    --covarFile ${covar} 
    --modelSnps maf001.snps
    --kinship kinship.txt

  • ${output_step1}:将写入步骤 1 输出的文件前缀。
  • master.hdf5:在步骤 0 中生成(可选)。
  • ${bed}:包含模型 SNP 的 bed 文件。
  • ${pheno}:包含表型数据的文件。有关格式详细信息,请参阅输入/输出文件格式部分。
  • ${covar}:包含协变量的文件。有关格式详细信息,请参阅输入/输出文件格式部分。
  • maf001.snps:回归的 SNP 列表(可选),如步骤 0 中所述。
  • kinship.txt:包含高达 3 度的成对亲属。此文件可以使用 PLINK 中实现的 KING 生成(有关示例,请参阅 FAQ)。

第 2 步

在 bed 文件中生成 SNP 的汇总统计数据(例如,模型 SNP)。

quickdraws-step-2 
   --out ${output_step2} 
   --bed ${bed} 
   --out_step1 ${output_step1} 
   --covarFile ${covar} 
   --unrel_sample_list unrelated_white_British.FID_IID.txt

  • ${output_step2}:将写入结果的文件前缀。
  • ${bed}:包含要检测的 SNP 的 Bed 文件。
  • ${output_step1}:步骤 1 的输出文件。
  • ${covar}:包含协变量的文件。有关格式详细信息,请参阅输入/输出文件格式部分。
  • unrelated_white_British.FID_IID.txt:不相关的均质样本列表,或要包含在测试统计量计算中的任何其他样本列表。有关格式详细信息,请参阅输入/输出文件格式部分。

二进制特征

第 1 步

对于二进制特征,请添加 --binary--h2_grid标志。

quickdraws-step-1 
    --out ${output_step1} 
    --hdf5 master.hdf5
    --bed ${bed} 
    --phenoFile ${pheno} 
    --covarFile ${covar} 
    --modelSnps maf001.snps
    --kinship kinship.txt
    --binary
    --h2_grid

输入/输出文件与数量性状[3]的描述相同。

第 2 步

为 Firth Logistic 回归添加--binary 和--firth 标志。

quickdraws-step-2 
   --out ${output_step2} 
   --bed ${bed} 
   --out_step1 ${output_step1} 
   --covarFile ${covar} 
   --unrel_sample_list unrelated_white_British.FID_IID.txt
   --binary
   --firth

输入/输出文件与数量性状[4]的描述相同。

表现

可以看到在成本上是仅次于西湖大学杨剑老师的fastGWA-GLMM的。

解释输出 Quickdraws 会生成以下输出文件:

参考资料
[1] 

pytorch 配置帮助程序: https://pytorch.org/get-started/locally/

[2] 

参考官网教程: https://palamaralab.github.io/software/quickdraws/manual/

[3] 

数量性状: https://palamaralab.github.io/software/quickdraws/manual/#step-1

[4] 

数量性状: https://palamaralab.github.io/software/quickdraws/manual/#step-2-bed-files


本篇文章来源于微信公众号:微因

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注