plot_feature_rank_single: Feature Rank plot

Description Usage Arguments Value

View source: R/plot_feature_rank_single.R

Description

Feature Rank plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
plot_feature_rank_single(
  value,
  group = NULL,
  group_color = NULL,
  group_names = NA,
  celltype_group = NULL,
  celltype_group_color = NULL,
  cell_color_by = NULL,
  cell_color = NULL,
  barcode_subsample = 200,
  barplot_group = NULL,
  barplot_stack = NULL,
  barplot_stack_color = NULL,
  barplot_show_total = TRUE,
  barplot_total_fontface = "bold",
  barplot_show_ymax = TRUE,
  barplot_stat_FUN = sum,
  barplot_stat_by = "group",
  barplot_alpha = 1,
  show_density = TRUE,
  show_barplot = TRUE,
  show_barcode = TRUE,
  show_violin = TRUE,
  show_squares = TRUE,
  combine = TRUE,
  ties_method = "first",
  rank_normalize = TRUE,
  threshold_y = NA,
  threshold_color = alpha("black", 0.5),
  threshold_size = 1,
  threshold_linetype = "dashed",
  threshold_show_celltype_pct = TRUE,
  threshold_celltype_pct_fontface = "bold",
  threshold_celltype_pct_size = (theme_get()$text$size/(1/0.352777778)),
  threshold_show_sipk = FALSE,
  threshold_sipk_SD_FUN = scfeaturerank::sd_robust,
  threshold_sipk_denominator = 1000,
  threshold_sipk_size = (theme_get()$text$size/(1/0.352777778)),
  labels = c(),
  ...
)

Arguments

value

Value used for ranking and x-axis (i.e. UMI count).

group

Grouping variable for comparison (i.e. titration).

group_color

Named vector for coloring groups. Used in density plot.

group_names

Rename group levels (i.e. can be used to append concentration or other info that is marker specific)

celltype_group

Celltype for grouping cells (i.e. lineage).

celltype_group_color

Named vector for coloring celltype_group. Used in violin plot fill.

cell_color_by

Variable for coloring cells (i.e. celltype). Used in "barcode" plot.

cell_color

Named vector for coloring cells. "Barcode" colors.

barcode_subsample

Subsample up to this number of cells from each celltype_group to display in barcode plot

barplot_group

Grouping variable for barplots (usually the same as group or celltype_group)

barplot_stack

Subgrouping variable for "stacks" within barplot (usually the same as cell_color_by or celltype_group)

barplot_stack_color

Named vector for coloring barplot_stack levels

barplot_show_total

Should total sums be displayed within barplot? (most meaningful for non-normalized counts)

barplot_total_fontface

Font face for total in barplot. Default "bold".

barplot_show_ymax

Should maximum y-value tick be shown for barplot? (most meaningful for non-normalized counts)

barplot_stat_FUN

Should the barplot show "median" or "sum" (default) of counts?

barplot_stat_by

Should stat be normalized to "group" (default) or "none" to show raw value.

barplot_alpha

Barplot alpha (can be reduced to make total count more readable)

show_density

Should density plot be drawn?

show_barplot

Should barplot be drawn?

show_barcode

Should barcode plot be drawn?

show_violin

Should violin plot be drawn?

show_squares

Should group squares above barplot be drawn?

combine

Should plot components be combined (default). If FALSE, a list of plot components will be returned.

ties_method

ties.method passed on to rank().

threshold_y

If not NULL, a threshold line will be drawn at a the set rank. Should be set to expected fraction of positive cells.

threshold_color

Threshold line color

threshold_size

Threshold line size

threshold_linetype

Threshold line type

threshold_show_celltype_pct

Show percent above threshold in celltype component

threshold_celltype_pct_fontface

Label face for percent above threshold in celltype component

threshold_celltype_pct_size

Label size for percent above threshold in celltype component

threshold_show_sipk

Should Staining Index Per Thousand (SIPK) be shown in group squares?

threshold_sipk_SD_FUN

Function for calculating standard deviation of Staining Index Per Thousand (SIPK). Defaults to scfeaturerank::sd_robust

threshold_sipk_denominator

What denominator should be used for value. Defaults to per 1000.

threshold_sipk_size

Label size for Staining Index Per Thousand (SIPK).

labels

Named vector of axis labels (set element to NULL to remove axis title). Default: c("x.rank"="Value", "y.rank"="Rank", "y.density"="Density", "y.barplot"="Sum")

...

Passed on to plot_feature_rank_combine(). Useful for setting relative component sizes.

rank_normalized

Should ranks be normalized by group (TRUE) or show as absolute counts (FALSE). Default TRUE.

Value

ggplot2 object or list of ggplot2 objects (if combine=FALSE)


Terkild/scfeaturerank documentation built on March 6, 2021, 1:04 p.m.