ANGSD: Analysis of next generation Sequencing Data
Latest tar.gz version is (0.938/0.939 on github), see Change_log for changes, and download it here.
Relatedness: Difference between revisions
(Created page with " * NGSrelate - estimation of kinship coefficients In order to estimate kinship coefficient then population allele frequencies are needed. These can be estimated from data if ...") |
No edit summary |
||
(19 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== NGSrelate - estimation of IBD probabilities == | |||
In order to estimate kinship coefficient then population allele frequencies are needed. These can be estimated from data if you can multiple individuals. For some individuals, for example most human populations, there are publicly available data. | In order to estimate kinship coefficient then population allele frequencies are needed. These can be estimated from data if you can multiple individuals. For some individuals, for example most human populations, there are publicly available data. | ||
If you can obtain population allele frequencies then we recommend that you use NGSrelate. | If you can obtain population allele frequencies or have a many samples from your population then we recommend that you use NGSrelate has works with ANGSD output. From the estimated IBD probabilities you can then infer the relationship. Below is a table of the expected IBD sharing probabilities assuming no inbreeding | ||
{| class="wikitable" style="text-align: center | |||
!| Relationship || <math>K_0</math>|| <math>K_1</math> || <math>K_2</math> | |||
|- | |||
| mono-zygotic twin || <math>0 </math> || <math>0</math> || <math>1 </math> | |||
|- | |||
| Parent-Offspring || <math>0 </math> || <math>1</math> || <math>0 </math> | |||
|- | |||
| Full siblings || <math>0.25 </math> || <math> 0.5 </math> || <math> 0.25 </math> | |||
|- | |||
| Half siblings || <math> 0.5 </math> || <math>0.5 </math> || <math> 0 </math> | |||
|- | |||
| First cousins || <math>0.75 </math> || <math>0.25 </math> || <math> 0 </math> | |||
|- | |||
| Unrelated || <math>1 </math> || <math>0 </math> || <math> 0 </math> | |||
|} | |||
If you do not have population allele frequencies the you cannot estimate kinship coefficients. However, you can still make some claims about the relationship of your samples based on IBS patterns. | NGSrelate has its very own website http://www.popgen.dk/software/index.php/NgsRelate | ||
== IBS/genotype distribution == | |||
If you do not have population allele frequencies the you cannot estimate kinship coefficients. However, you can still make some claims about the relationship of your samples based on IBS patterns. Below is an example of IBS patterns between two individuals where we ignore the allele types. G is the genotype that counts for example the number of derived or non-reference alleles. Basically it is the 2D SFS where the is just 1 individual in each of the two populations | |||
The full decription of the method can be seen here: [http://www.popgen.dk/software/index.php/IBSrelate IBSrelate] | |||
{| class="wikitable" style="text-align: center | |||
!| || || ind2 || | |||
|- | |||
!| ind1 || <math>G=0 </math> || <math>G=1 </math> ||<math>G=2 </math> | |||
|- | |||
| <math>G=0 </math> || <math>A </math> || <math>D</math> || <math>G </math> | |||
|- | |||
| <math>G=1 </math> || <math> B </math> || <math> E </math> || <math> H </math> | |||
|- | |||
| <math>G=2 </math> || <math> C </math> || <math>F </math> || <math> I </math> | |||
|} | |||
Here are some usefull ratio of IBS that can be used to say something about relatedness. Here we assume no inbreeding. | |||
{| class="wikitable" style="text-align: center | |||
!| Relationship || Expected ratio || Expected ratio (R1) || Expected ratio (R1) | |||
|- | |||
| mono-zygotic twin || <math>B,C,D,F,G,H=0 </math> || <math> \frac{E}{B+C+D+F+G+H}= \infty </math> || - | |||
|- | |||
| Parent-Offspring || <math>C,G=0 </math> || <math> \frac{E}{B+C+D+F+G+H}=0.5 </math> || - | |||
|- | |||
| Full siblings || <math> \frac{E}{C+G}>10 </math> || <math> \frac{E}{B+C+D+F+G+H}>0.5 </math> || <math> \frac{E}{B+C+D+F+G+H}<10/13 </math> | |||
|- | |||
| Half siblings || <math> \frac{E}{C+G}>4 </math> || <math> \frac{E}{B+C+D+F+G+H}<4/9</math> || <math> \frac{E}{B+C+D+F+G+H}> 1/6</math> | |||
|- | |||
| First cousins || <math> \frac{E}{C+G}>8/3 </math> || <math> \frac{E}{B+C+D+F+G+H}<8/19</math> || <math> \frac{E}{B+C+D+F+G+H}> 1/14 </math> | |||
|- | |||
| Unrelated || <math> \frac{E}{C+G}=2 </math> || <math> \frac{E}{B+C+D+F+G+H}<4/10</math> || <math> \frac{E}{B+C+D+F+G+H}> 0 </math> | |||
|} | |||
[[File:ratioRel.png|800px]] | |||
=== How to get the IBS pattern === | |||
You can get the estimate by using the [[2d_SFS_Estimation| 2D SFS method]] or you can use the [[Genotype_Distribution| genotype distribution method]] both in ANGSD. | |||
The two methods are very similar but with a very small difference. The SFS method uses ancestral information or a reference in order to infer the 2 alleles for each position. The genotype distribution does not infer either the major or the minor allele but uses all 10 possible genotype likelihoods. | |||
=== Rcode to get expectations=== | |||
<pre> | |||
# R code go get expected IBS pattern | |||
## k is the 3 IBD sharing probabities | |||
## f is the allele frequency | |||
getEst<-function(k=c(1,0,0),f=0.5){ | |||
p<-f | |||
q<-1-f | |||
m0<-rbind( | |||
c(p^4,2*p^3*q,p^2*q^2), | |||
c(2*p^3*q,4*p^2*q^2,2*p*q^3), | |||
c(p^2*q^2,2*q^3*p,q^4) | |||
) | |||
m1<-rbind( | |||
c(p^3,p^2*q,0), | |||
c(p^2*q,p^2*q+q^2*p,p*q^2), | |||
c(0,q^2*p,q^3) | |||
) | |||
m2<-rbind( | |||
c(p^2,0,0), | |||
c(0,2*p*q,0), | |||
c(0,0,q^2) | |||
) | |||
return(k[1]*m0+k[2]*m1+k[3]*m2) | |||
} | |||
getEst(k=c(1,0,0),f=0.5) | |||
[,1] [,2] [,3] | |||
[1,] 0.0625 0.125 0.0625 | |||
[2,] 0.1250 0.250 0.1250 | |||
[3,] 0.0625 0.125 0.0625 | |||
</pre> |
Latest revision as of 08:21, 29 August 2019
NGSrelate - estimation of IBD probabilities
In order to estimate kinship coefficient then population allele frequencies are needed. These can be estimated from data if you can multiple individuals. For some individuals, for example most human populations, there are publicly available data. If you can obtain population allele frequencies or have a many samples from your population then we recommend that you use NGSrelate has works with ANGSD output. From the estimated IBD probabilities you can then infer the relationship. Below is a table of the expected IBD sharing probabilities assuming no inbreeding
Relationship | |||
---|---|---|---|
mono-zygotic twin | |||
Parent-Offspring | |||
Full siblings | |||
Half siblings | |||
First cousins | |||
Unrelated |
NGSrelate has its very own website http://www.popgen.dk/software/index.php/NgsRelate
IBS/genotype distribution
If you do not have population allele frequencies the you cannot estimate kinship coefficients. However, you can still make some claims about the relationship of your samples based on IBS patterns. Below is an example of IBS patterns between two individuals where we ignore the allele types. G is the genotype that counts for example the number of derived or non-reference alleles. Basically it is the 2D SFS where the is just 1 individual in each of the two populations The full decription of the method can be seen here: IBSrelate
ind2 | |||
---|---|---|---|
ind1 | |||
Here are some usefull ratio of IBS that can be used to say something about relatedness. Here we assume no inbreeding.
Relationship | Expected ratio | Expected ratio (R1) | Expected ratio (R1) |
---|---|---|---|
mono-zygotic twin | - | ||
Parent-Offspring | - | ||
Full siblings | |||
Half siblings | |||
First cousins | |||
Unrelated |
How to get the IBS pattern
You can get the estimate by using the 2D SFS method or you can use the genotype distribution method both in ANGSD.
The two methods are very similar but with a very small difference. The SFS method uses ancestral information or a reference in order to infer the 2 alleles for each position. The genotype distribution does not infer either the major or the minor allele but uses all 10 possible genotype likelihoods.
Rcode to get expectations
# R code go get expected IBS pattern ## k is the 3 IBD sharing probabities ## f is the allele frequency getEst<-function(k=c(1,0,0),f=0.5){ p<-f q<-1-f m0<-rbind( c(p^4,2*p^3*q,p^2*q^2), c(2*p^3*q,4*p^2*q^2,2*p*q^3), c(p^2*q^2,2*q^3*p,q^4) ) m1<-rbind( c(p^3,p^2*q,0), c(p^2*q,p^2*q+q^2*p,p*q^2), c(0,q^2*p,q^3) ) m2<-rbind( c(p^2,0,0), c(0,2*p*q,0), c(0,0,q^2) ) return(k[1]*m0+k[2]*m1+k[3]*m2) } getEst(k=c(1,0,0),f=0.5) [,1] [,2] [,3] [1,] 0.0625 0.125 0.0625 [2,] 0.1250 0.250 0.1250 [3,] 0.0625 0.125 0.0625