create_segsites: Segregating Sites
Description
This functions allow the creation and modification of segregating sites
objects, which are one of the most basic intermediary statistics that is
calculated in coala. Segregating sites are primarily SNP matrix that
contains all SNPs for one locus, with some additional information attached.
The parts of the S3 class are detailed below.Usage
create_segsites(snps, positions, trio_locus = numeric(0), check = TRUE)get_snps(segsites)
get_positions(segsites)
set_positions(segsites, positions)
get_trio_locus(segsites)
set_trio_locus(segsites, trio_locus)
is_segsites(segsites)
Arguments
snps
The SNP Matrix (see Details).
positions
A numeric vector indicating the relative positions of each
SNP on the locus (see Details).
trio_locus
If the locus consists of a locus trio (see Details).
check
Whether non-segregating sites are remove from the segregating
sites (TRUE
) or not (FALSE
).
segsites
The segregating sites object
Functions
get_snps
: Returns the SNP matrix from a segregating sites
object.get_positions
: Returns the SNP's positions from a segregating
sites object.set_positions
: Sets the SNP's positions in a segregating
sites object.get_trio_locus
: Returns the trio locus positions from a
segregating sites object.set_trio_locus
: Sets the trio locus in a segregating sites
object.is_segsites
: Checks whether an object is a segsites object.
Details
A segregating sites object contains all SNPs for one genetic locus. Each
object consists of tree parts: A SNP matrix, a vector of SNP positons and
a vector that states which transcript a SNP belong to, if the locus
consists of multiple transscripts ('locus trio').- In theSNPmatrix, each row represents a haplotype and each
column represents a SNP. An entry is either
1
if the
haplotype carries the derived allele for the SNP, or0
if it
carries the ancestral one.
- In the positions vector, each entry gives the relative
position of SNP in the corresponding column of the SNP matrix.
- The trio_locus vector contains the trio locus each SNP
belongs to. Entry of
-1
,0
, 1
represent the
left, middle, and right locus, respectively. For normal loci,
this just consists of 0
's