diff --git a/DESCRIPTION b/DESCRIPTION index b4e03af..918f0f6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,21 +13,34 @@ Authors@R: c(person("Karim", "Oualkacha", email = "sharapovsodbo@gmail.com", role = "aut") ) Author: Karim Oualkacha [aut, cre], - M'Hamed Lajmi Lakhal-Chaieb [aut], - Celia M.T. Greenwood [aut], - Lennart C. Karssen [aut], - Sodbo Sharapov [aut] + M'Hamed Lajmi Lakhal-Chaieb [aut], + Celia M.T. Greenwood [aut], + Lennart C. Karssen [aut], + Sodbo Sharapov [aut] Maintainer: Karim Oualkacha Description: This is a collection of the five region-based - rare-variant genetic association tests. The following tests are - currently implemented: ASKAT, ASKAT-Normalized, VC-C1, VC-C2 and - VC-C3. -Depends: R (>= 3.2.2), foreach, doParallel -Imports: ks, CompQuadForm, Matrix, snpStats, kinship2 -Suggests: GenABEL, knitr, methods + rare-variant genetic association tests. The following tests are + currently implemented: ASKAT, ASKAT-Normalized, VC-C1, VC-C2 and + VC-C3. +Depends: + R (>= 3.2.2), + foreach, + doParallel +Imports: + ks, + CompQuadForm, + data.table, + Matrix, + snpStats, + kinship2 +Suggests: + GenABEL, + knitr, + methods License: GPL (>=3) Copyright: Celia M.T. Greenwood LazyData: true VignetteBuilder: knitr NeedsCompilation: no Packaged: 2015-12-04 01:53:06 UTC; karimoualkacha +RoxygenNote: 5.0.1 diff --git a/NAMESPACE b/NAMESPACE index fe8b6c0..95d8653 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,6 +17,7 @@ import(foreach) import(snpStats) importFrom(CompQuadForm,davies) importFrom(Matrix,nearPD) +importFrom(data.table,fread) importFrom(kinship2,kindepth) importFrom(ks,hns) importFrom(ks,kdde) diff --git a/R/ASKAT.region.R b/R/ASKAT.region.R index 97d84bb..bda8bd2 100644 --- a/R/ASKAT.region.R +++ b/R/ASKAT.region.R @@ -72,7 +72,7 @@ ASKAT.region <- function(y=NULL, startpos=startpos, endpos=endpos) - if (ncol(haplotypes) == 0) { + if (is.null(haplotypes) || ncol(haplotypes) == 0) { warning("No genotypes available in the region from ", startpos, " to ", endpos, " on chromosome ", chr) result.df <- data.frame(Score.Test=NA, @@ -101,7 +101,7 @@ ASKAT.region <- function(y=NULL, result.df <- data.frame(Score.Test=pval$score, P.value=pval$p.value, - N.Markers=ncol(haplotypes)) + N.Markers=ncol(G)) if (!is.null(regionname)) { rownames(result.df) <- regionname diff --git a/R/NormalizedASKAT.region.R b/R/NormalizedASKAT.region.R index 4ab9662..bec55cc 100644 --- a/R/NormalizedASKAT.region.R +++ b/R/NormalizedASKAT.region.R @@ -1,5 +1,7 @@ -##' Runs the normalized ASKAT method on a given genomic region. Rank-based normalization is applied -##' to the phenotype residauls under the null model, after adjusting for covariate effects +##' Runs the normalized ASKAT method on a given genomic region. +##' +##' Rank-based normalization is applied to the phenotype residuals +##' under the null model, after adjusting for covariate effects. ##' ##' @title Run the normalized ASKAT method on a genomic region defined ##' by a start and a stop base pair coordinate @@ -17,7 +19,8 @@ ##' \item \code{regionname}: Name of the region/gene on which you ##' are running the association test ##' } -##' @author Lennart C. Karssen, Sodbo Sharapov +##' @author Lennart C. Karssen +##' @author Sodbo Sharapov ##' @export NormalizedASKAT.region <- function(y=NULL, X=NULL, @@ -56,7 +59,7 @@ NormalizedASKAT.region <- function(y=NULL, startpos=startpos, endpos=endpos) - if (ncol(haplotypes) == 0) { + if (is.null(haplotypes) || ncol(haplotypes) == 0) { warning("No genotypes available in the region from ", startpos, " to ", endpos, " on chromosome ", chr) result.df <- data.frame(Score.Test=NA, @@ -85,7 +88,7 @@ NormalizedASKAT.region <- function(y=NULL, result.df <- data.frame(Score.Test=pval$score, P.value=pval$p.value, - N.Markers=ncol(haplotypes)) + N.Markers=ncol(G)) if (!is.null(regionname)) { rownames(result.df) <- regionname diff --git a/R/VCC1.region.R b/R/VCC1.region.R index c7deca4..9b0c1ad 100644 --- a/R/VCC1.region.R +++ b/R/VCC1.region.R @@ -16,7 +16,8 @@ ##' \item \code{regionname}: Name of the region/gene on which you ##' are running the association test ##' } -##' @author Sodbo Sharapov, Lennart C. Karssen +##' @author Sodbo Sharapov +##' @author Lennart C. Karssen ##' @export VCC1.region <- function(y=NULL, X=NULL, @@ -57,7 +58,7 @@ VCC1.region <- function(y=NULL, startpos=startpos, endpos=endpos) - if (ncol(haplotypes) == 0) { + if (is.null(haplotypes) || ncol(haplotypes) == 0) { warning("No genotypes available in the region from ", startpos, " to ", endpos, " on chromosome ", chr) result.df <- data.frame(Score.Test=NA, @@ -85,7 +86,7 @@ VCC1.region <- function(y=NULL, result.df <- data.frame(Score.Test=pval$score, P.value=pval$p.value, - N.Markers=ncol(haplotypes)) + N.Markers=ncol(G)) if (!is.null(regionname)) { rownames(result.df) <- regionname diff --git a/R/VCC2.region.R b/R/VCC2.region.R index 770e1fc..50bdaf3 100644 --- a/R/VCC2.region.R +++ b/R/VCC2.region.R @@ -1,7 +1,7 @@ ##' Runs the VC-C2 method on a given genomic region ##' ##' @title Run the VC-C2 method on a genomic region defined by a start -##' and a stop base pair coordinate +##' and a stop base pair coordinate ##' @inheritParams read.haplo ##' @inheritParams VCC1.region ##' @param Nperm Integer, number of permutations to use for empirical @@ -60,7 +60,7 @@ VCC2.region <- function(y=NULL, startpos=startpos, endpos=endpos) - if (ncol(haplotypes) == 0) { + if (is.null(haplotypes) || ncol(haplotypes) == 0) { warning("No genotypes available in the region from ", startpos, " to ", endpos, " on chromosome ", chr) result.df <- data.frame(Score.Test=NA, @@ -113,7 +113,7 @@ VCC2.region <- function(y=NULL, result.df <- data.frame(Score.Test=pval$score, P.value=pval$p.value, - N.Markers=ncol(haplotypes)) + N.Markers=ncol(G)) if (!is.null(regionname)) { rownames(result.df) <- regionname diff --git a/R/VCC3.region.R b/R/VCC3.region.R index 5937060..32256cb 100644 --- a/R/VCC3.region.R +++ b/R/VCC3.region.R @@ -1,7 +1,7 @@ ##' Runs the VC-C3 method on a given genomic region ##' ##' @title Run the VC-C3 method on a genomic region defined by a start -##' and a stop base pair coordinate +##' and a stop base pair coordinate ##' @inheritParams VCC2.region ##' @return A data frame containing the results of the association ##' test. The data frame contains the following columns: @@ -53,7 +53,7 @@ VCC3.region <- function(y=NULL, startpos=startpos, endpos=endpos) - if (ncol(haplotypes) == 0) { + if (is.null(haplotypes) || ncol(haplotypes) == 0) { warning("No genotypes available in the region from ", startpos, " to ", endpos, " on chromosome ", chr) result.df <- data.frame(Score.Test=NA, @@ -106,7 +106,7 @@ VCC3.region <- function(y=NULL, result.df <- data.frame(Score.Test=pval$score, P.value=pval$p.value.VCC3, - N.Markers=ncol(haplotypes)) + N.Markers=ncol(G)) if (!is.null(regionname)) { rownames(result.df) <- regionname diff --git a/R/ff.hap.R b/R/ff.hap.R new file mode 100644 index 0000000..e384b01 --- /dev/null +++ b/R/ff.hap.R @@ -0,0 +1,8 @@ +ff.hap <- function(k){ + if (k==1) { + x <- 6 + c(1, 2) + } else { + x <- 6 + c((2*k - 1), (2*k)) + } + return(x) +} diff --git a/R/lettersTo12.R b/R/lettersTo12.R new file mode 100644 index 0000000..4df3acf --- /dev/null +++ b/R/lettersTo12.R @@ -0,0 +1,24 @@ +lettersTo12 <- function(x){ + x1 <- c(x[, 1], x[, 2]) + Letters.SNP <- unique(x1) + + if (length(Letters.SNP) == 1) { + x[, 1] <- x[, 2] <- 2 + } + + if (length(Letters.SNP) > 1) { + if ( ( length(which(x1 == Letters.SNP[1])) / length(x1) ) > 0.5 ) { + x[which(x[, 1] == Letters.SNP[1]), 1] <- 2 + x[which(x[, 2] == Letters.SNP[1]), 2] <- 2 + x[which(x[, 1] == Letters.SNP[2]), 1] <- 1 + x[which(x[, 2] == Letters.SNP[2]), 2] <- 1 + } else { + x[which(x[, 1] == Letters.SNP[2]), 1] <- 2 + x[which(x[, 2] == Letters.SNP[2]), 2] <- 2 + x[which(x[, 1] == Letters.SNP[1]), 1] <- 1 + x[which(x[, 2] == Letters.SNP[1]), 2] <- 1 + } + } + + return(x) +} diff --git a/R/pvalue.ASKAT.R b/R/pvalue.ASKAT.R index fda2377..5863d5a 100644 --- a/R/pvalue.ASKAT.R +++ b/R/pvalue.ASKAT.R @@ -1,8 +1,8 @@ ##' Compute p-value and score for the ASKAT method ##' ##' @param RH0 a vector of length 2 which the results (output) of the -##' \code{\link{Estim.H0.ASKAT}} function (i.e. variance components -##' estimates under the null model) +##' \code{\link{Estim.H0.ASKAT}} function (i.e. variance +##' components estimates under the null model) ##' @inheritParams RVPedigree ##' @param G matrix of genotypes ##' @return A list with score and p-value for the ASKAT test on the diff --git a/R/read.haplo.R b/R/read.haplo.R index 059aba1..b3d71c6 100644 --- a/R/read.haplo.R +++ b/R/read.haplo.R @@ -2,24 +2,26 @@ #' files or ShapeIt output files #' #' @param type character, \code{'ped'}, \code{'bed'} (default) or -#' \code{'shapeit-haps'} format of input file containing haplotype -#' data -#' @param filename character, path to input file containing haplotype data +#' \code{'shapeit-haps'} format of input file containing haplotype +#' data +#' @param filename character, path to input file containing haplotype +#' data #' @param map object, data.frame contains 3 columns: rsID, chromosome, -#' position in bp as output by e.g. \code{\link{readMapFile}}. -#' @param chr character, chromosome number (basically from 1 to 22 as used by -#' \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), -#' on which the region of interest is located +#' position in bp as output by e.g. \code{\link{readMapFile}}. +#' @param chr character, chromosome number (basically from 1 to 22 as +#' used by +#' \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), +#' on which the region of interest is located #' @param startpos numeric, start position (in bp, base pairs) of the #' region of interest (default: 0) #' @param endpos numeric, end position (in bp, base pairs) of the #' region of interest (default: 0) #' @return matrix object containing the haplotypes selected by the -#' region of interest +#' region of interest #' @seealso \code{\link{read.haplo.pedfile}}, -#' \code{\link{read.haplo.bedfile}}, -#' \code{\link{read.haplo.shapeit_haps}}, -#' \code{\link{readMapFile}} +#' \code{\link{read.haplo.bedfile}}, +#' \code{\link{read.haplo.shapeit_haps}}, +#' \code{\link{readMapFile}} #' @keywords internal read.haplo <- function(type="bed", filename, diff --git a/R/read.haplo.bedfile.R b/R/read.haplo.bedfile.R index a2ed7e2..27e5ee6 100644 --- a/R/read.haplo.bedfile.R +++ b/R/read.haplo.bedfile.R @@ -2,15 +2,17 @@ #' (regular PLINK binary files) #' #' @param filename character, path to BED file containing haplotype -#' data. Attention! filename should contain path to \code{.bed} -#' with full file name. For example \code{../mydata/inputplink.bed}. +#' data. Attention! filename should contain path to +#' \code{.bed} with full file name. For example +#' \code{../mydata/inputplink.bed}. #' @inheritParams read.haplo #' @return matrix object containing the haplotypes selected by the -#' region of interest +#' region of interest, or \code{NULL} if there are no variants in +#' the region #' @seealso \code{\link{read.haplo}}, -#' \code{\link{read.haplo.pedfile}}, -#' \code{\link{read.haplo.shapeit_haps}}, -#' \code{\link{readMapFile}} +#' \code{\link{read.haplo.pedfile}}, +#' \code{\link{read.haplo.shapeit_haps}}, +#' \code{\link{readMapFile}} #' @import snpStats #' @keywords internal read.haplo.bedfile <- function(filename = "NULL", @@ -24,6 +26,13 @@ read.haplo.bedfile <- function(filename = "NULL", map[, 3] < endpos), 2] + if ( length(snps2out) < 1 ) { + warning("No genotypes available in the region from ", + startpos, " to ", endpos, " on chromosome ", + chr, " (filename ", filename, ")") + return(NULL) + } + basefile <- sub(".bed$", "", filename) plink.input <- snpStats::read.plink(bed = paste0(basefile, ".bed"), bim = paste0(basefile, ".bim"), diff --git a/R/read.haplo.pedfile.R b/R/read.haplo.pedfile.R index a1ee2f4..8604031 100644 --- a/R/read.haplo.pedfile.R +++ b/R/read.haplo.pedfile.R @@ -2,36 +2,65 @@ #' (regular PLINK untransposed text files) #' #' @param filename character, path to PED file containing haplotype -#' data. Attention! filename should contain path to \code{.ped} -#' with full file name. For example \code{../mydata/inputplink.ped} +#' data. Attention! filename should contain path to +#' \code{.ped} with full file name. For example +#' \code{../mydata/inputplink.ped} +#' @param recode character, designates if data are in 1/2 format or in +#' letters (A, C, G, T) format. The defaut is 1/2 where 1 +#' designating the minor allele #' @inheritParams read.haplo #' @return matrix object containing the haplotypes selected by the -#' region of interest +#' region of interest, or \code{NULL} if there are no variants in +#' the region #' @seealso \code{\link{read.haplo}}, -#' \code{\link{read.haplo.bedfile}}, -#' \code{\link{read.haplo.shapeit_haps}}, -#' \code{\link{readMapFile}} -#' @import snpStats +#' \code{\link{read.haplo.bedfile}}, +#' \code{\link{read.haplo.shapeit_haps}}, +#' \code{\link{readMapFile}} +#' @author Lennart C. Karssen +#' @author Sodbo Sharapov +#' @author Karim Oualkacha +#' @importFrom data.table fread #' @keywords internal read.haplo.pedfile <- function(filename = "NULL", map, chr = "NULL", startpos = "NULL", - endpos = "NULL"){ - # TODO: probably we want to automatically append ".ped" to filename - # TODO: add extensions - snps2out <- map[which(map[, 1] == chr & - map[, 3] > startpos & - map[, 3] < endpos), - 2] + endpos = "NULL", + recode = "recodeLetters"){ - plink.input <- snpStats::read.pedfile(file = filename, - snps = snps2out) + snps2out <- as.numeric(rownames(map)[which(map[, 1] == chr & + map[, 3] > startpos & + map[, 3] < endpos)]) - GenotypeMatrix <- methods::as(plink.input$genotypes, "numeric") - # TODO: added 'rownames(GenotypeMatrix) <- idNames' may required - return(GenotypeMatrix) -} + if ( length(snps2out) < 1 ) { + warning("No genotypes available in the region from ", + startpos, " to ", endpos, " on chromosome ", + chr, " (filename ", filename, ")") + return(NULL) + } + + cols2out = as.vector(sapply(snps2out, ff.hap)) -# tmp = read.haplo.pedfile(filename = "data.ped",map = tmp1,chr = 1, -# startpos = 9000, endpos = 25000) + switch(recode, + recode12={ + haplotypes = as.data.frame(fread(filename, + select = cols2out, + colClasses = 'character')) + }, + recodeLetters={ + haplotypes = as.data.frame(fread(filename, + select = cols2out, + colClasses = 'character')) + list.haplo = lapply(seq_len(ncol(haplotypes)/2), function(i){ + haplotypes[, c(((2*i) - 1):(2*i))] + } + ) + haplotypes = lapply(list.haplo, lettersTo12) + haplotypes = matrix(as.numeric(unlist(haplotypes)), + nrow = dim(haplotypes[[1]])[1], + byrow = FALSE) + } + ) + + return(haplotypes) +} diff --git a/man/ASKAT.region.Rd b/man/ASKAT.region.Rd index ad5abe3..404df69 100644 --- a/man/ASKAT.region.Rd +++ b/man/ASKAT.region.Rd @@ -24,12 +24,14 @@ length \eqn{n}.} \code{'shapeit-haps'} format of input file containing haplotype data} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} diff --git a/man/NormalizedASKAT.region.Rd b/man/NormalizedASKAT.region.Rd index 07a267e..b1c92d5 100644 --- a/man/NormalizedASKAT.region.Rd +++ b/man/NormalizedASKAT.region.Rd @@ -24,12 +24,14 @@ length \eqn{n}.} \code{'shapeit-haps'} format of input file containing haplotype data} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} @@ -86,10 +88,15 @@ A data frame containing the results of the association } } \description{ -Runs the normalized ASKAT method on a given genomic region. Rank-based normalization is applied -to the phenotype residauls under the null model, after adjusting for covariate effects +Runs the normalized ASKAT method on a given genomic region. +} +\details{ +Rank-based normalization is applied to the phenotype residuals +under the null model, after adjusting for covariate effects. } \author{ -Lennart C. Karssen, Sodbo Sharapov +Lennart C. Karssen + +Sodbo Sharapov } diff --git a/man/RVPedigree.Rd b/man/RVPedigree.Rd index f4090a0..b8ec4a9 100644 --- a/man/RVPedigree.Rd +++ b/man/RVPedigree.Rd @@ -28,7 +28,8 @@ length \eqn{n}.} \item{Phi}{Relationship matrix (i.e. twice the kinship matrix); an \eqn{n \times n} square symmetric positive-definite matrix.} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{type}{character, \code{'ped'}, \code{'bed'} (default) or \code{'shapeit-haps'} format of input file containing haplotype diff --git a/man/VCC1.region.Rd b/man/VCC1.region.Rd index 3f515cc..1954b2e 100644 --- a/man/VCC1.region.Rd +++ b/man/VCC1.region.Rd @@ -24,12 +24,14 @@ length \eqn{n}.} \code{'shapeit-haps'} format of input file containing haplotype data} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} @@ -89,6 +91,8 @@ A data frame containing the results of the association Runs the VC-C1 method on a given genomic region } \author{ -Sodbo Sharapov, Lennart C. Karssen +Sodbo Sharapov + +Lennart C. Karssen } diff --git a/man/VCC2.region.Rd b/man/VCC2.region.Rd index d6ce487..0a763ef 100644 --- a/man/VCC2.region.Rd +++ b/man/VCC2.region.Rd @@ -3,7 +3,7 @@ \name{VCC2.region} \alias{VCC2.region} \title{Run the VC-C2 method on a genomic region defined by a start -and a stop base pair coordinate} + and a stop base pair coordinate} \usage{ VCC2.region(y = NULL, X = NULL, Phi = NULL, type = "bed", filename = NULL, map = NULL, chr = 0, startpos = 0, endpos = 0, @@ -24,12 +24,14 @@ length \eqn{n}.} \code{'shapeit-haps'} format of input file containing haplotype data} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} diff --git a/man/VCC3.region.Rd b/man/VCC3.region.Rd index 1750d9b..09b00cf 100644 --- a/man/VCC3.region.Rd +++ b/man/VCC3.region.Rd @@ -3,7 +3,7 @@ \name{VCC3.region} \alias{VCC3.region} \title{Run the VC-C3 method on a genomic region defined by a start -and a stop base pair coordinate} + and a stop base pair coordinate} \usage{ VCC3.region(y = NULL, X = NULL, Phi = NULL, type = "bed", filename = NULL, map = NULL, chr = 0, startpos = 0, endpos = 0, @@ -24,12 +24,14 @@ length \eqn{n}.} \code{'shapeit-haps'} format of input file containing haplotype data} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} diff --git a/man/pvalue.ASKAT.Rd b/man/pvalue.ASKAT.Rd index b59a7a1..b6e19c8 100644 --- a/man/pvalue.ASKAT.Rd +++ b/man/pvalue.ASKAT.Rd @@ -8,8 +8,8 @@ pvalue.ASKAT(RH0, y, X, Phi, W, G) } \arguments{ \item{RH0}{a vector of length 2 which the results (output) of the -\code{\link{Estim.H0.ASKAT}} function (i.e. variance components -estimates under the null model)} +\code{\link{Estim.H0.ASKAT}} function (i.e. variance +components estimates under the null model)} \item{y}{vector of phenotype data (one entry per individual), of length \eqn{n}.} diff --git a/man/pvalue.NormalizedASKAT.Rd b/man/pvalue.NormalizedASKAT.Rd index 90158b4..34f8f40 100644 --- a/man/pvalue.NormalizedASKAT.Rd +++ b/man/pvalue.NormalizedASKAT.Rd @@ -8,8 +8,8 @@ pvalue.NormalizedASKAT(RH0, y, X, Phi, W, G) } \arguments{ \item{RH0}{a vector of length 2 which the results (output) of the -\code{\link{Estim.H0.ASKAT}} function (i.e. variance components -estimates under the null model)} +\code{\link{Estim.H0.ASKAT}} function (i.e. variance +components estimates under the null model)} \item{y}{vector of phenotype data (one entry per individual), of length \eqn{n}.} diff --git a/man/read.haplo.Rd b/man/read.haplo.Rd index 83a0047..6f696c9 100644 --- a/man/read.haplo.Rd +++ b/man/read.haplo.Rd @@ -13,12 +13,14 @@ read.haplo(type = "bed", filename, map, chr = 0, startpos = 0, \code{'shapeit-haps'} format of input file containing haplotype data} -\item{filename}{character, path to input file containing haplotype data} +\item{filename}{character, path to input file containing haplotype +data} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} @@ -30,7 +32,7 @@ region of interest (default: 0)} } \value{ matrix object containing the haplotypes selected by the -region of interest + region of interest } \description{ Read haplotype data, selected by region of interest, from PLINK formatted @@ -38,9 +40,9 @@ files or ShapeIt output files } \seealso{ \code{\link{read.haplo.pedfile}}, -\code{\link{read.haplo.bedfile}}, -\code{\link{read.haplo.shapeit_haps}}, -\code{\link{readMapFile}} + \code{\link{read.haplo.bedfile}}, + \code{\link{read.haplo.shapeit_haps}}, + \code{\link{readMapFile}} } \keyword{internal} diff --git a/man/read.haplo.bedfile.Rd b/man/read.haplo.bedfile.Rd index 130ad8c..4765a2a 100644 --- a/man/read.haplo.bedfile.Rd +++ b/man/read.haplo.bedfile.Rd @@ -10,13 +10,15 @@ read.haplo.bedfile(filename = "NULL", map, chr = "NULL", } \arguments{ \item{filename}{character, path to BED file containing haplotype -data. Attention! filename should contain path to \code{.bed} -with full file name. For example \code{../mydata/inputplink.bed}.} +data. Attention! filename should contain path to +\code{.bed} with full file name. For example +\code{../mydata/inputplink.bed}.} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} @@ -28,7 +30,8 @@ region of interest (default: 0)} } \value{ matrix object containing the haplotypes selected by the -region of interest + region of interest, or \code{NULL} if there are no variants in + the region } \description{ Read haplotype data, selected by region of interest, from BED files @@ -36,9 +39,9 @@ Read haplotype data, selected by region of interest, from BED files } \seealso{ \code{\link{read.haplo}}, -\code{\link{read.haplo.pedfile}}, -\code{\link{read.haplo.shapeit_haps}}, -\code{\link{readMapFile}} + \code{\link{read.haplo.pedfile}}, + \code{\link{read.haplo.shapeit_haps}}, + \code{\link{readMapFile}} } \keyword{internal} diff --git a/man/read.haplo.pedfile.Rd b/man/read.haplo.pedfile.Rd index 4de2aca..e2c8aaa 100644 --- a/man/read.haplo.pedfile.Rd +++ b/man/read.haplo.pedfile.Rd @@ -6,17 +6,19 @@ (regular PLINK untransposed text files)} \usage{ read.haplo.pedfile(filename = "NULL", map, chr = "NULL", - startpos = "NULL", endpos = "NULL") + startpos = "NULL", endpos = "NULL", recode = "recodeLetters") } \arguments{ \item{filename}{character, path to PED file containing haplotype -data. Attention! filename should contain path to \code{.ped} -with full file name. For example \code{../mydata/inputplink.ped}} +data. Attention! filename should contain path to +\code{.ped} with full file name. For example +\code{../mydata/inputplink.ped}} \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located} @@ -25,20 +27,32 @@ region of interest (default: 0)} \item{endpos}{numeric, end position (in bp, base pairs) of the region of interest (default: 0)} + +\item{recode}{character, designates if data are in 1/2 format or in +letters (A, C, G, T) format. The defaut is 1/2 where 1 +designating the minor allele} } \value{ matrix object containing the haplotypes selected by the -region of interest + region of interest, or \code{NULL} if there are no variants in + the region } \description{ Read haplotype data, selected by region of interest, from PED files (regular PLINK untransposed text files) } +\author{ +Lennart C. Karssen + +Sodbo Sharapov + +Karim Oualkacha +} \seealso{ \code{\link{read.haplo}}, -\code{\link{read.haplo.bedfile}}, -\code{\link{read.haplo.shapeit_haps}}, -\code{\link{readMapFile}} + \code{\link{read.haplo.bedfile}}, + \code{\link{read.haplo.shapeit_haps}}, + \code{\link{readMapFile}} } \keyword{internal} diff --git a/man/read.haplo.shapeit_haps.Rd b/man/read.haplo.shapeit_haps.Rd index 09e8544..2a2833c 100644 --- a/man/read.haplo.shapeit_haps.Rd +++ b/man/read.haplo.shapeit_haps.Rd @@ -15,7 +15,8 @@ haplotype data which is regular ShapeIt output. See \item{map}{object, data.frame contains 3 columns: rsID, chromosome, position in bp as output by e.g. \code{\link{readMapFile}}.} -\item{chr}{character, chromosome number (basically from 1 to 22 as used by +\item{chr}{character, chromosome number (basically from 1 to 22 as +used by \href{http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped}{Plink}), on which the region of interest is located}