run_stability_analysis: Test stability of a decomposition by subsampling or...

View source: R/test_stability.R

run_stability_analysisR Documentation

Test stability of a decomposition by subsampling or bootstrapping donors. Note that running this function will replace the decomposition in the project container with one resulting from the tucker parameters entered here.

Description

Test stability of a decomposition by subsampling or bootstrapping donors. Note that running this function will replace the decomposition in the project container with one resulting from the tucker parameters entered here.

Usage

run_stability_analysis(
  container,
  ranks,
  tucker_type = "regular",
  rotation_type = "hybrid",
  subset_type = "subset",
  sub_prop = 0.75,
  n_iterations = 100,
  ncores = container$experiment_params$ncores
)

Arguments

container

environment Project container that stores sub-containers for each cell type as well as results and plots from all analyses

ranks

numeric The number of donor, gene, and cell type ranks, respectively, to decompose to using Tucker decomposition.

tucker_type

character The 'regular' type is the only one implemented with sparsity constraints (default='regular')

rotation_type

character Set to 'hybrid' to optimize loadings via our hybrid method (see paper for details). Set to 'ica_dsc' to perform ICA rotation on resulting donor factor matrix. Set to 'ica_lds' to optimize loadings by the ICA rotation. (default='hybrid')

subset_type

character Set to either 'subset' or 'bootstrap' (default='subset')

sub_prop

numeric The proportion of donors to keep when using subset_type='subset' (default=.75)

n_iterations

numeric The number of iterations to perform (default=100)

ncores

numeric The number of cores to use (default=container$experiment_params$ncores)

Value

The project container with the donor scores stability plot in container$plots$stability_plot_dsc and the loadings stability plot in container$plots$stability_plot_lds

Examples

test_container <- run_stability_analysis(test_container, ranks=c(2,4),
tucker_type='regular', rotation_type='hybrid', subset_type='subset', 
sub_prop=0.75, n_iterations=5, ncores=1)

scITD documentation built on Sept. 8, 2023, 5:11 p.m.