transformReverseBarycentric: Convert from barycentric coordinates back to original...

Description Usage Arguments Value Examples

View source: R/analyze.R

Description

Converts a dataframe contain barycentric coordinates in the x and y columns back to original coordinates (apart from a constant for each gene).

Usage

1
transformReverseBarycentric(barycoords, transfomatrix = NULL)

Arguments

barycoords

Dataframe of barycentric coordinates with x and y in separate columns

transfomatrix

NULL (default) or a numeric matrix containing the transformation matrix

Value

Matrix containing for every gene original expression values centered around 0

Examples

1
2
3
4
5
Eoi = matrix(rnorm(1000*3, sd=0.5), 1000, 3, dimnames=list(1:1000, c(1,2,3)))
Eoi[1:100,1] = Eoi[1:100,1] + 1
barycoords = transformBarycentric(Eoi)
reversebarycoords = transformReverseBarycentric(barycoords)
all.equal(scale(t(Eoi)), scale(t(reversebarycoords)), check.attributes=FALSE)

Zouter/triwise documentation built on June 3, 2017, 10:50 a.m.