get_site_dist: Determine whether a variant site is fixed or polymorphic

Description Usage Arguments Details Value

View source: R/mktest.r

Description

This is an internal utility function

Usage

1
get_site_dist(d, group_thres = 2)

Arguments

d

A data table that matches each site at each sample with the group of that sample. Must have column 'allele' which must have two values only; column 'Group' which is the grouping factor (can be character) with two levels.

group_thres

The minimum number of samples per group to consider the site.

Details

Looks at the distribution of alleles at one site and determines how it distributes with respect to a grouping factor. If the site perfectly separates both groups it is 'Fixed' and 'Polymorphic' otherwise.

Assumes grouping factor with two levels (NO CHECKS!!)

Assumes bi-allelic site indicated by character string (NO CHECKS!!)

Assumes only data from one site is give (NO CHECKS!!)

USE WITH CARE!!

Value

A character string indicating the type of site: 'Fixed', 'Polymorphic', 'Invariant' or NA.


surh/HMVAR documentation built on Aug. 18, 2021, 1:21 a.m.