treecor_samplepcaplot: Sample PCA plot

View source: R/treecor_samplepcaplot.R

treecor_samplepcaplotR Documentation

Sample PCA plot

Description

Sample PCA plot

Usage

treecor_samplepcaplot(
  sample_meta,
  pca_matrix,
  response_variable,
  analysis_type = "cancor",
  num_permutations = 1000,
  alternative = "two.sided",
  row_variable = NULL,
  col_variable = NULL,
  font_size = 15,
  point_size = 1,
  point_shape = 19,
  point_alpha = 1,
  line_type = "dashed",
  line_color = "black"
)

Arguments

sample_meta

Sample-level metadata. Must contain sample and variables to be plotted (e.g. row_variable and col_variable).

pca_matrix

PCA matrix with sample names on the rows and PC coordinates on the columns (e.g. PC1 and PC2).

response_variable

A univariate phenotype. If multivariate phenotype is provided, either convert them to a univariate combined phenotype (e.g. using weight or PCA) or call this function separately for each outcome.

analysis_type

Specify summary statistic, can be one of 'cancor' (default) or 'regression'.

num_permutations

Number of permutations. Default is 1000.

alternative

Specify alternative hypothesis. Must be one of 'two.sided' (default) or 'less' or 'greater'.

row_variable

Specify variable for row. Must be categorical variable (e.g. 'factor' or 'character' class).

col_variable

Specify variable for column (optional). Must be categorical variable (e.g. 'factor' or 'character' class).

font_size

Font size. Default is 15.

point_size

Set point size. Default is 0.1.

point_shape

Set point shape. Default is 19.

point_alpha

Set point transparency. Default is 1.

line_type

Set line type as 'dashed' (default) or 'solid' or others.

line_color

Set optimal axis line color.

Value

Sample pca plot.

Author(s)

Boyang Zhang <bzhang34@jhu.edu>, Hongkai Ji

Examples

treecor_samplepcaplot(sample_meta, pca_matrix, response_variable = 'severity', row_variable = 'severity')

byzhang23/TreeCorTreat documentation built on May 7, 2024, 8:37 a.m.