diff --git a/R/LR.R b/R/LR.R index e99fd28598d6dd441a1a0cd06323973679434141..ac5bc5ce42aa2b00425b309faad17e37183156c0 100644 --- a/R/LR.R +++ b/R/LR.R @@ -14,9 +14,9 @@ #' ## load the snps example dataset #' data(snps) #' ## run LR over all the SNPs with a window size of 3000 bp -#' LR(snps$positions,3000) +#' LR(snps$bp_positions,3000) #' ## only return results for SNPs between locations 600 and 1500 bp -#' LR(snps$positions,3000,X=c(600,1500)) +#' LR(snps$bp_positions,3000,X=c(600,1500)) #' #' @export diff --git a/R/L_plus_R.R b/R/L_plus_R.R index ffbbf0a6b4cdba48ea8fb0b76a473bed2132b46f..848b6b215d51e86aa7230dc686c0bd5c388f32a2 100644 --- a/R/L_plus_R.R +++ b/R/L_plus_R.R @@ -16,9 +16,9 @@ #' ## load the snps example dataset #' data(snps) #' ## run L_plus_R over all the SNPs with a window size of 3000 bp -#' L_plus_R(snps$positions,3000) +#' L_plus_R(snps$bp_positions,3000) #' ## only return results for SNPs between locations 600 and 1500 bp -#' L_plus_R(snps$positions,3000,X=c(600,1500)) +#' L_plus_R(snps$bp_positions,3000,X=c(600,1500)) #' #' @export diff --git a/R/Zalpha_BetaCDF.R b/R/Zalpha_BetaCDF.R index 69442fa8fc220403c9af36eb3c2b5fc359d292d5..4ccfd62ca5fd031af3d942d1a44deec995174733 100644 --- a/R/Zalpha_BetaCDF.R +++ b/R/Zalpha_BetaCDF.R @@ -36,10 +36,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zalpha_BetaCDF over all the SNPs with a window size of 3000 bp -#' Zalpha_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zalpha_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b,X=c(600,1500)) #' #' @export diff --git a/R/Zalpha_Zscore.R b/R/Zalpha_Zscore.R index 0f57e56b0c95352d704f777b554c71f03e6034f2..ecc0c40a18df66fc1f2f6087a46fcc10ac5ce09f 100644 --- a/R/Zalpha_Zscore.R +++ b/R/Zalpha_Zscore.R @@ -35,10 +35,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zalpha_Zscore over all the SNPs with a window size of 3000 bp -#' Zalpha_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,LDprofile$sd) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zalpha_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,LDprofile$sd,X=c(600,1500)) #' #' @export diff --git a/R/Zalpha_all.R b/R/Zalpha_all.R index b6a40be1e9efb252de5d88b5aea07c21840b039e..20c6a0132962f393d89071b85a94cdfc10dd6e14 100644 --- a/R/Zalpha_all.R +++ b/R/Zalpha_all.R @@ -36,13 +36,13 @@ #' data(LDprofile) #' ## run Zalpha_all over all the SNPs with a window size of 3000 bp #' ## will return all 15 statistics -#' Zalpha_all(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' 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$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' 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$positions,3000,as.matrix(snps[,3:12])) +#'Zalpha_all(snps$bp_positions,3000,as.matrix(snps[,3:12])) #' #' @export #' @seealso \code{\link{Zalpha}} \code{\link{Zalpha_expected}} \code{\link{Zalpha_rsq_over_expected}} \code{\link{Zalpha_log_rsq_over_expected}} \code{\link{Zalpha_Zscore}} \code{\link{Zalpha_BetaCDF}} \code{\link{Zbeta}} \code{\link{Zbeta_expected}} \code{\link{Zbeta_rsq_over_expected}} \code{\link{Zbeta_log_rsq_over_expected}} \code{\link{Zbeta_Zscore}} \code{\link{Zbeta_BetaCDF}} \code{\link{LR}} \code{\link{L_plus_R}} diff --git a/R/Zalpha_expected.R b/R/Zalpha_expected.R index b5788aead1194d29600deac226219ad5cdca6aa9..1112fbf9dfecacf926b7c804ca07151265e0b8b9 100644 --- a/R/Zalpha_expected.R +++ b/R/Zalpha_expected.R @@ -31,9 +31,9 @@ #' data(snps) #' data(LDprofile) #' ## run Zalpha_expected over all the SNPs with a window size of 3000 bp -#' Zalpha_expected(snps$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq) +#' Zalpha_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zalpha_expected(snps$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) +#' Zalpha_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) #' #' @export #' diff --git a/R/Zalpha_log_rsq_over_expected.R b/R/Zalpha_log_rsq_over_expected.R index 18a1141f5fbf25ff4cb201a9cef6f42d1c66f05a..9548804ca9072184b0e022e145325d7f11134f45 100644 --- a/R/Zalpha_log_rsq_over_expected.R +++ b/R/Zalpha_log_rsq_over_expected.R @@ -34,10 +34,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zalpha_log_rsq_over_expected over all the SNPs with a window size of 3000 bp -#' Zalpha_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zalpha_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,X=c(600,1500)) #' #' @export diff --git a/R/Zalpha_rsq_over_expected.R b/R/Zalpha_rsq_over_expected.R index 7e8ef5d15664a6581b6cd38d0172247b21986374..732c03bfe2483887ea4e67d579a9bd2f28ad3633 100644 --- a/R/Zalpha_rsq_over_expected.R +++ b/R/Zalpha_rsq_over_expected.R @@ -34,10 +34,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zalpha_rsq_over_expected over all the SNPs with a window size of 3000 bp -#' Zalpha_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zalpha_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zalpha_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,X=c(600,1500)) #' #' @export diff --git a/R/Zbeta.R b/R/Zbeta.R index 8b9a5f0e5165ab225578dcd4d0653a1f8fdfd329..b4baf3cbd18cb782cca9adf5b7bc598aa66a17ca 100644 --- a/R/Zbeta.R +++ b/R/Zbeta.R @@ -22,9 +22,9 @@ #' ## load the snps example dataset #' data(snps) #' ## run Zbeta over all the SNPs with a window size of 3000 bp -#' Zbeta(snps$positions,3000,as.matrix(snps[,3:12])) +#' Zbeta(snps$bp_positions,3000,as.matrix(snps[,3:12])) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zbeta(snps$positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) +#' Zbeta(snps$bp_positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) #' #' @export diff --git a/R/Zbeta_BetaCDF.R b/R/Zbeta_BetaCDF.R index 1908284c47a172c02adfe7298d7233f3e6e5331e..3be71e6f0b5507b3b12fbf797b29168b96fd44a5 100644 --- a/R/Zbeta_BetaCDF.R +++ b/R/Zbeta_BetaCDF.R @@ -36,10 +36,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zbeta_BetaCDF over all the SNPs with a window size of 3000 bp -#' Zbeta_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zbeta_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b,X=c(600,1500)) #' #' @export diff --git a/R/Zbeta_Zscore.R b/R/Zbeta_Zscore.R index 76eda7dbbd17bf64b87ee25c9bde51fcb0370adc..9c4031cdbd9e0dc09e8f6dfa7cd4cd9c0b02f0c4 100644 --- a/R/Zbeta_Zscore.R +++ b/R/Zbeta_Zscore.R @@ -35,10 +35,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zbeta_Zscore over all the SNPs with a window size of 3000 bp -#' Zbeta_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,LDprofile$sd) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zbeta_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,LDprofile$sd,X=c(600,1500)) #' #' @export diff --git a/R/Zbeta_expected.R b/R/Zbeta_expected.R index 626c4e8cf23500372789f325eb151488e035d2d1..05bde7062b522501388a95a395baceaac367a6ec 100644 --- a/R/Zbeta_expected.R +++ b/R/Zbeta_expected.R @@ -31,9 +31,9 @@ #' data(snps) #' data(LDprofile) #' ## run Zbeta_expected over all the SNPs with a window size of 3000 bp -#' Zbeta_expected(snps$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq) +#' 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$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) +#' Zbeta_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) #' #' @export #' diff --git a/R/Zbeta_log_rsq_over_expected.R b/R/Zbeta_log_rsq_over_expected.R index 7e8bbecc14f7474e1789a9227a0febb8a638817c..4293b5c03253a3c27ed25d9be4399377f99765fb 100644 --- a/R/Zbeta_log_rsq_over_expected.R +++ b/R/Zbeta_log_rsq_over_expected.R @@ -34,10 +34,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zbeta_log_rsq_over_expected over all the SNPs with a window size of 3000 bp -#' Zbeta_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zbeta_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,X=c(600,1500)) #' #' @export diff --git a/R/Zbeta_rsq_over_expected.R b/R/Zbeta_rsq_over_expected.R index af0262d10d995dd330f822d5c085acb3c60f8543..b779188834229795f2528f34ac9bb2c0b8e368be 100644 --- a/R/Zbeta_rsq_over_expected.R +++ b/R/Zbeta_rsq_over_expected.R @@ -34,10 +34,10 @@ #' data(snps) #' data(LDprofile) #' ## run Zbeta_rsq_over_expected over all the SNPs with a window size of 3000 bp -#' Zbeta_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zbeta_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +#' Zbeta_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, #' LDprofile$bin,LDprofile$rsq,X=c(600,1500)) #' #' @export diff --git a/R/create_LDprofile.R b/R/create_LDprofile.R index 79f32a8a9f10cd535204dcbe2619f362995287d5..b599bfa576cd0b985d226839e9fa40706f1bf2d8 100644 --- a/R/create_LDprofile.R +++ b/R/create_LDprofile.R @@ -24,10 +24,10 @@ #' ## load the snps example dataset #' data(snps) #' ## Create an LD profile using this data -#' create_LDprofile(snps$distances,as.matrix(snps[,3:12]),0.001) +#' create_LDprofile(snps$cM_distances,as.matrix(snps[,3:12]),0.001) #' ## To get the Beta distribution parameter estimates, the fitdistrplus package is required #' if (requireNamespace("fitdistrplus", quietly = TRUE)==TRUE) { -#' create_LDprofile(snps$distances,as.matrix(snps[,3:12]),0.001,beta_params=TRUE) +#' create_LDprofile(snps$cM_distances,as.matrix(snps[,3:12]),0.001,beta_params=TRUE) #' } #' #' diff --git a/R/zalpha.R b/R/zalpha.R index c9c1fdeeef6df916ada20d90b367b3599177a280..33842162a52fdf41f60a2503073abab79a694e5b 100644 --- a/R/zalpha.R +++ b/R/zalpha.R @@ -22,9 +22,9 @@ #' ## load the snps example dataset #' data(snps) #' ## run Zalpha over all the SNPs with a window size of 3000 bp -#' Zalpha(snps$positions,3000,as.matrix(snps[,3:12])) +#' Zalpha(snps$bp_positions,3000,as.matrix(snps[,3:12])) #' ## only return results for SNPs between locations 600 and 1500 bp -#' Zalpha(snps$positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) +#' Zalpha(snps$bp_positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) #' #' @export diff --git a/man/LDprofile.Rd b/man/LDprofile.Rd index a0ee7da5dc0733bd89c3664b70f01f9c05d1df10..32c4719d3d0f6fe7f3392a31b82867e293d2d275 100644 --- a/man/LDprofile.Rd +++ b/man/LDprofile.Rd @@ -4,14 +4,16 @@ \name{LDprofile} \alias{LDprofile} \title{Dataset containing an example LD profile} -\format{A data frame with 50 rows and 5 variables: +\format{ +A data frame with 50 rows and 5 variables: \describe{ \item{bin}{the lower bound of each bin} \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} -}} +} +} \usage{ data(LDprofile) } diff --git a/man/LR.Rd b/man/LR.Rd index fd9d114eee1148d6bc8b4193cfd80b7dbfd632a7..3f48961e0903623f6de55f632880dc85ccb99d7b 100644 --- a/man/LR.Rd +++ b/man/LR.Rd @@ -24,9 +24,9 @@ For more information about the \code{|L||R|} diversity statistic, please see Jac ## load the snps example dataset data(snps) ## run LR over all the SNPs with a window size of 3000 bp -LR(snps$positions,3000) +LR(snps$bp_positions,3000) ## only return results for SNPs between locations 600 and 1500 bp -LR(snps$positions,3000,X=c(600,1500)) +LR(snps$bp_positions,3000,X=c(600,1500)) } \references{ diff --git a/man/L_plus_R.Rd b/man/L_plus_R.Rd index ae4df6665b9ae91b8d1583002c13be0fa461fbb1..0043c3b95e50222352f2fcf8c60faaa6a7987026 100644 --- a/man/L_plus_R.Rd +++ b/man/L_plus_R.Rd @@ -24,9 +24,9 @@ For more information about the \code{L_plus_R} diversity statistic, please see J ## load the snps example dataset data(snps) ## run L_plus_R over all the SNPs with a window size of 3000 bp -L_plus_R(snps$positions,3000) +L_plus_R(snps$bp_positions,3000) ## only return results for SNPs between locations 600 and 1500 bp -L_plus_R(snps$positions,3000,X=c(600,1500)) +L_plus_R(snps$bp_positions,3000,X=c(600,1500)) } \references{ diff --git a/man/Zalpha_BetaCDF.Rd b/man/Zalpha_BetaCDF.Rd index b44dbb6754dd1a37eca06611e20b7cbbf94db171..4547af62f2d0cc5f5296d949e23598e2753de91a 100644 --- a/man/Zalpha_BetaCDF.Rd +++ b/man/Zalpha_BetaCDF.Rd @@ -62,10 +62,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zalpha_BetaCDF over all the SNPs with a window size of 3000 bp -Zalpha_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b) ## only return results for SNPs between locations 600 and 1500 bp -Zalpha_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b,X=c(600,1500)) } diff --git a/man/Zalpha_Zscore.Rd b/man/Zalpha_Zscore.Rd index 23e46bd08a3225e184761c63cd060677c4021ac2..ec27b088c7a55ec450e4b63cd8f56131da028951 100644 --- a/man/Zalpha_Zscore.Rd +++ b/man/Zalpha_Zscore.Rd @@ -61,10 +61,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zalpha_Zscore over all the SNPs with a window size of 3000 bp -Zalpha_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,LDprofile$sd) ## only return results for SNPs between locations 600 and 1500 bp -Zalpha_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,LDprofile$sd,X=c(600,1500)) } diff --git a/man/Zalpha_all.Rd b/man/Zalpha_all.Rd index ffd27671cc9ff231eb2db3646b71f0175565bc99..2a5718999cf29a694a4a3dc6d7a4fefb0e331be4 100644 --- a/man/Zalpha_all.Rd +++ b/man/Zalpha_all.Rd @@ -67,13 +67,13 @@ 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$positions,3000,as.matrix(snps[,3:12]),snps$distances, +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$positions,3000,as.matrix(snps[,3:12]),snps$distances, +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$positions,3000,as.matrix(snps[,3:12])) +Zalpha_all(snps$bp_positions,3000,as.matrix(snps[,3:12])) } \references{ diff --git a/man/Zalpha_expected.Rd b/man/Zalpha_expected.Rd index 0e4ba48cd6cdc7bea0a106b537a374d714b34d20..b2a8ca9519077253ce173d32a949fd1699c93c72 100644 --- a/man/Zalpha_expected.Rd +++ b/man/Zalpha_expected.Rd @@ -55,9 +55,9 @@ bound of the bin. data(snps) data(LDprofile) ## run Zalpha_expected over all the SNPs with a window size of 3000 bp -Zalpha_expected(snps$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq) +Zalpha_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq) ## only return results for SNPs between locations 600 and 1500 bp -Zalpha_expected(snps$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) +Zalpha_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) } \references{ diff --git a/man/Zalpha_log_rsq_over_expected.Rd b/man/Zalpha_log_rsq_over_expected.Rd index 8b996b3995442bcc5d9ee99fb50ccdc77794aee4..8ef0f96e549ae3c7848e98a7033b32330163decc 100644 --- a/man/Zalpha_log_rsq_over_expected.Rd +++ b/man/Zalpha_log_rsq_over_expected.Rd @@ -58,10 +58,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zalpha_log_rsq_over_expected over all the SNPs with a window size of 3000 bp -Zalpha_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq) ## only return results for SNPs between locations 600 and 1500 bp -Zalpha_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,X=c(600,1500)) } diff --git a/man/Zalpha_rsq_over_expected.Rd b/man/Zalpha_rsq_over_expected.Rd index 4aac68aace12132772cee9f000feded473e9868b..97ecd31aade70d93c9159835e23a8702d77918e7 100644 --- a/man/Zalpha_rsq_over_expected.Rd +++ b/man/Zalpha_rsq_over_expected.Rd @@ -58,10 +58,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zalpha_rsq_over_expected over all the SNPs with a window size of 3000 bp -Zalpha_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq) ## only return results for SNPs between locations 600 and 1500 bp -Zalpha_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zalpha_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,X=c(600,1500)) } diff --git a/man/Zbeta.Rd b/man/Zbeta.Rd index 124953c53892607f8b0220f33f87517b7b5d8f8a..4302fb91a4244f2d2f90f6e642ab5b9dbc848ece 100644 --- a/man/Zbeta.Rd +++ b/man/Zbeta.Rd @@ -33,9 +33,9 @@ where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of ## load the snps example dataset data(snps) ## run Zbeta over all the SNPs with a window size of 3000 bp -Zbeta(snps$positions,3000,as.matrix(snps[,3:12])) +Zbeta(snps$bp_positions,3000,as.matrix(snps[,3:12])) ## only return results for SNPs between locations 600 and 1500 bp -Zbeta(snps$positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) +Zbeta(snps$bp_positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) } \references{ diff --git a/man/Zbeta_BetaCDF.Rd b/man/Zbeta_BetaCDF.Rd index 91445adfdbd3446c00cbddc328e034f3b88c38ef..c0fc55f565723d243fa5ed087cd274567ea33863 100644 --- a/man/Zbeta_BetaCDF.Rd +++ b/man/Zbeta_BetaCDF.Rd @@ -62,10 +62,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zbeta_BetaCDF over all the SNPs with a window size of 3000 bp -Zbeta_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b) ## only return results for SNPs between locations 600 and 1500 bp -Zbeta_BetaCDF(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_BetaCDF(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$Beta_a,LDprofile$Beta_b,X=c(600,1500)) } diff --git a/man/Zbeta_Zscore.Rd b/man/Zbeta_Zscore.Rd index aade25254eecee66ed7eefb2e6cfce05b32f2313..91bc7a56c9c44371782f5f4a7c3646324e88a58f 100644 --- a/man/Zbeta_Zscore.Rd +++ b/man/Zbeta_Zscore.Rd @@ -61,10 +61,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zbeta_Zscore over all the SNPs with a window size of 3000 bp -Zbeta_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,LDprofile$sd) ## only return results for SNPs between locations 600 and 1500 bp -Zbeta_Zscore(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_Zscore(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,LDprofile$sd,X=c(600,1500)) } diff --git a/man/Zbeta_expected.Rd b/man/Zbeta_expected.Rd index eec160c70ff2fc1fb4cf88906115c53d797ca0f7..7cdfd590addf0864361b6c1b5843356e5ced8529 100644 --- a/man/Zbeta_expected.Rd +++ b/man/Zbeta_expected.Rd @@ -55,9 +55,9 @@ bound of the bin. data(snps) data(LDprofile) ## run Zbeta_expected over all the SNPs with a window size of 3000 bp -Zbeta_expected(snps$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq) +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$positions,3000,snps$distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) +Zbeta_expected(snps$bp_positions,3000,snps$cM_distances,LDprofile$bin,LDprofile$rsq,X=c(600,1500)) } \references{ diff --git a/man/Zbeta_log_rsq_over_expected.Rd b/man/Zbeta_log_rsq_over_expected.Rd index 1716f1f93c7916a8702851ced7285d4bef080369..6513c73bc58e767ebad8cd9fd4ce2ce2480b067a 100644 --- a/man/Zbeta_log_rsq_over_expected.Rd +++ b/man/Zbeta_log_rsq_over_expected.Rd @@ -58,10 +58,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zbeta_log_rsq_over_expected over all the SNPs with a window size of 3000 bp -Zbeta_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq) ## only return results for SNPs between locations 600 and 1500 bp -Zbeta_log_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_log_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,X=c(600,1500)) } diff --git a/man/Zbeta_rsq_over_expected.Rd b/man/Zbeta_rsq_over_expected.Rd index 883c87318979e5c2d2a3cbd7b2614ed3c016f874..6fc3ef90e91d59c4fc94c743beba639b27ed3899 100644 --- a/man/Zbeta_rsq_over_expected.Rd +++ b/man/Zbeta_rsq_over_expected.Rd @@ -58,10 +58,10 @@ bound of the bin. data(snps) data(LDprofile) ## run Zbeta_rsq_over_expected over all the SNPs with a window size of 3000 bp -Zbeta_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq) ## only return results for SNPs between locations 600 and 1500 bp -Zbeta_rsq_over_expected(snps$positions,3000,as.matrix(snps[,3:12]),snps$distances, +Zbeta_rsq_over_expected(snps$bp_positions,3000,as.matrix(snps[,3:12]),snps$cM_distances, LDprofile$bin,LDprofile$rsq,X=c(600,1500)) } diff --git a/man/create_LDprofile.Rd b/man/create_LDprofile.Rd index c94925ebdfc390836c244453764deb9675417206..1ae2bedb2e6de54f9ed230ed5a32b41dec311bc9 100644 --- a/man/create_LDprofile.Rd +++ b/man/create_LDprofile.Rd @@ -7,7 +7,7 @@ create_LDprofile(dist, x, bin_size, max_dist = NULL, beta_params = FALSE) } \arguments{ -\item{dist}{A numeric vector, or a list of numeric vectors, containing genetic distances.} +\item{dist}{A numeric vector, or a list of numeric vectors, containing the genetic distance for each SNP.} \item{x}{A matrix of SNP values, or a list of matrices. Columns represent chromosomes; rows are SNP locations. Hence, the number of rows should equal the length of the \code{dist} vector. SNPs should all be biallelic.} @@ -25,20 +25,20 @@ An LD (linkage disequilibrium) profile is a look-up table containing the expecte } \details{ The input for \code{dist} and \code{x} can be lists. This is to allow multiple datasets to be used in the creation of the LD profile. For example, using all 22 autosomes from the human genome would involve 22 different distance vectors and SNP matrices. -Both lists should be the same length and should correspond exactly to eachother (i.e. the distances in each element of dist should go with the SNPs in the same element of x) +Both lists should be the same length and should correspond exactly to each other (i.e. the distances in each element of \code{dist} should go with the SNPs in the same element of x) In the output, bins represent lower bounds. The first bin contains pairs where the genetic distance is greater than or equal to 0 and less than \code{bin_size}. The final bin contains pairs where the genetic distance is greater than or equal to \code{max_dist}-\code{bin_size} and less than \code{max_dist}. -If the \code{max_dist} is not an increment of \code{bin_size}, it will be adjusted to the next highest increment.The maximum bin will be the bin that \code{max_dist} falls into. For example, if the \code{max_dist} is given as 4.5 and the \code{bin_size} is 1, the final bin will be 4.\cr -By default, Beta parameters are not calculated. To calcualte Beta parameters, needed for the \code{\link{Zalpha_BetaCDF}} and \code{\link{Zbeta_BetaCDF}} statistics, \code{beta_params} should be set to TRUE and the package \code{fitdistrplus} must be installed. +If the \code{max_dist} is not an increment of \code{bin_size}, it will be adjusted to the next highest increment. The maximum bin will be the bin that \code{max_dist} falls into. For example, if the \code{max_dist} is given as 4.5 and the \code{bin_size} is 1, the final bin will be 4.\cr +By default, Beta parameters are not calculated. To calculate Beta parameters, needed for the \code{\link{Zalpha_BetaCDF}} and \code{\link{Zbeta_BetaCDF}} statistics, \code{beta_params} should be set to TRUE and the package \code{fitdistrplus} must be installed. } \examples{ ## load the snps example dataset data(snps) ## Create an LD profile using this data -create_LDprofile(snps$distances,as.matrix(snps[,3:12]),0.001) +create_LDprofile(snps$cM_distances,as.matrix(snps[,3:12]),0.001) ## To get the Beta distribution parameter estimates, the fitdistrplus package is required if (requireNamespace("fitdistrplus", quietly = TRUE)==TRUE) { - create_LDprofile(snps$distances,as.matrix(snps[,3:12]),0.001,beta_params=TRUE) + create_LDprofile(snps$cM_distances,as.matrix(snps[,3:12]),0.001,beta_params=TRUE) } diff --git a/man/snps.Rd b/man/snps.Rd index 57bf3797d9460499e2ae7eb3af806891667a6564..dd04145aadbacf3e384a3806610015760a704f54 100644 --- a/man/snps.Rd +++ b/man/snps.Rd @@ -4,10 +4,11 @@ \name{snps} \alias{snps} \title{Dataset containing details on simulated SNPs} -\format{A data frame with 20 rows and 12 variables: +\format{ +A data frame with 20 rows and 12 variables: \describe{ - \item{positions}{location of the SNP on the chromosome} - \item{distances}{genetic distance of the SNP from the start of the chromosome} + \item{bp_positions}{location of the SNP on the chromosome e.g. in base pairs} + \item{cM_distances}{genetic distance of the SNP from the start of the chromosome e.g. in centimorgans} \item{chrom_1}{allele of the SNP on the first example chromosome} \item{chrom_2}{allele of the SNP on the second example chromosome} \item{chrom_3}{allele of the SNP on the third example chromosome} @@ -18,7 +19,8 @@ \item{chrom_8}{allele of the SNP on the eighth example chromosome} \item{chrom_9}{allele of the SNP on the ninth example chromosome} \item{chrom_10}{allele of the SNP on the tenth example chromosome} -}} +} +} \usage{ snps } diff --git a/man/zalpha.Rd b/man/zalpha.Rd index 392f58e374d7b083e0e98b9f9a75a394fb478b92..efeb817eeae44619cab230dba50f567367d4d6c6 100644 --- a/man/zalpha.Rd +++ b/man/zalpha.Rd @@ -33,9 +33,9 @@ where \code{|L|} and \code{|R|} are the number of SNPs to the left and right of ## load the snps example dataset data(snps) ## run Zalpha over all the SNPs with a window size of 3000 bp -Zalpha(snps$positions,3000,as.matrix(snps[,3:12])) +Zalpha(snps$bp_positions,3000,as.matrix(snps[,3:12])) ## only return results for SNPs between locations 600 and 1500 bp -Zalpha(snps$positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) +Zalpha(snps$bp_positions,3000,as.matrix(snps[,3:12]),X=c(600,1500)) } \references{