study_R2 {iasva} | R Documentation |
study_R2() studies how different R2 thresholds is changing: 1) number of marker genes; 2) clustering quality (assuming number of clusters is known). It generated diagnostic plots that shows how selected genes and clustering quality changes as a function of R2 threshold.
study_R2(Y, iasva.sv, selected.svs = 2, no.clusters = 2, verbose = FALSE)
Y |
A SummarizedExperiment class containing read counts where rows represent genes and columns represent samples. |
iasva.sv |
matrix of estimated surrogate variables, one column for each surrogate variable. |
selected.svs |
list of SVs that are selected for the analyses. Default is SV2 |
no.clusters |
No of clusters to be used in the analyses. Default is 2. |
verbose |
If verbose = TRUE, the function outputs detailed messages. |
a summary plot that represents silhoutte index and marker gene counts as a function of R2 and corresponding matrices.
counts_file <- system.file("extdata", "iasva_counts_test.Rds", package = "iasva") counts <- readRDS(counts_file) anns_file <- system.file("extdata", "iasva_anns_test.Rds", package = "iasva") anns <- readRDS(anns_file) Geo_Lib_Size <- colSums(log(counts + 1)) Patient_ID <- anns$Patient_ID mod <- model.matrix(~Patient_ID + Geo_Lib_Size) summ_exp <- SummarizedExperiment::SummarizedExperiment(assays = counts) iasva.res<- iasva(summ_exp, mod[, -1],verbose = FALSE, permute = FALSE, num.sv = 5) iasva.sv <- iasva.res$sv study_res <- study_R2(summ_exp, iasva.sv)