Description Usage Arguments Details Value Author(s) References Examples
Function computes the LD estimates for high-throughput sequencing data using the methodology by \insertCitebilton2018genetics2;textualGUSbase.
1 2 |
URobj |
An object of class UR created by the |
SNPpairs |
Matrix specifying the pairs of SNPs in which to calculate pairwise LD. See below for details. |
indsubset |
Vector of integer indices corresponding to individuals to be used in the LD calculations. Used to specify a subset of individuals of the data for which LD is calculated. |
nClust |
Integer number specifying the number of cores to use in the paralellization. |
LDmeasure |
Character vector specifying which LD measures to calculate. Predefined
measures are |
filename |
Character string giving the name of the file to write the LD results to. If NULL, the function returns the LD results instead of writing them to a file. |
dp |
Integer number specifying the number of decimal places to round the LD results.
Note: only works when |
Argument SNPpairs
must be an integer matrix with two columns, where the first column specify the
indices of the SNPs and the rows correspond to each SNP pair for which LD is to be computed.
If SNPpairs=NULL
, then LD is estimated for all the SNP paris in the
dataset.
To reduce computation time, the calculations are performed in parallel using the foreach
function. The nClust
argument specifies the number of cores to use in the parallelization. Note: do not
set this argument to more than the number of cores available (or bad things can happen!).
A matrix object with named columns is returned where the columns are:
[LDmeasure]: The LD estmate for the measure [LDmeasure]. Note: if multiple LD measures have been specified, then there will be a column for each LD measure
CHROM_SNP1: The chromosome number of the first SNP
CHROM_SNP2: The chromosome number of the second SNP
POS_SNP1: The position (in base pairs) of the first SNP on the chromosome
POS_SNP2: The position (in base pairs) of the second SNP on the chromosome
FREQ_SNP1: The allele frequency estimate of the first SNP (as used in the calculation of the LD measure)
FREQ_SNP2: The allele frequency estimate of the second SNP (as used in the calculation of the LD measure)
ERR_SNP1: The sequencing error estimate of the first SNP (as used in the calculation of the LD measure)
ERR_SNP2: The sequencing error estimate of the second SNP (as used in the calculation of the LD measure)
If filename=NULL
then the matrix object is returned to the R workspace, otherwise if filename
is specified
and corresponds to a vaild name, then the matrix object is written to a file called filename_GUSMap.txt.
Timothy P. Bilton
bilton2018genetics2GUSbase
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ## Read in the deer data that accompanies the package
deerfile <- deerData()
rafile <- VCFtoRA(deerfile)
deer <- readRA(rafile)
## Create unrelated population
ur <- makeUR(deer)
###### LD estimation #######
## Estimate all the pairwise LD
LDres <- GUSLD(ur)
head(LDres)
## write results to file
GUSLD(ur, file="results")
## Specifying SNP pairs explicitly
# block vs block
pairs <- as.matrix(expand.grid(1:10,11:20))
LDres <- GUSLD(ur, SNPpairs=pairs)
head(LDres)
# Five SNPs before and after
temp <- rep(1:37,rep(5,37))
pairs <- cbind(temp, temp + 1:5)
pairs <- pairs[-which(pairs[,2] > 38),]
LDres <- GUSLD(ur, SNPpairs=pairs)
head(LDres)
##### Non-standard LD measure: #######
## Define LD measure as the correlation coefficient
LD_r <- function(pA1,pA2,D){
return( D/sqrt((prod(c(pA1,pA2,1-c(pA1,pA2))))) )
}
LDres <- GUSLD(ur, LDmeasure="LD_r")
head(LDres)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.