makeRA: Make an Reference/Alternate (RA) object.

View source: R/makeRA.R

makeRAR Documentation

Make an Reference/Alternate (RA) object.

Description

Function which creates an RA object from inputs of count matrices of reference and alternate alleles.

Usage

makeRA(ref, alt, indID, chrom = NULL, pos = NULL, sampthres = 0.01)

Arguments

ref

Matrix of non-negative counts of reference alleles. Number of rows correspond to the number of samples. Number of columns correspond to the number of SNPs.

alt

Matrix of non-negative counts of alternate alleles. Number of rows correspond to the number of samples. Number of columns correspond to the number of SNPs.

indID

Vector of IDs for samples. Needs to have the same length as the number of rows in 'ref' and 'alt' arguments. Note: Duplicate IDs will be merged into one sample.

chrom

Vector of chromosome numbers. Needs to have the same length as the number of columns in 'ref' and 'alt' arguments. If 'NULL', then each SNP is given a random unique chromsome number.

pos

Vector of SNP positions. Needs to have the same length as the number of columns in 'ref' and 'alt' arguments. If 'NULL', then each SNP is given a random unique positi number.

sampthres

A numeric value giving the filtering threshold for which individual samples are removed. Default is 0.01 which means that samples with an average number of reads per SNP that is less than 0.01 are removed.

Value

An R6 object of class RA.

Author(s)

Timothy P. Bilton

Examples

## Load data from package
datloc = system.file("extdata", "simdata.Rdata", package = "GUSbase")
load(datloc)

## Create RA object from the data
makeRA(ref, alt, indID, chrom, pos)


tpbilton/GUSbase documentation built on March 8, 2024, 1:35 p.m.