cluster cells using leiden methodology to visualize different resolutions
doGiottoClustree(
gobject,
res_vector = NULL,
res_seq = NULL,
return_gobject = FALSE,
show_plot = NULL,
save_plot = NULL,
return_plot = NULL,
save_param = list(),
default_save_name = "clustree",
verbose = TRUE,
...
)giotto object
vector of different resolutions to test
list of float numbers indicating start, end, and step size for resolution testing, i.e. (0.1, 0.6, 0.1)
default FALSE. See details for more info.
by default, pulls from provided gobject instructions
by default, pulls from provided gobject instructions
by default, pulls from provided gobject instructions
list of saving parameters from
GiottoVisuals::all_plots_save_function()
name of saved plot, default "clustree"
be verbose
Arguments passed on to clustree::clustree
prefixstring indicating columns containing clustering information
suffixstring at the end of column names containing clustering information
metadatadata.frame containing metadata on each sample that can be used as node aesthetics
count_filtercount threshold for filtering edges in the clustering graph
prop_filterin proportion threshold for filtering edges in the clustering graph
layoutstring specifying the "tree" or "sugiyama" layout, see
igraph::layout_as_tree() and igraph::layout_with_sugiyama() for details
use_core_edgeslogical, whether to only use core tree (edges with maximum in proportion for a node) when creating the graph layout, all (unfiltered) edges will still be displayed
highlight_corelogical, whether to increase the edge width of the core network to make it easier to see
node_coloureither a value indicating a colour to use for all nodes or the name of a metadata column to colour nodes by
node_colour_aggrif node_colour is a column name than a string
giving the name of a function to aggregate that column for samples in each
cluster
node_sizeeither a numeric value giving the size of all nodes or the name of a metadata column to use for node sizes
node_size_aggrif node_size is a column name than a string
giving the name of a function to aggregate that column for samples in each
cluster
node_size_rangenumeric vector of length two giving the maximum and minimum point size for plotting nodes
node_alphaeither a numeric value giving the alpha of all nodes or the name of a metadata column to use for node transparency
node_alpha_aggrif node_aggr is a column name than a string
giving the name of a function to aggregate that column for samples in each
cluster
node_text_sizenumeric value giving the size of node text if
scale_node_text is FALSE
scale_node_textlogical indicating whether to scale node text along with the node size
node_text_colourcolour value for node text (and label)
node_text_anglethe rotation of the node text
node_labeladditional label to add to nodes
node_label_aggrif node_label is a column name than a string
giving the name of a function to aggregate that column for samples in each
cluster
node_label_sizenumeric value giving the size of node label text
node_label_nudgenumeric value giving nudge in y direction for node labels
edge_widthnumeric value giving the width of plotted edges
edge_arrowlogical indicating whether to add an arrow to edges
edge_arrow_endsstring indicating which ends of the line to draw arrow
heads if edge_arrow is TRUE, one of "last", "first", or "both"
show_axiswhether to show resolution axis
returnstring specifying what to return, either "plot" (a ggplot
object), "graph" (a tbl_graph object) or "layout" (a ggraph layout
object)
exprssource of gene expression information to use as node aesthetics,
for SingleCellExperiment objects it must be a name in assayNames(x), for
a seurat object it must be one of data, raw.data or scale.data and
for a Seurat object it must be one of data, counts or scale.data
assayname of assay to pull expression and clustering data from for
Seurat objects
a plot object (default), OR a giotto object (if specified)
This function tests different resolutions for Leiden clustering and provides a visualization of cluster sizing as resolution varies.
By default, the tested leiden clusters are NOT saved to the Giotto object, and a plot is returned.
If return_gobject is set to TRUE, and a giotto object with all tested leiden cluster information will be returned.
g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 4. read Giotto image information
#> python already initialized in this session
#> active environment : '/usr/bin/python3'
#> python version : 3.12
doGiottoClustree(
gobject = g, res_vector = c(0.5, 0.8), return_plot = FALSE,
show_plot = FALSE, save_plot = FALSE
)
#> Error: package 'clustree' is not yet installed
#>
#> To install:
#> install.packages(c("clustree"))