######################################################################################### # # # Merlin # # # ######################################################################################### bash ### From the gt folder # make a connecting file to link up the families and supply zygosity if required awk '{ print $1, $2, $3, $4, $5, "0"}' HM3ceu.fam > zyg.ped awk '{ print $1, $3 }' zyg.ped | grep -v 0$ | sort | uniq > temp awk '{ print $1, $2, "0 0 1 0"} ' temp >> zyg.ped awk '{ print $1, $4 }' zyg.ped | grep -v 0$ | sort | uniq > temp awk '{ print $1, $2, "0 0 2 0"} ' temp >> zyg.ped sort zyg.ped | uniq > temp mv temp zyg.ped # make a dat file for zyg.ped echo 'Z Zygosity' > zyg.dat # run association - score test merlin -p zyg.ped,HM3.pheno,HM3ceu22.ped.gz -d zyg.dat,HM3.pheno.dat,HM3ceu22.dat.gz -m HM3ceu22.map.gz \ --singlepoint --trim --fastAssoc --tabulate --prefix fastAssoc --pdf # run association - Likelihood-ratio test merlin -p zyg.ped,HM3.pheno,HM3ceu22.ped.gz -d zyg.dat,HM3.pheno.dat,HM3ceu22.dat.gz -m HM3ceu22.map.gz --singlepoint \ --trim --assoc --tabulate --prefix assoc --pdf ### From the imp folder cd ../imp cp ../gt/zyg.* ./ #converting from mach to merlin-ofline format for hapmap2 imputed data #requires the legend, mlinfo, mldose and fam files ./mach2merlin.pl -l genotypes_chr22_CEU_r22_nr.b36_fwd_legend.txt \ -i imputed.mlinfo -d imputed.mldose.gz -f HM3ceu.fam -b 10000 # loop over chromosomes #for ((i=1; i<=22; i++)) for i in 22 do # loop over parts for ((j=1; j<=23; j++)) #for j in 4 do # exclude parts that are not present if test -f prepared_earlier/infer_format_"$i"."$j".dat.gz then # run merlin-offline merlin-offline \ -m prepared_earlier/infer_format_"$i".map.gz \ -f prepared_earlier/infer_format_"$i".freq.gz \ --pedinfer prepared_earlier/infer_format_"$i"."$j".ped.gz \ --datinfer prepared_earlier/infer_format_"$i"."$j".skip.gz \ -p zyg.ped,HM3.pheno \ -d zyg.dat,HM3.pheno.dat \ --useCovariates --tabulate --prefix chr"$i"_"$j" > chr"$i"_"$j".out fi done done