Identify significant gene-level associations for a trait, using the popular MAGMA algorithm. The output will be a list of gene-level associations and their statistical significance. #Download MAGMA from https://cncr.nl/research/magma/ magma #Download genotype information and auxiliary files from https://cncr.nl/research/magma/ g1000_eur.{bed,bim,fam} #download synonym file g1000_eur.synonyms #download gene loc file NCBI37.3.gene.loc #download bottom line results for a trait T2D.sumstats.gz #add rsIDs zcat T2D.sumstats.gz | awk -F"\t" -v OFS="\t" 'FNR == NR {m[$1":"$4] = $2} FNR != NR {if (FNR == 1) {print "SNP",$0}  if (m[$1":"$2]) {print m[$1":"$2],$0}}' g1000_eur.bim - > T2D.annot.sumstats #make snploc and p-value files cat T2D.annot.sumstats | cut -f1,2,3 > T2D.snploc cat T2D.annot.sumstats | cut -f1,4,5 > T2D.pval #run annotation magma --annotate window=50 --snp-loc T2D.snploc --gene-loc NCBI37.3.gene.loc --out T2D #produces T2D.genes.annot magma --bfile g1000_eur synonyms=g1000_eur.synonyms --gene-annot T2D.genes.annot --pval T2D.pval ncol=N --out T2D #produces T2D.genes.out