pcaExperiment {ORFik} | R Documentation

## Simple PCA analysis

### Description

Detect outlier libraries with PCA analysis. Will output PCA plot of PCA component 1 (x-axis) vs PCA component 2 (y-axis) for each library (colored by library), shape by replicate. Will be extended to allow batch correction in the future.

### Usage

    pcaExperiment(
      df,
      output.dir = NULL,
      table = countTable(df, "cds", type = "fpkm"),
      title = "CDS fpkm (All genes)",
      plot.ext = ".pdf"
    )

### Arguments

`df` | an ORFik `experiment`
`output.dir` | default NULL, else character path to directory. File saved as "PCAplot_(experiment name)(plot.ext)"
`table` | data.table, default countTable(df, "cds", type = "fpkm"), a data.table of counts per column (default normalized fpkm values).
`title` | character, default "CDS fpkm (All genes)".
`plot.ext` | character, default: ".pdf". Alternatives: ".png" or ".jpg". Note that in pdf format the complex correlation plots become very slow to load!

### Value

ggplot or invisible(NULL) if output.dir is defined or < 3 samples

[Package ORFik version 1.12.13 Index]