diff --git a/R/LDprofile-data.R b/R/LDprofile-data.R index 25f1e0d63ebf6269a7c88da2b720c92e5dcc8892..8b8e869022c50dcdbae66014b2802a1f2c4430e2 100644 --- a/R/LDprofile-data.R +++ b/R/LDprofile-data.R @@ -1,6 +1,6 @@ #' Dataset containing an example LD profile #' -#' A simulated LD profile, containing example LD statisics for +#' A simulated LD profile, containing example LD statistics for #' genetic distances of 0 to 0.0049, in bins of size 0.0001. #' #' @docType data @@ -10,8 +10,8 @@ #' @format A data frame with 50 rows and 5 variables: #' \describe{ #' \item{bin}{the lower bound of each bin} -#' \item{rsq}{the expected rsq value for a pair of snps, where the genetic distance between them falls in the given bin} -#' \item{sd}{the standard deviation of the expected rsq value} +#' \item{rsq}{the expected \eqn{r^2}{r^2} value for a pair of SNPs, where the genetic distance between them falls in the given bin} +#' \item{sd}{the standard deviation of the expected \eqn{r^2}{r^2} value} #' \item{Beta_a}{the first shape parameter for the Beta distribution fitted for this bin} #' \item{Beta_b}{the second shape parameter for the Beta distribution fitted for this bin} #' } diff --git a/R/LR.R b/R/LR.R index a1ef8270aba10b3fc581165a6c3d3d9d211971c1..7c437eeeede32a9cd05aed2b319b99e666bac671 100644 --- a/R/LR.R +++ b/R/LR.R @@ -2,7 +2,7 @@ #' Runs the LR function #' #' Returns the \code{|L||R|} value for each SNP location supplied to the function. -#' For more information about the \code{|L||R|} diversity statistic please see Jacobs (2016). +#' For more information about the \code{|L||R|} diversity statistic, please see Jacobs (2016). #' #' @param pos A numeric vector of SNP locations #' @param ws The window size which the \code{LR} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. diff --git a/R/L_plus_R.R b/R/L_plus_R.R index 44425d36bbd2efa62959fcbe5d42d6e7614617fc..5bb83ef707728e4ff24994e0bbd8dc75046fc59c 100644 --- a/R/L_plus_R.R +++ b/R/L_plus_R.R @@ -2,7 +2,7 @@ #' Runs the L_plus_R function #' #' Returns the \eqn{{|L| \choose 2} + {|R| \choose 2}}{(|L| choose 2) + (|R| choose 2)} value for each SNP location supplied to the function. -#' For more information about the \code{L_plus_R} diversity statistic please see Jacobs (2016). +#' For more information about the \code{L_plus_R} diversity statistic, please see Jacobs (2016). #' #' #' diff --git a/R/Zalpha_BetaCDF.R b/R/Zalpha_BetaCDF.R index f07cf3f95d164b21bbdd128d6e749ae1e72c10b7..35e37d6f5fa58082d3193c344b50acd56490cfb6 100644 --- a/R/Zalpha_BetaCDF.R +++ b/R/Zalpha_BetaCDF.R @@ -4,7 +4,7 @@ #' #' Returns a \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic, please see Jacobs (2016). #' The \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic is defined as: #' \deqn{{Z_{\alpha}^{BetaCDF}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}\frac{B(r^2_{i,j};a,b)}{B(a,b)} + {|R| \choose 2}^{-1}\sum_{i,j \in R}\frac{B(r^2_{i,j};a,b)}{B(a,b)}}{2}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -12,14 +12,14 @@ #' the estimated a and b parameters from the LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor pbeta #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zalpha_Zscore.R b/R/Zalpha_Zscore.R index 65977b07d379c2a0581d5c141a7cb5a438304dc4..43f738fe330ddddc12163e5c66faf5974bf62366 100644 --- a/R/Zalpha_Zscore.R +++ b/R/Zalpha_Zscore.R @@ -4,21 +4,21 @@ #' #' Returns a \eqn{Z_{\alpha}^{Zscore}}{Zalpha} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic, please see Jacobs (2016). #' The \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic is defined as: #' \deqn{{Z_{\alpha}^{Zscore}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}\frac{r^2_{i,j}-E[r^2_{i,j}]}{\sigma[r^2_{i,j}]} + {|R| \choose 2}^{-1}\sum_{i,j \in R}\frac{r^2_{i,j}-E[r^2_{i,j}]}{\sigma[r^2_{i,j}]}}{2}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to #' the squared correlation between a pair of SNPs, \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile, and \eqn{\sigma[r^2]}{\sigma[r^2]} is the standard deviation. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zalpha_all.R b/R/Zalpha_all.R index eed6e3c90c088971d5576bd80191a518a4359659..2ec094f9a47bce7b97d82fc31ab3100cf2cb07a8 100644 --- a/R/Zalpha_all.R +++ b/R/Zalpha_all.R @@ -11,12 +11,12 @@ #' \item For \code{\link{Zalpha_Zscore}} and \code{\link{Zbeta_Zscore}} to be calculated, the parameter \code{LDprofile_sd} must also be supplied. #' \item For \code{\link{Zalpha_BetaCDF}} and \code{\link{Zbeta_BetaCDF}} to be calculated, the parameters \code{LDprofile_Beta_a} and \code{LDprofile_Beta_b} must also be supplied. #' } -#' For more information about the statistics please see Jacobs (2016). +#' For more information about the statistics, please see Jacobs (2016). #' #' @importFrom stats cor pbeta #' #' @param pos A numeric vector of SNP locations -#' @param 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 \code{pos} vector. SNPs should all be biallelic. +#' @param 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 \code{pos} vector. SNPs should all be biallelic. #' @param ws The window size which the statistics will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param dist Optional. A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param LDprofile_bins Optional. A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zalpha_expected.R b/R/Zalpha_expected.R index 108d9668c2e04000459b1a4d50d505a7a8f8afba..cc973493dad8887c91c851a85696b2eab936beef 100644 --- a/R/Zalpha_expected.R +++ b/R/Zalpha_expected.R @@ -4,15 +4,15 @@ #' #' Returns a \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} statistic, please see Jacobs (2016). #' The \eqn{Z_{\alpha}^{E[r^2]}} statistic is defined as: #' \deqn{{Z_{\alpha}^{E[r^2]}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}E[r^2_{i,j}] + {|R| \choose 2}^{-1}\sum_{i,j \in R}E[r^2_{i,j}]}{2}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, #' and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @param pos A numeric vector of SNP locations diff --git a/R/Zalpha_log_rsq_over_expected.R b/R/Zalpha_log_rsq_over_expected.R index 643bc9533de57c4c4a75795313dd34bff0808a3e..608860abc4c498a33ee39a15565ba2bf609921b3 100644 --- a/R/Zalpha_log_rsq_over_expected.R +++ b/R/Zalpha_log_rsq_over_expected.R @@ -4,21 +4,21 @@ #' #' Returns a \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic, please see Jacobs (2016). #' The \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic is defined as: #' \deqn{{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}log_{10}(r^2_{i,j}/E[r^2_{i,j}]) + {|R| \choose 2}^{-1}\sum_{i,j \in R}log_{10}(r^2_{i,j}/E[r^2_{i,j}])}{2}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to #' the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zalpha_rsq_over_expected.R b/R/Zalpha_rsq_over_expected.R index baf6f30967ba85de06ba4cc7f350fdf1d1e47b49..4f2f28c346837e0ae0fd6020c8f71542cc713d56 100644 --- a/R/Zalpha_rsq_over_expected.R +++ b/R/Zalpha_rsq_over_expected.R @@ -4,21 +4,21 @@ #' #' Returns a \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic, please see Jacobs (2016). #' The \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic is defined as: #' \deqn{{Z_{\alpha}^{r^2/E[r^2]}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j}/E[r^2_{i,j}] + {|R| \choose 2}^{-1}\sum_{i,j \in R}r^2_{i,j}/E[r^2_{i,j}]}{2}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to #' the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zbeta.R b/R/Zbeta.R index 84703643b49812bab4ade643f9246cb982985618..cfd8593d5eafa366d6f912b30f930adcbc1844fe 100644 --- a/R/Zbeta.R +++ b/R/Zbeta.R @@ -2,7 +2,7 @@ #' Runs the Zbeta function #' #' Returns a \eqn{Z_{\beta}}{Zbeta} value for each SNP location supplied to the function. -#' For more information about the \eqn{Z_{\beta}}{Zbeta} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\beta}}{Zbeta} statistic, please see Jacobs (2016). #' The \eqn{Z_{\beta}}{Zbeta} statistic is defined as: #' \deqn{Z_{\beta}=\frac{\sum_{i \in L,j \in R}r^2_{i,j}}{|L||R|}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, and \eqn{r^2}{r^2} is equal to the squared correlation between a pair of SNPs @@ -10,7 +10,7 @@ #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param ws The window size which the \eqn{Z_{\beta}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param minRandL Minimum number of SNPs in each set R and L for the statistic to be calculated. Default is 4. #' @param minRL Minimum value for the product of the set sizes for R and L. Default is 25. diff --git a/R/Zbeta_BetaCDF.R b/R/Zbeta_BetaCDF.R index 958b74d2859df701f98233d60497aa7bc604bbf1..fa09a274195ef7dc222d862f4f9e68fa7b1ef9d3 100644 --- a/R/Zbeta_BetaCDF.R +++ b/R/Zbeta_BetaCDF.R @@ -4,7 +4,7 @@ #' #' Returns a \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic, please see Jacobs (2016). #' The \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic is defined as: #' \deqn{Z_{\beta}^{BetaCDF}=\frac{\sum_{i \in L,j \in R}\frac{B(r^2_{i,j};a,b)}{B(a,b)}}{|L||R|}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -12,14 +12,14 @@ #' the estimated a and b parameters from the LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor pbeta #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zbeta_Zscore.R b/R/Zbeta_Zscore.R index b3867478bb851797e84b331270c788a8f989c6a8..82e3978e19af4cb0997fda5381a4b504aed39fcf 100644 --- a/R/Zbeta_Zscore.R +++ b/R/Zbeta_Zscore.R @@ -4,21 +4,21 @@ #' #' Returns a \eqn{Z_{\beta}^{Zscore}}{Zbeta} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic, please see Jacobs (2016). #' The \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic is defined as: #' \deqn{Z_{\beta}^{Zscore}=\frac{\sum_{i \in L,j \in R}\frac{r^2_{i,j}-E[r^2_{i,j}]}{\sigma[r^2_{i,j}]}}{|L||R|}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to #' the squared correlation between a pair of SNPs, \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile, and \eqn{\sigma[r^2]}{\sigma[r^2]} is the standard deviation. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zbeta_expected.R b/R/Zbeta_expected.R index e4a1332f90b48e6e3372b2b299ad5b1de972a098..9b8f25048f2ea63d50a0d9b7e9e212373f52ac2f 100644 --- a/R/Zbeta_expected.R +++ b/R/Zbeta_expected.R @@ -4,15 +4,15 @@ #' #' Returns a \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} statistic, please see Jacobs (2016). #' The \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} statistic is defined as: #' \deqn{Z_{\beta}^{E[r^2]}=\frac{\sum_{i \in L,j \in R}E[r^2_{i,j}]}{|L||R|}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, #' and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @param pos A numeric vector of SNP locations diff --git a/R/Zbeta_log_rsq_over_expected.R b/R/Zbeta_log_rsq_over_expected.R index 2ad4b8733eb53e42ff2da57562235c80a75e7f7b..238df9dc6a06dbeb0e24d1605f935f8c9103b100 100644 --- a/R/Zbeta_log_rsq_over_expected.R +++ b/R/Zbeta_log_rsq_over_expected.R @@ -4,21 +4,21 @@ #' #' Returns a \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic, please see Jacobs (2016). #' The \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic is defined as: #' \deqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}=\frac{\sum_{i \in L,j \in R}log_{10}(r^2_{i,j}/E[r^2_{i,j}])}{|L||R|}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to #' the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/Zbeta_rsq_over_expected.R b/R/Zbeta_rsq_over_expected.R index 5afa73e76ab8e30a63417bf5601abcc14d754cac..2fe6cbbae90b412d73b600d772722ce64cf3cf3c 100644 --- a/R/Zbeta_rsq_over_expected.R +++ b/R/Zbeta_rsq_over_expected.R @@ -4,21 +4,21 @@ #' #' Returns a \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} value for each SNP location supplied to the function, based on #' the expected \eqn{r^2} values given an LD profile and genetic distances. -#' For more information about the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic, please see Jacobs (2016). #' The \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic is defined as: #' \deqn{Z_{\beta}^{r^2/E[r^2]}=\frac{\sum_{i \in L,j \in R}r^2_{i,j}/E[r^2_{i,j}]}{|L||R|}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to #' the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a pair of SNPs, given an LD profile. #' #' 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 which is representative of the population in question. The LD -#' profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +#' 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.00001 cM per bin), where the value given is the (inclusive) lower #' bound of the bin. #' #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param dist A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}. #' @param ws The window size which the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param LDprofile_bins A numeric vector containing the lower bound of the bins used in the LD profile. These should be of equal size. diff --git a/R/zalpha.R b/R/zalpha.R index d744760c9330750850633102dadf22163f69fcdf..7414560439015b93e4a81ff19ddb7797e5c937f1 100644 --- a/R/zalpha.R +++ b/R/zalpha.R @@ -2,7 +2,7 @@ #' Runs the Zalpha function #' #' Returns a \eqn{Z_{\alpha}}{Zalpha} value for each SNP location supplied to the function. -#' For more information about the \eqn{Z_{\alpha}}{Zalpha} statistic please see Jacobs (2016). +#' For more information about the \eqn{Z_{\alpha}}{Zalpha} statistic, please see Jacobs (2016). #' The \eqn{Z_{\alpha}}{Zalpha} statistic is defined as: #' \deqn{Z_{\alpha}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j} + {|R| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j}}{2}} #' where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, and \eqn{r^2}{r^2} is equal to the squared correlation between a pair of SNPs @@ -10,7 +10,7 @@ #' @importFrom stats cor #' #' @param pos A numeric vector of SNP locations -#' @param x A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. +#' @param x A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic. #' @param ws The window size which the \eqn{Z_{\alpha}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector. #' @param minRandL Minimum number of SNPs in each set R and L for the statistic to be calculated. Default is 4. #' @param minRL Minimum value for the product of the set sizes for R and L. Default is 25. diff --git a/man/LDprofile.Rd b/man/LDprofile.Rd index b3c23d9f6474bc1bef358cae5193a719657881d2..a0ee7da5dc0733bd89c3664b70f01f9c05d1df10 100644 --- a/man/LDprofile.Rd +++ b/man/LDprofile.Rd @@ -7,8 +7,8 @@ \format{A data frame with 50 rows and 5 variables: \describe{ \item{bin}{the lower bound of each bin} - \item{rsq}{the expected rsq value for a pair of snps, where the genetic distance between them falls in the given bin} - \item{sd}{the standard deviation of the expected rsq value} + \item{rsq}{the expected \eqn{r^2}{r^2} value for a pair of SNPs, where the genetic distance between them falls in the given bin} + \item{sd}{the standard deviation of the expected \eqn{r^2}{r^2} value} \item{Beta_a}{the first shape parameter for the Beta distribution fitted for this bin} \item{Beta_b}{the second shape parameter for the Beta distribution fitted for this bin} }} @@ -16,7 +16,7 @@ data(LDprofile) } \description{ -A simulated LD profile, containing example LD statisics for +A simulated LD profile, containing example LD statistics for genetic distances of 0 to 0.0049, in bins of size 0.0001. } \keyword{datasets} diff --git a/man/LR.Rd b/man/LR.Rd index 690e369ba22ce9e1e63e65d56cae7470641ea656..2aec83fb01fd33c5c1b15285f148cd56f07e4079 100644 --- a/man/LR.Rd +++ b/man/LR.Rd @@ -18,7 +18,7 @@ A list containing the SNP positions and the \code{LR} values for those SNPs } \description{ Returns the \code{|L||R|} value for each SNP location supplied to the function. -For more information about the \code{|L||R|} diversity statistic please see Jacobs (2016). +For more information about the \code{|L||R|} diversity statistic, please see Jacobs (2016). } \examples{ ## load the snps example dataset diff --git a/man/L_plus_R.Rd b/man/L_plus_R.Rd index eb3cd741e8690defb1834f52892ebc61de6fd135..1567e722f6c3b602cada662fbc87d1862b619826 100644 --- a/man/L_plus_R.Rd +++ b/man/L_plus_R.Rd @@ -18,7 +18,7 @@ A list containing the SNP positions and the \code{L_plus_R }values for those SNP } \description{ Returns the \eqn{{|L| \choose 2} + {|R| \choose 2}}{(|L| choose 2) + (|R| choose 2)} value for each SNP location supplied to the function. -For more information about the \code{L_plus_R} diversity statistic please see Jacobs (2016). +For more information about the \code{L_plus_R} diversity statistic, please see Jacobs (2016). } \examples{ ## load the snps example dataset diff --git a/man/Zalpha_BetaCDF.Rd b/man/Zalpha_BetaCDF.Rd index 682b59f36c5a422b2add7b4427d88c36856b43e5..b921b5a4cb4b99a637dd557cace5d483533d902a 100644 --- a/man/Zalpha_BetaCDF.Rd +++ b/man/Zalpha_BetaCDF.Rd @@ -10,7 +10,7 @@ Zalpha_BetaCDF(pos, x, dist, ws, LDprofile_bins, LDprofile_Beta_a, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -34,7 +34,7 @@ A list containing the SNP positions and the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} v \description{ Returns a \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic, please see Jacobs (2016). The \eqn{Z_{\alpha}^{BetaCDF}}{Zalpha} statistic is defined as: \deqn{{Z_{\alpha}^{BetaCDF}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}\frac{B(r^2_{i,j};a,b)}{B(a,b)} + {|R| \choose 2}^{-1}\sum_{i,j \in R}\frac{B(r^2_{i,j};a,b)}{B(a,b)}}{2}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -43,8 +43,8 @@ the estimated a and b parameters from the LD profile. } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zalpha_Zscore.Rd b/man/Zalpha_Zscore.Rd index 8c0e88e36aa7454b78371382b16cbdf184c92196..d65fa1ee39e200c49469b6ca758565a4a4646e7f 100644 --- a/man/Zalpha_Zscore.Rd +++ b/man/Zalpha_Zscore.Rd @@ -10,7 +10,7 @@ Zalpha_Zscore(pos, x, dist, ws, LDprofile_bins, LDprofile_rsq, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -34,7 +34,7 @@ A list containing the SNP positions and the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} va \description{ Returns a \eqn{Z_{\alpha}^{Zscore}}{Zalpha} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic, please see Jacobs (2016). The \eqn{Z_{\alpha}^{Zscore}}{Zalpha} statistic is defined as: \deqn{{Z_{\alpha}^{Zscore}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}\frac{r^2_{i,j}-E[r^2_{i,j}]}{\sigma[r^2_{i,j}]} + {|R| \choose 2}^{-1}\sum_{i,j \in R}\frac{r^2_{i,j}-E[r^2_{i,j}]}{\sigma[r^2_{i,j}]}}{2}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -42,8 +42,8 @@ the squared correlation between a pair of SNPs, \eqn{E[r^2]}{E[r^2]} is equal to } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zalpha_all.Rd b/man/Zalpha_all.Rd index 5040d380ead1e9df44a1c0d0c6c11833510327b2..3b2f5319ebf30b97d5c7ada8f276c75a708ad43f 100644 --- a/man/Zalpha_all.Rd +++ b/man/Zalpha_all.Rd @@ -11,7 +11,7 @@ Zalpha_all(pos, x = NULL, ws, dist = NULL, LDprofile_bins = NULL, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{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 \code{pos} vector. SNPs should all be biallelic.} +\item{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 \code{pos} vector. SNPs should all be biallelic.} \item{ws}{The window size which the statistics will be calculated over. This should be on the same scale as the \code{pos} vector.} @@ -48,7 +48,7 @@ This includes the statistics: \code{\link{Zalpha_expected}}, \code{\link{Zalpha_ \item For \code{\link{Zalpha_Zscore}} and \code{\link{Zbeta_Zscore}} to be calculated, the parameter \code{LDprofile_sd} must also be supplied. \item For \code{\link{Zalpha_BetaCDF}} and \code{\link{Zbeta_BetaCDF}} to be calculated, the parameters \code{LDprofile_Beta_a} and \code{LDprofile_Beta_b} must also be supplied. } -For more information about the statistics please see Jacobs (2016). +For more information about the statistics, please see Jacobs (2016). } \examples{ ## load the snps and LDprofile example datasets diff --git a/man/Zalpha_expected.Rd b/man/Zalpha_expected.Rd index c15446dfad3a0ac118b38a0b0ef689dac95e99a3..cfcf21f1bb34e749aa26edc6ea9b9d7da1888d78 100644 --- a/man/Zalpha_expected.Rd +++ b/man/Zalpha_expected.Rd @@ -30,7 +30,7 @@ A list containing the SNP positions and the \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} va \description{ Returns a \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\alpha}^{E[r^2]}}{Zalpha} statistic, please see Jacobs (2016). The \eqn{Z_{\alpha}^{E[r^2]}} statistic is defined as: \deqn{{Z_{\alpha}^{E[r^2]}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}E[r^2_{i,j}] + {|R| \choose 2}^{-1}\sum_{i,j \in R}E[r^2_{i,j}]}{2}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, @@ -38,8 +38,8 @@ and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zalpha_log_rsq_over_expected.Rd b/man/Zalpha_log_rsq_over_expected.Rd index 07f410abdefad46cac413e9380443737cf18028c..3fe024a9bd7734b00fb304769b58a894a2bf2fde 100644 --- a/man/Zalpha_log_rsq_over_expected.Rd +++ b/man/Zalpha_log_rsq_over_expected.Rd @@ -10,7 +10,7 @@ Zalpha_log_rsq_over_expected(pos, x, dist, ws, LDprofile_bins, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -32,7 +32,7 @@ A list containing the SNP positions and the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2] \description{ Returns a \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic, please see Jacobs (2016). The \eqn{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}{Zalpha} statistic is defined as: \deqn{{Z_{\alpha}^{log_{10}(r^2/E[r^2])}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}log_{10}(r^2_{i,j}/E[r^2_{i,j}]) + {|R| \choose 2}^{-1}\sum_{i,j \in R}log_{10}(r^2_{i,j}/E[r^2_{i,j}])}{2}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -40,8 +40,8 @@ the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equa } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zalpha_rsq_over_expected.Rd b/man/Zalpha_rsq_over_expected.Rd index 5a770139a38602584f02d33567e23d1c38cd2d1a..52846dc963606e647c6e1d3fa6f0d9b1424050b8 100644 --- a/man/Zalpha_rsq_over_expected.Rd +++ b/man/Zalpha_rsq_over_expected.Rd @@ -10,7 +10,7 @@ Zalpha_rsq_over_expected(pos, x, dist, ws, LDprofile_bins, LDprofile_rsq, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -32,7 +32,7 @@ A list containing the SNP positions and the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha \description{ Returns a \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic, please see Jacobs (2016). The \eqn{Z_{\alpha}^{r^2/E[r^2]}}{Zalpha} statistic is defined as: \deqn{{Z_{\alpha}^{r^2/E[r^2]}}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j}/E[r^2_{i,j}] + {|R| \choose 2}^{-1}\sum_{i,j \in R}r^2_{i,j}/E[r^2_{i,j}]}{2}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -40,8 +40,8 @@ the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equa } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zbeta.Rd b/man/Zbeta.Rd index 7fab5d60a5488129f012cee28747704c68bd26ae..f411b5fa45f8bc61ce11d45dc8a8a1861230c462 100644 --- a/man/Zbeta.Rd +++ b/man/Zbeta.Rd @@ -9,7 +9,7 @@ Zbeta(pos, x, ws, minRandL = 4, minRL = 25, X = NULL) \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{ws}{The window size which the \eqn{Z_{\beta}}{Zbeta} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.} @@ -24,7 +24,7 @@ A list containing the SNP positions and the \eqn{Z_{\beta}}{Zbeta} values for th } \description{ Returns a \eqn{Z_{\beta}}{Zbeta} value for each SNP location supplied to the function. -For more information about the \eqn{Z_{\beta}}{Zbeta} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\beta}}{Zbeta} statistic, please see Jacobs (2016). The \eqn{Z_{\beta}}{Zbeta} statistic is defined as: \deqn{Z_{\beta}=\frac{\sum_{i \in L,j \in R}r^2_{i,j}}{|L||R|}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, and \eqn{r^2}{r^2} is equal to the squared correlation between a pair of SNPs diff --git a/man/Zbeta_BetaCDF.Rd b/man/Zbeta_BetaCDF.Rd index e1b65173e124af4f745b7d8d5577c4641c9c997d..8fa974b5c6e0b52eff73b05bf9eb01b8d420bb6a 100644 --- a/man/Zbeta_BetaCDF.Rd +++ b/man/Zbeta_BetaCDF.Rd @@ -10,7 +10,7 @@ Zbeta_BetaCDF(pos, x, dist, ws, LDprofile_bins, LDprofile_Beta_a, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -34,7 +34,7 @@ A list containing the SNP positions and the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} val \description{ Returns a \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic, please see Jacobs (2016). The \eqn{Z_{\beta}^{BetaCDF}}{Zbeta} statistic is defined as: \deqn{Z_{\beta}^{BetaCDF}=\frac{\sum_{i \in L,j \in R}\frac{B(r^2_{i,j};a,b)}{B(a,b)}}{|L||R|}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -43,8 +43,8 @@ the estimated a and b parameters from the LD profile. } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zbeta_Zscore.Rd b/man/Zbeta_Zscore.Rd index cfe5bf656a225ee34114f76b4e185244ac4b2e45..0cf6b0d42c88b424d7a088fbd6040d3ac49ca107 100644 --- a/man/Zbeta_Zscore.Rd +++ b/man/Zbeta_Zscore.Rd @@ -10,7 +10,7 @@ Zbeta_Zscore(pos, x, dist, ws, LDprofile_bins, LDprofile_rsq, LDprofile_sd, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -34,7 +34,7 @@ A list containing the SNP positions and the \eqn{Z_{\beta}^{Zscore}}{Zbeta} valu \description{ Returns a \eqn{Z_{\beta}^{Zscore}}{Zbeta} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic, please see Jacobs (2016). The \eqn{Z_{\beta}^{Zscore}}{Zbeta} statistic is defined as: \deqn{Z_{\beta}^{Zscore}=\frac{\sum_{i \in L,j \in R}\frac{r^2_{i,j}-E[r^2_{i,j}]}{\sigma[r^2_{i,j}]}}{|L||R|}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -42,8 +42,8 @@ the squared correlation between a pair of SNPs, \eqn{E[r^2]}{E[r^2]} is equal to } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zbeta_expected.Rd b/man/Zbeta_expected.Rd index 5b848596899f1a2be80cac7e8a64d6c07453d90a..52d448c91e5d4d9394b646dfad05d0e7a78cb3c9 100644 --- a/man/Zbeta_expected.Rd +++ b/man/Zbeta_expected.Rd @@ -30,7 +30,7 @@ A list containing the SNP positions and the \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} valu \description{ Returns a \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} statistic, please see Jacobs (2016). The \eqn{Z_{\beta}^{E[r^2]}}{Zbeta} statistic is defined as: \deqn{Z_{\beta}^{E[r^2]}=\frac{\sum_{i \in L,j \in R}E[r^2_{i,j}]}{|L||R|}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, @@ -38,8 +38,8 @@ and \eqn{E[r^2]}{E[r^2]} is equal to the expected squared correlation between a } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zbeta_log_rsq_over_expected.Rd b/man/Zbeta_log_rsq_over_expected.Rd index 9138232be64198a7cc6ff53d0259061e617aeda9..4138545dbb74f3122c6f15c55bc210502bbc68bd 100644 --- a/man/Zbeta_log_rsq_over_expected.Rd +++ b/man/Zbeta_log_rsq_over_expected.Rd @@ -10,7 +10,7 @@ Zbeta_log_rsq_over_expected(pos, x, dist, ws, LDprofile_bins, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -32,7 +32,7 @@ A list containing the SNP positions and the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2]) \description{ Returns a \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic, please see Jacobs (2016). The \eqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}}{Zbeta} statistic is defined as: \deqn{Z_{\beta}^{log_{10}(r^2/E[r^2])}=\frac{\sum_{i \in L,j \in R}log_{10}(r^2_{i,j}/E[r^2_{i,j}])}{|L||R|}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -40,8 +40,8 @@ the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equa } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/Zbeta_rsq_over_expected.Rd b/man/Zbeta_rsq_over_expected.Rd index 13e9251b7a1629d4b1a2d78702e725cbb44d9cbc..2fdfcee28e370931f3553665b381482777b4b3e8 100644 --- a/man/Zbeta_rsq_over_expected.Rd +++ b/man/Zbeta_rsq_over_expected.Rd @@ -10,7 +10,7 @@ Zbeta_rsq_over_expected(pos, x, dist, ws, LDprofile_bins, LDprofile_rsq, \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{dist}{A numeric vector of genetic distances (e.g. cM, LDU). This should be the same length as \code{pos}.} @@ -32,7 +32,7 @@ A list containing the SNP positions and the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} \description{ Returns a \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} value for each SNP location supplied to the function, based on the expected \eqn{r^2} values given an LD profile and genetic distances. -For more information about the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic, please see Jacobs (2016). The \eqn{Z_{\beta}^{r^2/E[r^2]}}{Zbeta} statistic is defined as: \deqn{Z_{\beta}^{r^2/E[r^2]}=\frac{\sum_{i \in L,j \in R}r^2_{i,j}/E[r^2_{i,j}]}{|L||R|}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, \eqn{r^2}{r^2} is equal to @@ -40,8 +40,8 @@ the squared correlation between a pair of SNPs, and \eqn{E[r^2]}{E[r^2]} is equa } \details{ 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 which is representative of the population in question. The LD -profile should consist of evenly-sized bins of distances (for example 0.00001 cM per bin), where the value given is the (inclusive) lower +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.00001 cM per bin), where the value given is the (inclusive) lower bound of the bin. } \examples{ diff --git a/man/zalpha.Rd b/man/zalpha.Rd index 78f503e1f6c0d8b6ecc0e94c54ae692d42385f6f..4b72dd0af607fa8386228eecaa999d4e41e28094 100644 --- a/man/zalpha.Rd +++ b/man/zalpha.Rd @@ -9,7 +9,7 @@ Zalpha(pos, x, ws, minRandL = 4, minRL = 25, X = NULL) \arguments{ \item{pos}{A numeric vector of SNP locations} -\item{x}{A matrix of SNP values. Columns represent chromosomes, rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} +\item{x}{A matrix of SNP values. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{pos} vector. SNPs should all be biallelic.} \item{ws}{The window size which the \eqn{Z_{\alpha}}{Zalpha} statistic will be calculated over. This should be on the same scale as the \code{pos} vector.} @@ -24,7 +24,7 @@ A list containing the SNP positions and the \eqn{Z_{\alpha}}{Zalpha} values for } \description{ Returns a \eqn{Z_{\alpha}}{Zalpha} value for each SNP location supplied to the function. -For more information about the \eqn{Z_{\alpha}}{Zalpha} statistic please see Jacobs (2016). +For more information about the \eqn{Z_{\alpha}}{Zalpha} statistic, please see Jacobs (2016). The \eqn{Z_{\alpha}}{Zalpha} statistic is defined as: \deqn{Z_{\alpha}=\frac{{|L| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j} + {|R| \choose 2}^{-1}\sum_{i,j \in L}r^2_{i,j}}{2}} where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of the current locus within the given window \code{ws}, and \eqn{r^2}{r^2} is equal to the squared correlation between a pair of SNPs