Tidy reducedDims data

tidy_dims(fsce, dimnames = NULL, dims = c(1, 2))

Arguments

fsce

An object of class FunctionalSingleCellExperiment.

dimnames

vector of dimnames to retrieve. If NULL, retrieve all dimnames.

dims

vector of dimensions to retrieve

Tidying

This is a data tidier for a FunctionalSingleCellExperiment. Returns data from SingleCellExperiment in a tidy format, where variables are columns and observations are rows.

If the FunctionalSingleCellExperiment contains more than one SingleCellExperiment, data from each sce are joined using the cell_id variable name, and a new experiment column contains the name of the source sce.

See also

Examples

tidy_dims(fsce_small)
#> # A tibble: 250 x 8 #> experiment cell_id PCA1 PCA2 UMAP1 UMAP2 TSNE1 TSNE2 #> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 rnaseq TGCGGGTGTAGAGTGC 4.39 0.465 1.91 0.843 11.8 4.73 #> 2 rnaseq TGGTTCCCATCTATGG -5.96 -5.51 -4.01 0.781 -8.65 7.38 #> 3 rnaseq CATATTCCACGTCAGC -1.28 2.43 2.50 -0.741 6.75 2.09 #> 4 rnaseq TCACAAGTCCTGCTTG 17.3 0.547 0.891 -8.86 3.49 -22.3 #> 5 rnaseq GGAATAATCCAGGGCT -4.74 -0.112 -2.52 3.65 -8.28 2.34 #> 6 rnaseq CTTGGCTGTTGATTGC 20.3 -1.26 0.606 -8.65 5.15 -25.2 #> 7 rnaseq GTGAAGGTCTTTCCTC -5.32 -5.36 -3.53 2.93 -6.26 4.87 #> 8 rnaseq AGCGGTCAGTAGCCGA -5.30 -4.87 -1.70 1.16 -2.30 6.38 #> 9 rnaseq GGATGTTTCATGTGGT 0.848 13.3 7.48 5.61 -5.06 -4.95 #> 10 rnaseq GTACTCCGTAATCACC -5.77 -4.64 -2.30 1.47 -3.17 9.80 #> # … with 240 more rows
tidy_dims(fsce_small, dimnames = c("UMAP"))
#> # A tibble: 250 x 4 #> experiment cell_id UMAP1 UMAP2 #> <chr> <chr> <dbl> <dbl> #> 1 rnaseq TGCGGGTGTAGAGTGC 1.91 0.843 #> 2 rnaseq TGGTTCCCATCTATGG -4.01 0.781 #> 3 rnaseq CATATTCCACGTCAGC 2.50 -0.741 #> 4 rnaseq TCACAAGTCCTGCTTG 0.891 -8.86 #> 5 rnaseq GGAATAATCCAGGGCT -2.52 3.65 #> 6 rnaseq CTTGGCTGTTGATTGC 0.606 -8.65 #> 7 rnaseq GTGAAGGTCTTTCCTC -3.53 2.93 #> 8 rnaseq AGCGGTCAGTAGCCGA -1.70 1.16 #> 9 rnaseq GGATGTTTCATGTGGT 7.48 5.61 #> 10 rnaseq GTACTCCGTAATCACC -2.30 1.47 #> # … with 240 more rows