R/sum_fst.r

Defines functions Sum.Fst1.higher.perms Sum.Fst1 Sum.Fst.higher.perms Sum.Fst

Sum.Fst <- function(x, group = x@ped$pheno, genomic.region = x@snps$genomic.region, 
                   which.snps = rep(TRUE, ncol(x)), target = 10, B.max = 1e6) {
  r <- .Call('oz_sum_fst', PACKAGE = "Ravages", x@bed, which.snps, as.factor(genomic.region), as.factor(group), target, B.max) 
  res <- data.frame( genomic.region = levels(genomic.region), r )
  return(res)
}

Sum.Fst.higher.perms <-  function(x, group = x@ped$pheno, genomic.region = x@snps$genomic.region,
                   which.snps = rep(TRUE, ncol(x)), n.keep = 500, B = 1e6) {
  r <- .Call('oz_sum_fst_max_perm', PACKAGE = "Ravages", x@bed, which.snps, as.factor(genomic.region), as.factor(group), n.keep, B)
  names(r) <- levels(genomic.region)
  r[ sapply(r, length) > 0 ] 
}

# pour comparer tps d'exec
Sum.Fst1 <- function(x, group = x@ped$pheno, genomic.region = x@snps$genomic.region, 
                   which.snps = rep(TRUE, ncol(x)), target = 10, B.max = 1e6) {
  r <- .Call('oz_sum_fst1', PACKAGE = "Ravages", x@bed, which.snps, as.factor(genomic.region), as.factor(group), target, B.max) 
  res <- data.frame( genomic.region = levels(genomic.region), r )
  return(res)
}

Sum.Fst1.higher.perms <-  function(x, group = x@ped$pheno, genomic.region = x@snps$genomic.region,
                   which.snps = rep(TRUE, ncol(x)), n.keep = 500, B = 1e6) {
  r <- .Call('oz_sum_fst1_max_perm', PACKAGE = "Ravages", x@bed, which.snps, as.factor(genomic.region), as.factor(group), n.keep, B)
  names(r) <- levels(genomic.region)
  r[ sapply(r, length) > 0 ] 
}

Try the Ravages package in your browser

Any scripts or data that you put into this service are public.

Ravages documentation built on Oct. 19, 2021, 5:07 p.m.