MAGMA安装
![](https://img.haomeiwen.com/i15400423/b496d326fa2bbbd3.png)
下载linux版本,在服务器解压即可使用。
数据准备
-
gene location数据
image.png
-
reference data
image.png
- snp数据
wget http://hgdownload.cse.ucsc.edu/goldenPath/hg38/database/snp151.txt.gz
gzip snp151.txt.gz -d
-
GWAS数据
从GWAS Catalog网址下载目标疾病的GWAS summary文件
根据snp151.txt和GWAS summary数据,将snp位置对应到rs号,输出SNP ID和P值的一个文件,第一列为ID,第二列为P值,不要表头。
示例如下:
image.png
- 单细胞数据
seurat object转h5ad格式,后面作为scDRS的输入使用
library(SeuratDisk)
SaveH5Seurat(cm.object,filename="cm.h5Seurat")
Convert("cm.h5Seurat",dest="h5ad")
分析
参考 https://www.cnblogs.com/chenwenyan/p/14628970.html
step1:基因注释
magma --annotate --snp-loc ../MAGMA/g1000_eur/g1000_eur.bim --gene-loc ../MAGMA/NCBI38/NCBI38.gene.loc --out g1000_eur
得到g1000_eur.genes.annot文件
![](https://img.haomeiwen.com/i15400423/5e96f19b65e6157c.png)
step2:gene-base分析
magma --bfile ../MAGMA/g1000_eur/g1000_eur --pval snp_p.txt N=387930 --gene-annot g1000_eur.genes.annot --out gene_based
得到gene_based.genes.out,和gene_based.genes.raw
![](https://img.haomeiwen.com/i15400423/b7f97e4dbda1e361.png)
step3. Convert a .tsv GWAS gene statistics file to an scDRS .gs file.
scdrs munge-gs \
--out-file processed_gene.zscore.gs \
--zscore-file gene.zscore \
--weight zscore
step4. Compute scDRS scores.
scdrs compute-score \
--h5ad-file <h5ad_file>\
--h5ad-species mouse\
--gs-file <gs_file>\
--gs-species human\
--out-folder <out_folder>\
--cov-file <cov_file>\
--flag-filter-data True\
--flag-raw-count True\
--n-ctrl 1000\
--flag-return-ctrl-raw-score False\
--flag-return-ctrl-norm-score True
step5. scDRS downstream analyses
scdrs perform-downstream \
--h5ad-file <h5ad_file>\
--score-file <score_file>\
--out-folder <out_folder>\
--group-analysis cell_type \
--corr-analysis causal_variable,non_causal_variable,covariate\
--gene-analysis\
--flag-filter-data True\
--flag-raw-count True
结果解读
https://martinjzhang.github.io/scDRS/file_format.html#trait-scdrs-group-annot
网友评论