splineAnalyze: Spline-based window analysis

Description Usage Arguments Value Examples

View source: R/spline_analyze.R

Description

Defines window boundaries for analyzing genetic data and evaluates the specified windows

Usage

1
2
splineAnalyze(Y, map, smoothness = 100, s2 = NA, mean = NA,
  plotRaw = FALSE, plotWindows = FALSE, method = 3)

Arguments

Y

A vector of estimates of some parameter, such as Fst, computed at individual markers. One chromosome should be analyzed at a time.

map

A vector of positions for each marker with a corresponding parameter estimate.

smoothness

The level of resolution (in base pairs) for computing the spline and its derivatives

s2

The variance of parameter estimates, to be used for computing Wstats. Default is to compute this automatically, but it may be manually specified, e.g. so that the value across chromosomes may be utilized.

mean

The mean of parameter estimates, to be used for computing Wstats. Default is to comput this automatically, but it may be manually specified, e.g. so that the value across chromosomes may be utilized.

plotRaw

Whether or not to produce a plot of raw data, with the fitted spline

plotWindows

Whether or not to include a plot of Wstat values over the computed windows

method

The method for controlling amount of smoothing: 1, 2, 3, or 4. See documentation of smooth.Pspline for description. Usual choices are either 3 for generalized cross validation or 4 for ordinary cross validation.

Value

rawSpline The fitted spline object

breaks The spline-suggested window breaks

windowData A table of mean parameter estimates and Wstats computed over spline-suggested windows

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(chr6)
sub6 <- chr6[55000:63000,]
chr6Spline <- splineAnalyze(Y=sub6$Fst,map=sub6$Position,smoothness=100,
plotRaw=TRUE,plotWindows=TRUE,method=4)

## Not run: 
chr6Spline <- splineAnalyze(Y=chr6$Fst,map=chr6$Position,smoothness=100,
plotRaw=TRUE,plotWindows=TRUE,method=4)

## End(Not run)

GenWin documentation built on May 29, 2017, 12:30 p.m.