Further subcluster cells using a NN-network and the Leiden algorithm
doLeidenSubCluster(
gobject,
feat_type = NULL,
name = "sub_pleiden_clus",
cluster_column = NULL,
selected_clusters = NULL,
hvf_param = list(reverse_log_scale = TRUE, difference_in_cov = 1, expression_values =
"normalized"),
hvg_param = NULL,
hvf_min_perc_cells = 5,
hvg_min_perc_cells = NULL,
hvf_mean_expr_det = 1,
hvg_mean_expr_det = NULL,
use_all_feats_as_hvf = FALSE,
use_all_genes_as_hvg = NULL,
min_nr_of_hvf = 5,
min_nr_of_hvg = NULL,
pca_param = list(expression_values = "normalized", scale_unit = TRUE),
nn_param = list(dimensions_to_use = 1:20),
k_neighbors = 10,
resolution = 0.5,
n_iterations = 500,
python_path = NULL,
nn_network_to_use = "sNN",
network_name = "sNN.pca",
return_gobject = TRUE,
verbose = TRUE
)
giotto object
feature type
name for new clustering result
cluster column to subcluster
only do subclustering on these clusters
parameters for calculateHVf
deprecatd, use hvf_param
threshold for detection in min percentage of cells
deprecated, use hvf_min_perc_cells
threshold for mean expression level in cells with detection
deprecated, use hvf_mean_expr_det
forces all features to be HVF and to be used as input for PCA
deprecated, use use_all_feats_as_hvf
minimum number of HVF, or all features will be used as input for PCA
deprecated, use min_nr_of_hvf
parameters for runPCA
parameters for parameters for createNearestNetwork
number of k for createNearestNetwork
resolution of Leiden clustering
number of interations to run the Leiden algorithm.
specify specific path to python if required
type of NN network to use (kNN vs sNN)
name of NN network to use
boolean: return giotto object (default = TRUE)
verbose
giotto object with new subclusters appended to cell metadata
This function performs subclustering using the Leiden algorithm on selected clusters. The systematic steps are:
1. subset Giotto object
2. identify highly variable fetures
3. run PCA
4. create nearest neighbouring network
5. do Leiden clustering
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"
doLeidenSubCluster(g, cluster_column = "leiden_clus")
#> start with cluster: 1
#> 43 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Warning: did not converge--results might be invalid!; try increasing work or maxit
#> start with cluster: 2
#> 43 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Warning: did not converge--results might be invalid!; try increasing work or maxit
#> start with cluster: 3
#> 42 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Warning: did not converge--results might be invalid!; try increasing work or maxit
#> start with cluster: 4
#> 35 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Warning: did not converge--results might be invalid!; try increasing work or maxit
#> start with cluster: 5
#> 44 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> Warning: did not converge--results might be invalid!; try increasing work or maxit
#> start with cluster: 6
#> 46 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> start with cluster: 7
#> 38 highly variable feats have been selected
#> Warning: ncp >= minimum dimension of x, will be set to
#> minimum dimension of x - 1
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.
#> An object of class giotto
#> >Active spat_unit: cell
#> >Active feat_type: rna
#> [SUBCELLULAR INFO]
#> polygons : cell
#> [AGGREGATE INFO]
#> expression -----------------------
#> [cell][rna] raw normalized scaled
#> spatial locations ----------------
#> [cell] raw
#> spatial networks -----------------
#> [cell] Delaunay_network spatial_network
#> spatial enrichments --------------
#> [cell][rna] cluster_metagene DWLS
#> dim reduction --------------------
#> [cell][rna] pca custom_pca umap custom_umap tsne
#> nearest neighbor networks --------
#> [cell][rna] sNN.pca custom_NN
#> attached images ------------------
#> images : alignment image
#>
#>
#> Use objHistory() to see steps and params used