
Returns a |L|
and |R|
are the number of SNPs to the left and right of the current locus within the given window ws
,
and
Zbeta_expected(
pos,
ws,
dist,
LDprofile_bins,
LDprofile_rsq,
minRandL = 4,
minRL = 25,
X = NULL
)
A numeric vector of SNP locations
The window size which the pos
vector.
A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as pos
.
A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size.
A numeric vector containing the expected
Minimum number of SNPs in each set R and L for the statistic to be calculated. Default is 4.
Minimum value for the product of the set sizes for R and L. Default is 25.
Optional. Specify a region of the chromosome to calculate c(startposition, endposition)
. The start position and the end position should be within the extremes of the positions given in the pos
vector. If not supplied, the function will calculate pos
vector.
A list containing the SNP positions and the
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.
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
# NOT RUN {
## load the snps and LDprofile example datasets
data(snps)
data(LDprofile)
## run Zbeta_expected over all the SNPs with a window size of 3000 bp
Zbeta_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq)
## only return results for SNPs between locations 600 and 1500 bp
Zbeta_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500))
# }
Run the code above in your browser using DataLab