summarize_STlist.Rd
Produces a data frame with counts per gene and counts per ROI/spot/cell
summarize_STlist(x = NULL)
an STlist
a data frame
The function creates a table with counts per gene and counts per region of interest (ROI), spot, or cell in the samples stored in the STlist
# Using included melanoma example (Thrane et al.)
library('spatialGE')
data_files <- list.files(system.file("extdata", package="spatialGE"), recursive=T, full.names=T)
count_files <- grep("counts", data_files, value=T)
coord_files <- grep("mapping", data_files, value=T)
clin_file <- grep("thrane_clinical", data_files, value=T)
melanoma <- STlist(rnacounts=count_files[c(1,2)], spotcoords=coord_files[c(1,2)], samples=clin_file) # Only first two samples
#> Warning: Sample ST_mel2_rep1 was not found among the count/coordinate files.
#> Warning: Sample ST_mel2_rep2 was not found among the count/coordinate files.
#> Warning: Sample ST_mel3_rep1 was not found among the count/coordinate files.
#> Warning: Sample ST_mel3_rep2 was not found among the count/coordinate files.
#> Warning: Sample ST_mel4_rep1 was not found among the count/coordinate files.
#> Warning: Sample ST_mel4_rep2 was not found among the count/coordinate files.
#> Found matrix data
#> Matching gene expression and coordinate data...
#> Converting counts to sparse matrices
#> Completed STlist!
#>
summarize_STlist(melanoma)
#> # A tibble: 2 × 9
#> sample_name spotscells genes min_co…¹ mean_…² max_c…³ min_g…⁴ mean_…⁵ max_g…⁶
#> <chr> <int> <int> <dbl> <dbl> <dbl> <int> <dbl> <int>
#> 1 ST_mel1_rep1 279 15666 185 4449. 26687 167 1999. 6441
#> 2 ST_mel1_rep2 293 16148 6 6056. 22682 6 2443. 6009
#> # … with abbreviated variable names ¹min_counts_per_spotcell,
#> # ²mean_counts_per_spotcell, ³max_counts_per_spotcell,
#> # ⁴min_genes_per_spotcell, ⁵mean_genes_per_spotcell, ⁶max_genes_per_spotcell