Learn R Programming

strvalidator (version 1.7.0)

calculateBalance: Calculate Balance

Description

Calculates the inter and intra locus balance.

Usage

calculateBalance(data, ref, lb = "prop", per.dye = TRUE, hb = 1, ignore.case = TRUE, word = FALSE, debug = FALSE)

Arguments

data
a data frame containing at least 'Sample.Name', 'Marker', 'Height', 'Allele', and Dye'.
ref
a data frame containing at least 'Sample.Name', 'Marker', 'Allele'.
lb
string. 'prop' is defualt and locus balance is calculated proportionally 'norm' locus balance is normalised in relation to the locus with the highest total peakheight.
per.dye
logical, default is TRUE and locus balance is calculated within each dye. FALSE locus balance is calculated globally across all dyes.
hb
numerical, definition of heterozygous balance. Default is hb=1. hb=1: HMW/LMW, hb=2: LMW/HMW, hb=3; Max2(Ph)/Max1(Ph).
ignore.case
logical indicating if sample matching should ignore case.
word
logical indicating if word boundaries should be added before sample matching.
debug
logical indicating printing debug information.

Value

data.frame with with columns 'Sample.Name', 'Marker', 'Delta', 'Hb', 'Lb', 'MPH', 'TPH'.

Details

Calculates the inter and intra locus balance for a dataset. Only peaks corresponding to reference alleles will be included in analysis (does not require filtered data). Be careful to not have actual alleles marked as 'OL' in dataset. It will lead to underestimation of the total peak height per locus/sample. Also calculates the allele size difference between heterozygous alleles. NB! Requires at least one row for each marker per sample, even if no data. NB! 'X' and 'Y' will be handled as '1' and '2' respectively.

Examples

Run this code
data(ref2)
data(set2)
# Calculate average balances.
calculateBalance(data=set2, ref=ref2)

Run the code above in your browser using DataLab