tricubeStat: Calculate tricube weighted statistics for each SNP

Description Usage Arguments Value See Also Examples

View source: R/G_functions.R

Description

Uses local regression (wrapper for locfit) to predict a tricube smoothed version of the statistic supplied for each SNP. This works as a weighted average across neighboring SNPs that accounts for Linkage disequilibrium (LD) while minizing noise attributed to SNP calling errors. Values for neighboring SNPs within the window are weighted by physical distance from the focal SNP.

Usage

1
tricubeStat(POS, Stat, windowSize = 2e+06, ...)

Arguments

POS

A vector of genomic positions for each SNP

Stat

A vector of values for a given statistic for each SNP

...

Other arguments passed to locfit and subsequently to locfit.raw() (or the lfproc). Usefull in cases where you get "out of vertex space warnings"; Set the maxk higher than the default 100. See locfit.raw().

WinSize

the window size (in base pairs) bracketing each SNP for which to calculate the statitics. Magwene et. al recommend a window size of ~25 cM, but also recommend optionally trying several window sizes to test if peaks are over- or undersmoothed.

Value

Returns a vector of the weighted statistic caluculted with a tricube smoothing kernel

See Also

getG for G statistic calculation

locfit for local regression

Examples

1
df_filt_4mb$Gprime <- tricubeStat(POS, Stat = GStat, WinSize = 4e6)

bmansfeld/QTLseqR documentation built on Jan. 25, 2020, 8:52 p.m.