normalize: normalize

Description Usage Arguments Details Value Author(s) See Also Examples

Description

A between-sample normalization function for SHAPE traces.

Usage

1
normalize(sample, base=sample[1,], margin=1, outbase=FALSE, mean=1.5)

Arguments

sample

A numeric matrix containing values to be normalized (e.g. a set of mutant SHAPE traces).

base

An optional numeric vector containing the values to which the sample is to be normalized (e.g. a wild type SHAPE trace). Default is the first trace in sample.

margin

An optional number indicating if sample is organized by rows or columns, where 1 indicates rows and 2 indicates columns. Default is 1.

outbase

An optional boolean indicating if the normalized base should be returned. Default is FALSE.

mean

An optional number setting the mean SHAPE value. Default is 1.5.

Details

This function normalizes the average value of the base vector. Each row (or column) in sample is then normalized by minimizing the absolute difference between the base and the sample row (or column).

Value

"samp_norm"

A normalized numeric matrix with the same dimensions as sample.

"samp_norm"

An optional list with two elements: normalized numeric matrix with the same dimensions as sample and a normalized vector the same length as base.

Author(s)

Chanin Tolson

See Also

getFeatures

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#sample data
sample = matrix(sample(1:100), ncol=10)
#normalize
samp_norm = normalize(sample)
           
#sample data
sample = matrix(sample(1:100), ncol=10)
base = sample(1:100, size=10)
#normalize
samp_norm = normalize(sample, base)

classSNitch documentation built on May 2, 2019, 5:51 p.m.