R: Normalize input data for use with the PPA

ppa.normalize {isa2} | R Documentation

## Normalize input data for use with the PPA

### Description

Normalize the two input matrices and store them in a form that can be used effectively to perform the Ping-Pong Algorithm

### Usage

    ## S4 method for signature 'list'
    ppa.normalize(data, ...)

### Arguments

`data` | A list of two numeric matrices, with matching number of columns. They might contain `Na` and/or `NaN` values.
`...` | Additional arguments, see details below.

### Details

This function can be called as

        isa.normalize(data, prenormalize = FALSE)

where the arguments are:

data

  A list of two numeric matrices, with matching number of columns. They might contain `Na` and/or `NaN` values.

prenormalize

  Logical scalar, see details below.

It was observed that the PPA works best if the input matrices are scaled to have mean zero and standard deviation one.

A PPA step consist of four matrix-multiplications and this requires four different matrices, each of the two input matrices scaled row-wise and column-wise.

If the `prenormalized` argument is set to `TRUE`, then row-wise scaling is calculated on the column-wise scaled matrices and not on the raw input.

### Value

A list of four matrices, the first two corresponds to the first input matrix, the second two to the second matrix.

### Author(s)

Gabor Csardi Gabor.Csardi@unil.ch

### References

Kutalik Z, Bergmann S, Beckmann, J: A modular approach for integrative analysis of large-scale gene-expression and drug-response data Nat Biotechnol 2008 May; 26(5) 531-9.

### See Also

See `ppa` for an easy way of running the PPA

### Examples

    ## In-silico data
    set.seed(1)
    insili <- ppa.in.silico()
    nm <- ppa.normalize(insili[1:2])

    ## Check it
    max(abs(rowSums(nm[[1]])))
    max(abs(rowSums(nm[[2]])))
    max(abs(rowSums(nm[[3]])))
    max(abs(rowSums(nm[[4]])))

    max(abs(rowSums(nm[[1]])))
    max(abs(rowSums(nm[[2]])))
    max(abs(rowSums(nm[[3]])))
    max(abs(rowSums(nm[[4]])))

    ## Plot them
    if (interactive()) {
      layout(rbind(1:3,4:6))
      image(insili[[1]], main="Original data 1")
      image(t(nm[[1]]), main="Row normalized 1")
      image(nm[[2]], main="Column normalized 1")

      image(insili[[2]], main="Original data 2")
      image(t(nm[[3]]), main="Row normalized 2")
      image(nm[[4]], main="Column normalized 2")
    }

[Package isa2 version 0.3.5 Index]