This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract data from Signac RegionMatrix?

I'm trying to extract the data matrix computed by Signac r package when running RegionMatrix(). I know I can plot the data with RegionHeatmap(), but I want to plot the data with another package. So, if I created a region matrix like this:

my_object <- RegionMatrix(my_object
                        , key = "my_region_matrix"
                        , regions = StringToGRanges(top_cluster_genes$gene)
                        , upstream = 2500, downstream = 2500)

How do I go about extracting the data stored within the object under the key "my_region_matrix"? I know it's a pretty basic question, but I've been browsing the returned object and can't find any assay/matrix with that key name.

signac r seurat sc-atac

2 answers

Just got back an answer from the Signac team, the way to do this is:

mat <- GetAssayData(object = object, slot = "positionEnrichment")[["my_region_matrix"]]
object@assays$ATAC@positionEnrichment$my_region_matrix

and also

object@assays$ATAC@positionEnrichment$my_region_matrix$condition_of_interest

Log in to answer this question.