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

Perform a principal components analysis (PCA) on a target matrix with a specified SVD algorithm.

1 2 3 4 5 |

`x` |
A numeric matrix-like object with samples as rows and variables as columns. |

`rank` |
Integer scalar specifying the number of principal components to retain. |

`center` |
A logical scalar indicating whether columns of |

`scale` |
A logical scalar indicating whether columns of |

`get.rotation` |
A logical scalar indicating whether rotation vectors should be returned. |

`get.pcs` |
A logical scalar indicating whether the principal component scores should be returned. |

`...` |
For the generic, this contains arguments to pass to methods upon dispatch. For the |

This function simply calls `runSVD`

and converts the results into a format similar to that returned by `prcomp`

.

The generic is exported to allow other packages to implement their own `runPCA`

methods for other `x`

objects, e.g., scater for SingleCellExperiment inputs.

A list is returned containing:

`sdev`

, a numeric vector of length`rank`

containing the standard deviations of the first`rank`

principal components.`rotation`

, a numeric matrix with`rank`

columns and`nrow(x)`

rows, containing the first`rank`

rotation vectors. This is only returned if`get.rotation=TRUE`

.`x`

, a numeric matrix with`rank`

columns and`ncol(x)`

rows, containing the scores for the first`rank`

principal components. This is only returned if`get.pcs=TRUE`

.

Aaron Lun

`runSVD`

for the underlying SVD function.

`?BiocSingularParam`

for details on the algorithm choices.

1 2 |

```
List of 3
$ sdev : num [1:10] 1.06 1.04 1.04 1.03 1.03 ...
$ rotation: num [1:20, 1:10] 0.0259 0.2733 0.2581 -0.1309 -0.1749 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : NULL
.. ..$ : chr [1:10] "PC1" "PC2" "PC3" "PC4" ...
$ x : num [1:5000, 1:10] -2.049 -1.38 0.896 2.226 -0.555 ...
..- attr(*, "dimnames")=List of 2
.. ..$ : NULL
.. ..$ : chr [1:10] "PC1" "PC2" "PC3" "PC4" ...
```

BiocSingular documentation built on Nov. 8, 2020, 10:59 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.