StructurePie: Struture Pie plot using ggplot2

Description Usage Arguments Value Examples

View source: R/StructurePie.R

Description

Make a Pie chart with STRUCTURE grades of membership

Usage

1
2
3
StructurePie(input_data, input_type, omega, color_set = NULL,
  use_voom = TRUE, pie_radius = 0.8, xlab = "Co-ordinate1",
  ylab = "Co-ordinate2", main = "STRUCTURE pie chart", control = list())

Arguments

input_data

The input data matrix with samples along the rows and the columns either represnting either features (for input_type = apply_tsne/apply_pca) on which to apply t-SNE/PCA, or columns representing the 2 co-ordinates to plot in STRUCTURE pie chart plot.

input_type

The type of input data provided. One of three possible options: apply_tsne : input data on which t-SNE is applied and the STRUCTURE pie chart co-ordinates defined by first two dimensions of the t-SNE apply_pca : input data on which PCA is applied and the STRUCTURE pie chart co-ordinates are defined by first two dimensions of the PCA. coord: Co-ordinates data with 2 columns representing the two co-ordinate axes of the STRUCTURE pie chart.

omega

Cluster membership probabilities of each sample. Usually a sample by cluster matrix in the Topic model output. The cluster weights sum to 1 for each sample.

color_set

The set of colors used for the pie charts in STRUCTURE pie. Defaults to NULL, which uses a set of 75 qualitatively distinct colors.

pie_radius

The radius of the pie chart in STRUCTUREpie plot.

xlab

X-label of the STRUCTURE pie chart.

ylab

Y-label of the STRUCTURE pie chart.

main

The title of the STRUCTURE pie chart.

control

Control paramaters for the STRUCTURE pie chart plot. User can add padding to the X and Y axes using padding option in control, tune legend pie radius and size (legend_pie_radius and legend_pie_cex), the plot background (bg), the color intensity of pie charts (color_intensity) and legend location (legendx and legendy).

Value

Plots the Structure Pie chart visualization of the t-SNE or PCA or user defined co-ordinate decomposition of data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(singleCellRNASeqMouseDeng2014)
deng.counts <- exprs(Deng2014MouseESC)
data("MouseDeng2014.FitGoM")
omega <- MouseDeng2014.FitGoM$clust_6$omega
set.seed(1000)
StructurePie(t(deng.counts), input_type="apply_tsne",
            use_voom=FALSE, omega = omega, xlab="TSNE1",
            ylab = "TSNE2",
            main = "STRUCTURE K=6 pie on tSNE")
StructurePie(t(deng.counts), input_type="apply_pca",
            use_voom = TRUE, omega = omega, xlab="PCA1",
            ylab = "PCA2",
            main = "STRUCTURE K=6 pie on PCA")

kkdey/CountClust documentation built on Jan. 17, 2021, 5:32 p.m.