
Extract the miloR neighbourhood graph positioned on an embedding
extract_milo_plot_data.RdPlaces every tested neighbourhood of a get_miloR_abundances_sc() result at
the embedding coordinate of its index cell, as Milo's plotNhoodGraphDA()
does, and returns the neighbourhood graph as node and edge tables. Two
neighbourhoods are connected by the number of cells they share.
The logFC is returned as is. Masking non-significant neighbourhoods is left
to the plot, is_sig carries the call.
Usage
extract_milo_plot_data(
object,
milo_res,
embedding = "umap",
alpha = 0.1,
overlap = 1L,
...
)Arguments
- object
A single cell class. The one the miloR result was built on.
- milo_res
miloRclass. Needs to have been throughtest_nhoods().- embedding
String. Name of the embedding to position the nodes in.
- alpha
Numeric. Spatial FDR threshold for
is_sig. Defaults to0.1.- overlap
Integer. Minimum number of shared cells for an edge. Defaults to
1L.- ...
Additional arguments forwarded to
extract_embedding_data()and onward toget_embedding()(e.g.modality).
Value
A list with the embedding stored as an embedding attribute and
nodes - data.table with
Nhood,dim_1,dim_2,size(cells in the neighbourhood), every column of the differential abundance results andis_sig.edges - data.table with
from,to,weight(shared cells) and the segment coordinatesx,y,xend,yend.