produce_pca_df: Produce a PCA plot from txi

View source: R/PCA.R

produce_pca_dfR Documentation

Produce a PCA plot from txi

Description

The PCA is produced using the TPM by default (can also be the ruvg counts; see the ruvg_normalization param)

Usage

produce_pca_df(
  txi,
  use_normalisation = "none",
  min_counts = 5,
  metadata = NULL,
  id_metadata = NULL,
  ncp = 2
)

Arguments

txi

The txi object returned by the import_kallisto function.

use_normalisation

What kind of normalisation should be used instead of TPM? Can be either "none", "ruvg" or "combat". Default: "none"

min_counts

The minimal mean number of count (TPM by default; see also the ruvg_normalization param) required to keep the feature (gene or transcript) for the PCA.

id_metadata

The colname to use to join the metadata with the coordinate table. Must contains all the sample names found in the txi. If NULL and a metadata table is provided, the first column will be used to join the tables. Default: NULL.

ncp

Number of component to include in the graph. Default: 2.

graph

Produce the graph. TRUE or FALSE. Default: TRUE.

metatada

The metadata to add to the coordinate table to add color or shape with the results and the plot_pca function. If there is no metadata available, keep the default value of NULL. Value can either be a csv file or a data.frame. Default: NULL.

Value

Produce the PCA and silently returns a list with the coordinates and the x and y labels.

Examples

txi <- get_demo_txi()
res_pca <- produce_pca_df(txi)


CharlesJB/rnaseq documentation built on Oct. 17, 2023, 5:37 p.m.