RNAMagnetAnchors: Runs RNAMagnet for identifying localization of single cells...

Description Usage Arguments Details Value Examples

View source: R/RNAMagnet.R

Description

RNAMagnet comes in two flavors: RNAMagnetAnchors and RNAMagnetSignaling. This function is meant to identify, for each single cell from a seurat object, the propensity to physically adhere to a set of anchor populations. For example, this function can identify if a single cell is more likely to bind to arteriolar or sinusoidal vessels.

Usage

1
2
3
4
5
RNAMagnetAnchors(seurat, anchors, return = "summary",
  neighborhood.distance = 0.7, neighborhood.gradient = 3, .k = 10,
  .x0 = 0.5, .minExpression = 0, .version = "latest",
  .cellularCompartment = c("Membrane", "ECM", "Both"),
  .manualAnnotation = "Correct")

Arguments

seurat

An object of class seurat containing a valid clustering and t-SNE information. For information on how to create such an object, see https://satijalab.org/seurat/get_started.html

anchors

A character vector of anchor populations. Entries must be levels of seurat@ident

return

Determines object to return; one of "summary" or "rnamagnet-class"

neighborhood.distance

See detail

neighborhood.gradient

See detail

...

For explanation of all further parameters, see RNAMagnetBase.

Details

Highly similar cell types can localize to different physical structures. For example, one type of pericyte may localize to sinusoids and another type may localize to arterioles. To increase the resolution in this scenario, RNAMagnetAnchors for each pair of single cells and anchor populations therefore computes a specificity score that describes how the single cell differs from similar cells.

In our hands, the behavior of RNAMagnet is largely insensitive to the parameters neighborhood.distance and neighborhood.gradient that define what actually constitutes a similar cell. To explore how these parameters affect the weight each single cell carries in specificity score computation, see the example code.

Value

Returns a data frame containing, for each cell, the propensity to physically interact with the various anchor populations as well as an overall adhesiveness score and prefered interaction partner. Alternatively, if return ist set to rnamagnet-class, an object of class rnamagnet.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
result <- RNAMagnetAnchors(NicheData10x, anchors = c("Sinusoidal ECs","Arteriolar ECs","Smooth muscle","Osteoblasts"))
qplot(x =NicheData10x@dr$tsne@cell.embeddings[,1], y=NicheData10x@dr$tsne@cell.embeddings[,2], \
     color = direction,size=I(0.75),alpha= adhesiveness,data=result) + \
     scale_color_brewer(name = "RNAMagnet\nLocation",palette= "Set1") + \
     scale_alpha_continuous(name = "RNAMagnet\nAdhesiveness")

#To understand the effect of the neighborhood.distance and neighborhood.gradient parameters
#consider the following snippet:
myMagnet <- RNAMagnetAnchors(NicheData10x, return = "rnamagnet-class", \
           anchors = c("Sinusoidal ECs","Arteriolar ECs","Smooth muscle","Osteoblasts"))
use <- 1234 #select some cell of interest
kernel <- function(x,k=10, x0=0.5) 1/(1+exp(-k * (x-x0))) #defines weighing function
plf <- data.frame(x = seurat@dr$tsne@cell.embeddings[,1],y = seurat@dr$tsne@cell.embeddings[,2], \
                 weight = 1-kernel(dbig[use,],k=neighborhood.gradient,x0=neighborhood.distance))
qplot(x = x, y= y, color = scores, data=plf) + \
    scale_color_gradientn(name = "Weight in local neighborhood", colours = c("#EEEEEE","#999999","blue","red")) + \
    geom_point(color = "black", shape = 17, size= 3, data=plf[use,])

## End(Not run)

veltenlab/rnamagnet documentation built on June 24, 2021, 6:19 p.m.