R/wrappers.R

Defines functions ld

Documented in ld

## wrappers for S3 functions in snpMatrix that don't obey inheritances
##' Wrapper to allow snpStats::ld to be called with aSnpMatrix objects.
##'
##' See \code{\link[snpStats]{ld}} for help on the function itself.
##'
##' @export
##' @param x object of class aSnpMatrix or aXSnpMatrix
##' @param y object of same class as x
##' @param ... other arguments passed to \code{snpStats::ld()}
ld <- function(x, y=NULL, ...) {
  if(is(x,"aSnpMatrix") || is(x,"aXSnpMatrix"))
    x <- sm(x)
  if(!is.null(y) && (is(y,"aSnpMatrix") || is(x,"aXSnpMatrix")))
    y <- sm(y)
  snpStats::ld(x=x, y=y, ...)
}
chr1swallace/annotSnpStats documentation built on April 18, 2023, 11:22 a.m.