Plots dotplot to compare ligand-receptor rankings from spatial and expression information
plotRankSpatvsExpr(
gobject,
combCC,
expr_rnk_column = "LR_expr_rnk",
spat_rnk_column = "LR_spat_rnk",
dot_color_gradient = NULL,
midpoint = deprecated(),
gradient_midpoint = 10,
gradient_style = c("divergent", "sequential"),
size_range = c(0.01, 1.5),
xlims = NULL,
ylims = NULL,
selected_ranks = c(1, 10, 20),
show_plot = NULL,
return_plot = NULL,
save_plot = NULL,
save_param = list(),
default_save_name = "plotRankSpatvsExpr"
)
giotto object
combined communication scores from combCCcom
column with expression rank information to use
column with spatial rank information to use
character. continuous colors to use. palette to use or vector of colors to use (minimum of 2).
deprecated
numeric. default = 10. midpoint of colors
either 'divergent' (midpoint is used in color scaling) or 'sequential' (scaled based on data range)
size ranges of dotplot
x-limits, numerical vector of 2
y-limits, numerical vector of 2
numerical vector, will be used to print out the percentage of top spatial ranks are recovered
logical. show plot
logical. return ggplot object
logical. save the plot
list of saving parameters, see showSaveParameters
default save name for saving, don't change, change save_name in save_param
ggplot
g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> cell_spatInfo_spatVector.shp
#> cell
#>
#> 3.2 read Giotto spatial centroid information
#> cell
#>
#> 3.3 read Giotto spatial overlap information
#> No overlaps were found, overlap loading will be
#> skipped
#>
#> 4. read Giotto image information
#> a giotto python environment was found
#> Using python path:
#> "/Users/yuanlab/Library/r-miniconda/envs/giotto_env/bin/pythonw"
exprCC <- exprCellCellcom(g, cluster_column = "leiden_clus",
feat_set_1 = "Gm19935", feat_set_2 = "9630013A20Rik")
spatialCC <- spatCellCellcom(gobject = g, cluster_column = "leiden_clus",
feat_set_1 = "Gm19935", feat_set_2 = "9630013A20Rik", verbose = "a lot",
random_iter = 10)
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10 <- Inf returned
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10
#> simulations: 1 2 3 4 5 6 7 8 9 10 <- Inf returned
#> Warning: no adjusted p.values that are not zero; returning Inf
#> Warning: no adjusted p.values that are not zero; returning Inf
combCC <- combCCcom(spatialCC = spatialCC, exprCC = exprCC)
plotRankSpatvsExpr(gobject = g, combCC = combCC)
#> for top 1 expression ranks, you recover 17.24 % of the highest spatial rankfor top 10 expression ranks, you recover 62.07 % of the highest spatial rankfor top 20 expression ranks, you recover 89.66 % of the highest spatial rank