GWAS 质量控制(QC)分析流程

Use preset environment

目录

1、Install a Linux virtual machine or a Windows subsystem, open a terminal.

2、Download the key and connect to the server in the terminal.

3、Go to target dir and make your own data folder (minxian as an example)

4、Decompress the data and start the analysis


1、Install a Linux virtual machine or a Windows subsystem, open a terminal.

You can find the tutorial somewhere else in this section.

2、Download the key and connect to the server in the terminal.

chmod 700 xh1eshell.hpccube.com_1107221622_rsa.txt
ssh -i xh1eshell.hpccube.com_1107221622_rsa.txt -p 65073 minxian@xh1eshell.hpccube.com
# Type yes when ask
#The authenticity of host '[xh1eshell.hpccube.com]:65073 ([218.26.37.181]:65073)' can't be established.
#ED25519 key fingerprint is SHA256:SRE9uDeyQyPSLAtITTfW7F1qwySmxXbGFAKCWJJDkP4.
#This key is not known by any other names
#Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
#Warning: Permanently added '[xh1eshell.hpccube.com]:65073' (ED25519) to the list of known hosts.

链接: https://pan.baidu.com/s/1i0lxU-wXZ08sSRT71kh-1Q?pwd=14fr 提取码: 14fr 
--来自百度网盘超级会员v2的分享

3、Go to target dir and make your own data folder (minxian as an example)

# Use minxian as an example
cd /public1/share/ac7m4df1o5/chenxy/data
mkdir minxian
cd minxian
# load the cond preset env
conda activate qc

4、Decompress the data and start the analysis

cat ../raw-GWA-data.tgz | perl -pe 's/\r\n\z/\n/' | tar xfvz -
plink --ped raw-GWA-data.ped --map raw-GWA-data.map --make-bed --out raw-GWA-data

# check sex mis-match
plink --bfile raw-GWA-data --check-sex --out raw-GWA-data
cat raw-GWA-data.sexcheck | grep -i problem
# 772  772            2            0      PROBLEM       0.3084
# 853  853            2            0      PROBLEM       0.3666
#1920 1920            2            0      PROBLEM       0.4066

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
GWAS meta分析是一种将多个基因组关联研究结果进行综合分析的方法,以下是一个Python脚本的例子,用于进行GWAS meta分析: ```python import pandas as pd import numpy as np import statsmodels.api as sm # 读取所有研究的GWAS结果文件 study1 = pd.read_csv("study1.csv") study2 = pd.read_csv("study2.csv") study3 = pd.read_csv("study3.csv") # 将每个研究的p值进行变换,转化为z值 study1["z"] = np.sqrt(2) * sm.stats.proportion.proportions_ztest(study1["n_cases"], study1["n_total"], value=study1["OR"])[0] study2["z"] = np.sqrt(2) * sm.stats.proportion.proportions_ztest(study2["n_cases"], study2["n_total"], value=study2["OR"])[0] study3["z"] = np.sqrt(2) * sm.stats.proportion.proportions_ztest(study3["n_cases"], study3["n_total"], value=study3["OR"])[0] # 将每个研究的z值和样本量进行合并 meta_data = pd.concat([study1[["SNP", "z", "n_cases", "n_total"]], study2[["SNP", "z", "n_cases", "n_total"]], study3[["SNP", "z", "n_cases", "n_total"]]]) # 计算每个SNP的z值和加权样本量 meta_data["wz"] = meta_data["z"] * np.sqrt(meta_data["n_cases"] + meta_data["n_controls"]) meta_data["w"] = np.sqrt(meta_data["n_cases"] + meta_data["n_controls"]) # 计算meta分析的z值和p值 meta_z = meta_data["wz"].sum() / meta_data["w"].sum() meta_p = 2 * (1 - sm.stats.norm.cdf(abs(meta_z))) # 输出meta分析结果 print("Meta-analysis result:") print("z value: ", meta_z) print("p value: ", meta_p) ``` 这个脚本首先读取每个研究的GWAS结果文件,将每个研究的p值转化为z值,然后将每个研究的z值和样本量进行合并,计算每个SNP的加权z值和加权样本量,最后计算meta分析的z值和p值,输出结果。需要注意的是,不同研究的样本量、OR值等参数可能存在差异,需要根据具体情况进行调整。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值