Practical 2

Estimating genetic variance within families


QTDT software


  • designed for family based tests of linkage disequilibrium between a marker and a complex trait (=family based association mapping)

  • we are going to us it to estimate variance components where our marker is the whole genome or a chromosome

variance components

  • allows customised variance-covariance matrices
    • key options are -w and -v
    • describe two alternative models for variance
  • can build means model for association tests
    • use the -a option
    • using observed marker genotypes
  • can read in IBD matrix generated from another program
    • we are using this in this practical

variance components


  • e non-shared environment
  • g polygenic components
  • a additive major gene effect
  • t twin environment
  • c common environment

variance components


  • the -w option specifies variances under the null
    • e.g -we specifies that only environmental effects are modelled


  • v specifies variances under the alternative
    • e.g. -veg models environment and polygenic effects.

heritability with QTDT


  • disable association model option
    • use option -a-
  • specify two models for variance
    • use options -we and -veg

typical command line:

qtdt -d example.dat -p example.ped -a- -we -veg

heritability output with QTDT


  • summary output appears on screen


  • variance component estimates are output to regress.tbl

linkage with QTDT

  • disable association model option
    • use option -a-
  • specify two models for variance
    • use options -weg and -vega
  • provide and IBD file
    • use option -i idbfile

typical command line

qtdt -d example.dat -p example.ped -i example.ibd -a- -weg -vega

real family data


paper

paper

files


data.txt


three files for QTDT

  • qtdt.ped
  • qtdt.dat
  • qtdt.ibd

data.txt

chromosomal (1-22, X) mean pihats

data<-read.table("data.txt", header=T)
data[1:2,1:24]
##      pairID chr1_pi chr2_pi chr3_pi chr4_pi chr5_pi chr6_pi chr7_pi
## 1 800301112  0.3025  0.4413  0.4603  0.3322  0.4801  0.2045  0.6479
## 2 801101112  0.5184  0.3173  0.4297  0.6732  0.5803  0.4266  0.3382
##   chr8_pi chr9_pi chr10_pi chr11_pi chr12_pi chr13_pi chr14_pi chr15_pi
## 1  0.1674  0.3484   0.4224   0.4550   0.2969   0.5484   0.2646   0.6484
## 2  0.6611  0.4706   0.3917   0.4542   0.4342   0.3589   0.4113   0.4557
##   chr16_pi chr17_pi chr18_pi chr19_pi chr20_pi chr21_pi chr22_pi chrx_pi
## 1   0.7575   0.5294   0.7745   0.6430   0.6818   0.8810   0.5376  0.4681
## 2   0.7145   0.6257   0.6315   0.8907   0.6510   0.3921   0.4344  0.7597

data.txt

chromosomal (1-22, X) mean IBD

data[1:2,25:47]
##   chr1_ibd chr2_ibd chr3_ibd chr4_ibd chr5_ibd chr6_ibd chr7_ibd chr8_ibd
## 1   0.0146   0.1576   0.1428   0.0201   0.2047   0.0102   0.4009   0.0318
## 2   0.1987   0.0300   0.1771   0.5068   0.3305   0.1260   0.0731   0.4637
##   chr9_ibd chr10_ibd chr11_ibd chr12_ibd chr13_ibd chr14_ibd chr15_ibd
## 1   0.0458    0.1916    0.1324    0.1090    0.4508    0.0107    0.3754
## 2   0.2977    0.1373    0.2333    0.1679    0.0037    0.0597    0.3768
##   chr16_ibd chr17_ibd chr18_ibd chr19_ibd chr20_ibd chr21_ibd chr22_ibd
## 1    0.5247    0.2466    0.5560    0.3028    0.3735    0.7689    0.1238
## 2    0.4518    0.3782    0.3355    0.7852    0.3151    0.0176    0.0309
##   chrx_ibd
## 1   0.4681
## 2   0.7597

data.txt

  • 48: genome-wide pihat; 49: genome-wide IBD
  • 50: sex (1=male); 51: age; 52 height; 53 z-score
  • 54-57: for sib 2
  • 58: sex code sib pair; 59: country code
data[1:2,48:59]
##    gw_pi gw_ibd sex_sib1 age_sib1 ht_sib1 zht_sib1 sex_sib2 age_sib2
## 1 0.4920 0.2361        1       16   178.0  0.47048        1       16
## 2 0.5119 0.2498        1       16   174.5 -0.05328        1       16
##   ht_sib2 zht_sib2 sex_pair pop
## 1     166   -1.325        1   2
## 2     185    1.518        1   2


data.txt

  • chr1_pi to chr22_pi
  • mean pihat \[=0.5*P_{1}+P_{2}\]
  • chrX = sex chromosome
    • 1/2 for male-male pairs
    • 3/4 for female-female pairs
    • 1/4 for male-female pairs

data.txt

  • chr1_ibd to chrx_ibd
  • mean IBD \[=P_{2}\]
  • mean probability of sharing 2 alleles IBD for each chromosome

exercise 1


  • calculate mean and SD of pihats and IBD
    • for each autosome
    • genome-wide
    • plot genome-wide pihat against IBD fo each sibpair
    • regress genome-wide pihat on genome-wide IBD

exercise 1


hints:

rowMeans(dat[,2:23])
apply(dat[,2:3],1,sd)

exercise 1

meanpi=rowMeans(dat[,2:23]);pihat_sd=apply(dat[,2:3],1,sd)
meanibd=rowMeans(dat[,25:46]);ibd2_sd=apply(dat[,25:46],1,sd)
plot(meanpi,meanibd, pch=20,col=4, xlab="genome-wide pihat", ylab="genome-wide IBD2")

plot of chunk unnamed-chunk-4

summary(lm(ibd2_mean~pihat_mean))
## 
## Call:
## lm(formula = ibd2_mean ~ pihat_mean)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.12674 -0.01129  0.00004  0.01125  0.06657 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -0.25602    0.00218    -117   <2e-16 ***
## pihat_mean   1.01194    0.00436     232   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.0171 on 11212 degrees of freedom
## Multiple R-squared:  0.828,  Adjusted R-squared:  0.828 
## F-statistic: 5.38e+04 on 1 and 11212 DF,  p-value: <2e-16

exercise 2


  • estimate the sib correlation for the standardised z-scores zht_sib1 & zht_sib2


  • why should we use the z-scores?

exercise 3


  • estimate heritability using QTDT
qtdt -d qtdt.dat -p qtdt.ped -a- -we -veg
  • estimate additive variance from genome wide pihat
qtdt -d qtdt.dat -p qtdt.ped -i qtdt.ibd -a- -weg -vega

exercise 3


  • estimate additive variance for a specific chromosome

  • need to edit .dat file and change one S2 to an M!