join_features() extracts and joins information for specific features

# S4 method for class 'SingleCellExperiment'
join_features(
  .data,
  features = NULL,
  all = FALSE,
  exclude_zeros = FALSE,
  shape = "long",
  ...
)

Arguments

.data

A tidy SingleCellExperiment object

features

A vector of feature identifiers to join

all

If TRUE return all

exclude_zeros

If TRUE exclude zero values

shape

Format of the returned table "long" or "wide"

...

Parameters to pass to join wide, i.e. assay name to extract feature abundance from and gene prefix, for shape="wide"

Value

A `tidySingleCellExperiment` object containing information for the specified features.

Details

This function extracts information for specified features and returns the information in either long or wide format.

Examples

data(pbmc_small)
pbmc_small %>% join_features(
  features=c("HLA-DRA", "LYZ"))
#> tidySingleCellExperiment says: join_features produces duplicate cell names to accomadate the long data format. For this reason, a data frame is returned for independent data analysis. Assay feature abundance is appended as .abundance_counts and .abundance_logcounts.
#> # A tibble: 160 × 34
#>    .cell   .feature .abundance_counts .abundance_logcounts orig.ident nCount_RNA
#>    <chr>   <chr>                <dbl>                <dbl> <fct>           <dbl>
#>  1 ATGCCA… HLA-DRA                  0                 0    SeuratPro…         70
#>  2 ATGCCA… LYZ                      1                 4.97 SeuratPro…         70
#>  3 CATGGC… HLA-DRA                  1                 4.78 SeuratPro…         85
#>  4 CATGGC… LYZ                      1                 4.78 SeuratPro…         85
#>  5 GAACCT… HLA-DRA                  0                 0    SeuratPro…         87
#>  6 GAACCT… LYZ                      1                 4.75 SeuratPro…         87
#>  7 TGACTG… HLA-DRA                  0                 0    SeuratPro…        127
#>  8 TGACTG… LYZ                      0                 0    SeuratPro…        127
#>  9 AGTCAG… HLA-DRA                  1                 4.07 SeuratPro…        173
#> 10 AGTCAG… LYZ                      0                 0    SeuratPro…        173
#> # ℹ 150 more rows
#> # ℹ 28 more variables: nFeature_RNA <int>, RNA_snn_res.0.8 <fct>,
#> #   letter.idents <fct>, groups <chr>, RNA_snn_res.1 <fct>, file <chr>,
#> #   ident <fct>, PC_1 <dbl>, PC_2 <dbl>, PC_3 <dbl>, PC_4 <dbl>, PC_5 <dbl>,
#> #   PC_6 <dbl>, PC_7 <dbl>, PC_8 <dbl>, PC_9 <dbl>, PC_10 <dbl>, PC_11 <dbl>,
#> #   PC_12 <dbl>, PC_13 <dbl>, PC_14 <dbl>, PC_15 <dbl>, PC_16 <dbl>,
#> #   PC_17 <dbl>, PC_18 <dbl>, PC_19 <dbl>, tSNE_1 <dbl>, tSNE_2 <dbl>