calcWeights: Calculate bin weights using B-Spline

Description Usage Arguments Value Examples

View source: R/BSplineMI.R

Description

Takes an expression matrix and calculates for each value the weights for each bin using B-Splines of a given order.

Usage

1

Arguments

x

Gene expression matrix with genes in rows and samples in columns

nBins

Number of bins

splineOrder

Spline order

Value

3-dimensional array of weights with dimensions: nBins x samples x genes

Examples

1
2
3
4
5
6
x <- matrix(0:100,nrow=1)
w <- calcWeights(x,nBins = 5,splineOrder = 3)
plot(NULL,xlim=c(0,100),ylim=c(0,1),xlab="x",ylab="weight")
for(i in 1:dim(w)[1]){
  lines(x[1, ],w[i, ,1],col=rainbow(dim(w)[1])[i])
}

larsgr/BSplineMI documentation built on May 20, 2019, 7:57 p.m.