Skip to contents

Convert objects to a PNAAssay5

Usage

as.PNAAssay5(x, ...)

# S3 method for class 'Assay5'
as.PNAAssay5(x, cellgraphs = NULL, proximity = NULL, fs_map = NULL, ...)

Arguments

x

An object to convert to class PNAAssay5

...

Arguments passed to other methods

cellgraphs

A list of CellGraph objects

proximity

A tbl_df with proximity scores

fs_map

A tbl_df with information on source PXL file paths, sample IDs, and component IDs

Value

A PNAAssay5 object

Examples

library(pixelatorR)
library(dplyr)
library(SeuratObject)

pxl_file <- minimal_pna_pxl_file()
counts <- ReadPNA_counts(pxl_file)
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/Rtmp3BjCtL/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
assay <- CreateAssay5Object(
  counts = counts
)
pna_assay5 <- as.PNAAssay5(
  assay,
  cellgraphs = rep(list(NULL), ncol(counts)) %>%
    setNames(colnames(counts))
)
pna_assay5
#> PNAAssay (v5) data with 158 features for 5 cells
#> First 10 features:
#>  HLA-ABC, B2M, CD11b, CD11c, CD18, CD82, CD8, TCRab, HLA-DR, CD45 
#> Layers:
#>  counts 
#> Loaded CellGraph objects:
#>  0