simplexplot2: The plot of scatter simplex

View source: R/simplexplot2.R

simplexplot2R Documentation

The plot of scatter simplex

Description

This function shows scatter simplex of mixture expressions.

Usage

simplexplot2(
  data,
  A,
  MGlist = NULL,
  data.extra = NULL,
  col = "gray",
  pch = 1,
  cex = 0.8,
  mg.col = "red",
  mg.pch = 1,
  mg.cex = 1.2,
  ex.col = "black",
  ex.pch = 19,
  ex.cex = 1.5,
  ...
)

Arguments

data

A data set that will be internally coerced into a matrix. Each row is a gene and each column is a sample. Data should be in non-log linear space with non-negative numerical values (i.e. >= 0). Missing values are not supported. All-zero rows will be removed internally.

A

Prior/Estimated proportion matrix.

MGlist

A list of vectors, each of which contains known markers and/or CAM-detected markers for one subpopulation.

data.extra

Extra data points to be shown in the simplex plot, e.g. the points associated with prior/estimated proportion vectors. The format should be consistent with data, so prior/estimated proportion matrix needs to be transposed before as the input.

col

The color for data points. The default is "gray".

pch

The symbol/character for data points. The default is 1.

cex

The symbol/character expansion for data points. The default is 0.8.

mg.col

The colors for marker genes. Marker genes of one subpopulation could have their own color if a vector is provided. The default is "red".

mg.pch

The symbols/characters for marker genes. Marker genes of one subpopulation could have their own symbol/character if a vector is provided. The default is 1.

mg.cex

The symbol/character expansion for marker genes. The default is 1.2.

ex.col

The colors for extra data points. Each data point could have its own color if a vector is provided. The default is "black".

ex.pch

The symbols/characters for extra data points. Each data point could have its own symbol/character if a vector is provided. The default is 19.

ex.cex

The symbol/character expansion for extra data points. The default is 1.5.

...

All other arguments are passed to the plotting command.

corner.order

The order to show simplex corners counterclockwise.

Details

This function can show the scatter simplex and detected marker genes in a 2D plot. The corners in the high-dimensional simplex will still locate at extreme points of low-dimensional simplex.

Value

A plot to the current device.

Examples

#obtain data, A matrix, marker genes
data(ratMix3)
data <- ratMix3$X
A <- ratMix3$A

#Find marker genes
MGlist <- cotMG(data, rASest3$S, cos.thres = 0.99)

#plot simplex for data
simplexplot2(data, A)
simplexplot2(data, A, MGlist = MGlist) #Color marker genes in the plot
simplexplot2(data, A, MGlist = MGlist,
    data.extra = t(A)) #show the location of proportion vectors in the plot

#set different colors
simplexplot2(data, A, MGlist = MGlist,
            col = "blue", mg.col = c("red","orange","green"))

ChiungTingWu/CAM3 documentation built on Feb. 14, 2024, 9:22 a.m.