run UMAP

runGiottoHarmony(
  gobject,
  spat_unit = NULL,
  feat_type = NULL,
  vars_use = "list_ID",
  do_pca = FALSE,
  expression_values = c("normalized", "scaled", "custom"),
  reduction = "cells",
  dim_reduction_to_use = "pca",
  dim_reduction_name = NULL,
  dimensions_to_use = 1:10,
  name = NULL,
  feats_to_use = NULL,
  set_seed = TRUE,
  seed_number = 1234,
  toplevel_params = 2,
  return_gobject = TRUE,
  verbose = NULL,
  ...
)

Arguments

gobject

giotto object

spat_unit

spatial unit

feat_type

feature type

vars_use

If meta_data is dataframe, this defines which variable(s) to remove (character vector).

do_pca

Whether to perform PCA on input matrix.

expression_values

expression values to use

reduction

reduction on cells or features

dim_reduction_to_use

use another dimension reduction set as input

dim_reduction_name

name of dimension reduction set to use

dimensions_to_use

number of dimensions to use as input

name

arbitrary name for Harmony run

feats_to_use

if dim_reduction_to_use = NULL, which feats to use

set_seed

use of seed

seed_number

seed number to use

toplevel_params

parameters to extract

return_gobject

boolean: return giotto object (default = TRUE)

verbose

be verbose

...

additional HarmonyMatrix parameters

Value

giotto object with updated Harmony dimension reduction

Details

This is a simple wrapper for the HarmonyMatrix function in the Harmony package doi:10.1038/s41592-019-0619-0 .

Examples

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"

runGiottoHarmony(g, vars_use = "leiden_clus")
#> using 'Harmony' to integrate different datasets. If used in
#>             published research, please cite:
#>   Korsunsky, I., Millard, N., Fan, J. et al.
#>     Fast, sensitive and accurate integration of single-cell data with Harmony.
#>     Nat Methods 16, 1289-1296 (2019).
#>     https://doi.org/10.1038/s41592-019-0619-0
#> Transposing data matrix
#> Initializing state using k-means centroids initialization
#> Harmony 1/10
#> Harmony 2/10
#> Harmony 3/10
#> Harmony 4/10
#> Harmony converged after 4 iterations
#> 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 harmony
#> nearest neighbor networks --------
#>   [cell][rna] sNN.pca custom_NN
#> attached images ------------------
#> images      : alignment image 
#> 
#> 
#> Use objHistory() to see steps and params used