tests/testthat/test_fsteachsnphudson.R

context("Fst Hudson all SNPs")

test_that("calculate Fst Hudson for all SNPs",{

  data(example_SNP)

  idx1 <- which(sample_labels == 'pop1')
  idx2 <- which(sample_labels == 'pop2')
  fst.pairwise <- fst.each.snp.hudson(simsnp$snp, idx1, idx2)

  expect_equal(fst.pairwise[1], 0.007396462)
  expect_equal(fst.pairwise[2], 0.09957484)
  expect_length(fst.pairwise, 2000)
})

Try the KRIS package in your browser

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

KRIS documentation built on Jan. 21, 2021, 5:08 p.m.