Description Usage Arguments Value Author(s) Examples
averages over running windows
1 2 3 |
data |
data frame from a ‘.bed’ file. The first column indicates the chromosome. The second and the third row give starting and end point [in base pairs]. The 4th column gives the values. All the other columns will be ignored |
length |
length in base pairs of the window |
step |
positive integer.
shift of the window by |
start |
the base pair position where the very first window starts. |
n.min |
the required minimal number of SNPs in the window. If there are less SNPs inside, this window is not reported. |
na.rm |
logical.
if |
what |
string. Name of the function that should be 'windowed';
|
It returns a matrix with 4 columns: the first and the second column contain the starting and end point of the window in ‘.bed’ coding. The third column gives the mean (or variance etc). The 4th column gives the number of values the mean is based on.
Martin Schlather, schlather@math.uni-mannheim.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
loci <- 10000
pos <- sort(sample(10^4:10^6, loci))
pos2 <- pos + 1
freq <- runif(loci)^5
data <- data.frame(V1=rep(1, loci), V2=pos, V3=pos2, V4=freq)
win.mean <- windower(data, n.min=25)
head(win.mean)
win.var <- windower(data, n.min=25, what="var")
head(win.var)
win.sd <- windower(data, n.min=25, what="sd")
head(win.sd)
win.min <- windower(data, n.min=0, what="min")
head(win.min)
win.max <- windower(data, n.min=0, what="max")
head(win.max)
win.median <- windower(data, n.min=0, what="median")
head(win.median)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.