calculateHb: Calculate Heterozygote Balance

Description Usage Arguments Details Value Examples

View source: R/calculateHb.r

Description

Calculates the heterozygote (intra-locus) peak balance.

Usage

1
2
3
calculateHb(data, ref, hb = 1, kit = NULL, sex.rm = FALSE,
  qs.rm = FALSE, ignore.case = TRUE, exact = FALSE, word = FALSE,
  debug = FALSE)

Arguments

data

a data frame containing at least 'Sample.Name', 'Marker', 'Height', and 'Allele'.

ref

a data frame containing at least 'Sample.Name', 'Marker', 'Allele'.

hb

numerical, definition of heterozygote balance. Default is hb=1. hb=1: HMW/LMW, hb=2: LMW/HMW, hb=3; min(Ph)/max(Ph).

kit

character defining the kit used. If NULL automatic detection is attempted.

sex.rm

logical TRUE removes sex markers defined by 'kit'.

qs.rm

logical TRUE removes quality sensors defined by 'kit'.

ignore.case

logical indicating if sample matching should ignore case.

exact

logical indicating if exact sample matching should be used.

word

logical indicating if word boundaries should be added before sample matching.

debug

logical indicating printing debug information.

Details

Calculates the heterozygote (intra-locus) peak balance for a dataset. Known allele peaks will be extracted using the reference prior to analysis. Calculates the heterozygote balance (Hb), size difference between heterozygous alleles (Delta), and mean peak height (MPH). NB! 'X' and 'Y' will be handled as '1' and '2' respectively.

Value

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

Examples

1
2
3
4
data(ref2)
data(set2)
# Calculate average balances.
calculateHb(data=set2, ref=ref2)

Example output

R session is headless; GTK+ not initialized.
STR-validator 2.0.0 loaded!
'kit' not provided. Attempting auto detection.
Detected kit(s): SGMPlus
Extracting known alleles from dataset...
Using 'fast' allele filtering method.
This method discards NA alleles/loci/samples.
1 "NA" in 'Allele' converted to NA
Removed 1 rows where Allele=<NA>
Audit trail created for res in function filterProfile.
Audit trail updated by function filterProfile.
Estimating size of alleles...
Audit trail updated by function addSize.
Replacing gender markers: X->1, Y->2
Calculating allele distance: Delta=max(Allele) - min(Allele)...
Extracting heterozygotes...
Calculating mean peak height: MPH=(HMW+LMW)/2...
Calculating heterozygote balance: Hb=HMW/LMW...
Audit trail created for res in function calculateHb.
Audit trail updated by function calculateHb.
   Sample.Name  Marker Dye Delta HMW LMW   MPH        Hb
1    SampleA01 D3S1358   B   3.0 402 460 431.0 0.8739130
2    SampleA01 D16S539   B   2.0 491 423 457.0 1.1607565
3    SampleA01    AMEL   G   1.0 587 632 609.5 0.9287975
4    SampleA01  D18S51   G  15.2 361 398 379.5 0.9070352
5    SampleA01    TH01   Y   4.0 384 359 371.5 1.0696379
6    SampleA02 D3S1358   B   3.0 215 225 220.0 0.9555556
7    SampleA02 D16S539   B   2.0 241 198 219.5 1.2171717
8    SampleA02    AMEL   G   1.0 312 326 319.0 0.9570552
9    SampleA02  D18S51   G  15.2 195 206 200.5 0.9466019
10   SampleA02    TH01   Y   4.0 179 183 181.0 0.9781421

strvalidator documentation built on Aug. 25, 2018, 5:04 p.m.