run tSNE

runtSNE(
  gobject,
  spat_unit = NULL,
  feat_type = NULL,
  expression_values = c("normalized", "scaled", "custom"),
  reduction = c("cells", "feats"),
  dim_reduction_to_use = "pca",
  dim_reduction_name = NULL,
  dimensions_to_use = 1:10,
  name = NULL,
  feats_to_use = NULL,
  return_gobject = TRUE,
  dims = 2,
  perplexity = 30,
  theta = 0.5,
  do_PCA_first = FALSE,
  set_seed = TRUE,
  seed_number = 1234,
  verbose = TRUE,
  ...
)

Arguments

gobject

giotto object

spat_unit

spatial unit

feat_type

feature type

expression_values

expression values to use

reduction

cells or feats

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 tSNE run

feats_to_use

if dim_reduction_to_use = NULL, which features to use

return_gobject

boolean: return giotto object (default = TRUE)

dims

tSNE param: number of dimensions to return

perplexity

tSNE param: perplexity

theta

tSNE param: theta

do_PCA_first

tSNE param: do PCA before tSNE (default = FALSE)

set_seed

use of seed

seed_number

seed number to use

verbose

verbosity of the function

...

additional tSNE parameters

Value

giotto object with updated tSNE dimension recuction

Details

See Rtsne for more information about these and other parameters.

  • Input for tSNE dimension reduction can be another dimension reduction (default = 'pca')

  • To use gene expression as input set dim_reduction_to_use = NULL

  • If dim_reduction_to_use = NULL, feats_to_use can be used to select a column name of highly variable genes (see calculateHVF) or simply provide a vector of genes

  • multiple tSNE results can be stored by changing the name of the analysis

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"

runtSNE(g)
#> tsne  has already been used, will be overwritten
#> > tsne already exists and will be replaced with
#>  new dimension reduction object
#> 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