splineAnalyze: Spline-based window analysis

View source: R/spline_analyze.R

splineAnalyzeR Documentation

Spline-based window analysis

Description

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

Usage

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


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 Nov. 25, 2022, 5:05 p.m.

Related to splineAnalyze in GenWin...