create_segsites {coala}R Documentation

Segregating Sites

Description

These functions create and modify segregating sites objects, which are one of the basic intermediary statistics that is calculated in coala. Segregating sites consist primarily of a 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)

create_locus_trio(left, middle, right)

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 removed from the segregating sites (TRUE) or not (FALSE).

segsites

The segregating sites object

left

The segregating sites from the left locus

middle

The segregating sites from the middle locus

right

The segregating sites from the right locus

Details

A segregating sites object contains all SNPs for one genetic locus. Each object consists of three parts: A SNP matrix, a vector of SNP positions and a vector that states which transcript a SNP belong to, if the locus consists of multiple transscripts ('locus trio').

Functions

Author(s)

Paul Staab

See Also

For converting biological data to segsites: as.segsites

Examples

snps <- matrix(c(1, 0, 0,
                 1, 1, 0,
                 0, 0, 1), 3, 3, TRUE)
pos <- c(.1, .3, .5)
segsites <- create_segsites(snps, pos)
print(segsites)
get_snps(segsites)
get_positions(segsites)

# When subsetting individuals, sites that are not
# segregating in these are automatically removed:
segsites[1:2, 1:3]

[Package coala version 0.7.2 Index]