Description Usage Arguments Details Value References See Also Examples

Returns every statistic for each SNP location, given the appropriate parameters. See Details for more information.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 |

`pos` |
A numeric vector of SNP locations |

`ws` |
The window size which the statistics will be calculated over. This should be on the same scale as the |

`x` |
Optional. A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the |

`dist` |
Optional. A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as |

`LDprofile_bins` |
Optional. A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. |

`LDprofile_rsq` |
Optional. A numeric vector containing the expected |

`LDprofile_sd` |
Optional. A numeric vector containing the standard deviation of the |

`LDprofile_Beta_a` |
Optional. A numeric vector containing the first estimated Beta parameter for the corresponding bin in the LD profile. |

`LDprofile_Beta_b` |
Optional. A numeric vector containing the second estimated Beta parameter for the corresponding bin in the LD profile. |

`minRandL` |
Minimum number of SNPs in each set R and L for the statistics to be calculated. L is the set of SNPs to the left of the target SNP and R to the right, within the given window size |

`minRL` |
Minimum value for the product of the set sizes for R and L. Default is 25. |

`X` |
Optional. Specify a region of the chromosome to calculate the statistics for in the format |

Not all statistics will be returned, depending on the parameters supplied to the function.

If `x`

is not supplied, only `Zalpha_expected`

, `Zbeta_expected`

, `LR`

and `L_plus_R`

will be calculated.

For any of the statistics which use an expected *r^2* value, the parameters `dist`

, `LDprofile_bins`

and `LDprofile_rsq`

must be supplied.
This includes the statistics: `Zalpha_expected`

, `Zalpha_rsq_over_expected`

, `Zalpha_log_rsq_over_expected`

, `Zalpha_Zscore`

, `Zalpha_BetaCDF`

, `Zbeta_expected`

, `Zbeta_rsq_over_expected`

, `Zbeta_log_rsq_over_expected`

, `Zbeta_Zscore`

and `Zbeta_BetaCDF`

.

For

`Zalpha_Zscore`

and`Zbeta_Zscore`

to be calculated, the parameter`LDprofile_sd`

must also be supplied.For

`Zalpha_BetaCDF`

and`Zbeta_BetaCDF`

to be calculated, the parameters`LDprofile_Beta_a`

and`LDprofile_Beta_b`

must also be supplied.

The LD profile describes the expected correlation between SNPs at a given genetic distance, generated using simulations or
real data. Care should be taken to utilise an LD profile that is representative of the population in question. The LD
profile should consist of evenly sized bins of distances (for example 0.0001 cM per bin), where the value given is the (inclusive) lower
bound of the bin. Ideally, an LD profile would be generated using data from a null population with no selection, however one can be generated
using this data. See the `create_LDprofile`

function for more information on how to create an LD profile.
For more information about the statistics, please see Jacobs (2016).

A list containing the SNP positions and the statistics for those SNPs

Jacobs, G.S., T.J. Sluckin, and T. Kivisild, *Refining the Use of Linkage Disequilibrium as a Robust Signature of Selective Sweeps.* Genetics, 2016. **203**(4): p. 1807

`Zalpha`

, `Zalpha_expected`

, `Zalpha_rsq_over_expected`

, `Zalpha_log_rsq_over_expected`

, `Zalpha_Zscore`

, `Zalpha_BetaCDF`

, `Zbeta`

, `Zbeta_expected`

, `Zbeta_rsq_over_expected`

, `Zbeta_log_rsq_over_expected`

, `Zbeta_Zscore`

, `Zbeta_BetaCDF`

, `LR`

, `L_plus_R`

, `create_LDprofile`

.

1 2 3 4 5 6 7 8 9 10 11 12 | ```
## load the snps and LDprofile example datasets
data(snps)
data(LDprofile)
## run Zalpha_all over all the SNPs with a window size of 3000 bp
## will return all 15 statistics
Zalpha_all(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances,
LDprofile$bin,LDprofile$rsq,LDprofile$sd,LDprofile$Beta_a,LDprofile$Beta_b)
## only return results for SNPs between locations 600 and 1500 bp
Zalpha_all(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances,
LDprofile$bin,LDprofile$rsq,LDprofile$sd,LDprofile$Beta_a,LDprofile$Beta_b,X=c(600,1500))
## will only return statistics not requiring an LD profile
Zalpha_all(snps$bp_positions,3000,as.matrix(snps[,3:12]))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.