vstPermutation: Run permutation on Vst

View source: R/post_detect.R

vstPermutationR Documentation

Run permutation on Vst

Description

This function runs a permutation test on Vst calculation

Usage

vstPermutation(
  AD,
  pops,
  nperm = 100,
  histogram = TRUE,
  stat = 2,
  qGraph = TRUE
)

Arguments

AD

data frame of total allele depth values of SNPs

pops

character. A vector of population names for each individual. Must be the same length as the number of samples in AD

nperm

numeric. Number of permutations to perform

histogram

logical. plots the distribution histogram of permuted vst values vs. observed values

stat

numeric. The stat to be plotted in histogram. 1 for Mean Absolute Distance or 2 (default) for Root Mean Square Distance

qGraph

logical. Plot the network plot based on observed Vst values (see vst() help page for more details)

Value

Returns a list with observed vst values, an array of permuted vst values and the p-values for the permutation test

Author(s)

Jorge Cortés-Miranda (email:jorge.cortes.m@ug.uchile.cl), Piyal Karunarathne

Examples

## Not run: data(alleleINF)
data(ADtable)
DD<-dupGet(alleleINF)
ds<-DD[DD$dup.stat=="deviant",]
ad<-ADtable[match(paste0(ds$CHROM,".",ds$POS),paste0(ADtable$CHROM,".",ADtable$POS)),]
vstPermutation(ad,pops=substr(colnames(ad)[-c(1:4)],1,11))
## End(Not run)


rCNV documentation built on Sept. 30, 2024, 9:39 a.m.