Learn R Programming

coala (version 0.2.1)

create_segsites: Segregating Sites

Description

This functions allow the creation and modification of segregating sites objects, which are on of the most basic statistics that is calculated in coala. Segregating Sites are primarily a matrix, where each row repesents a haplotype and each column represents a SNPs. A given entry is either 1 if the haplotype carries the derived allele for the SNP, or 0 if it carries the ancestral one.

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
positions
A numeric vector indicating the relative positions of each SNP on the locus.
trio_locus
If the locus consists of a locus trio, then this contains the trio locus each SNP belongs to.
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.