Skip to contents

This function accepts a matrix, dataframe or a SingleCellExperiment object. For matrices and dataframes, it is assumed that markers are the columns and samples rows.

Usage

runFuseSOM(
  data,
  markers = NULL,
  numClusters = NULL,
  assay = NULL,
  clusterCol = "clusters",
  size = NULL,
  verbose = FALSE
)

Arguments

data

a matrix, dataframe, SingleCellExperiment or SpatialExperiment object.

markers

the markers of interest. If this is not provided, all columns will be used

numClusters

the number of clusters to be generated from the data

assay

the assay of interest if SingleCellExperiment object is used

clusterCol

the name of the column to store the clusters in

size

the size of the square grid. eg for a 10X10 grid, size = 10

verbose

should the generation of the Self Organising Map be printed

Value

A list containing the SOM model and the cluster labels if a dataframe or matrix is provided

A SingleCellExperiment object with labels in coldata, and SOM model in metadata if a SingleCellExperiment or SpatialExperiment object is provided

Author

Elijah WIllie ewil3501@uni.sydney.edu.au

Examples

data("risom_dat")
risomMarkers <- c(
  "CD45", "SMA", "CK7", "CK5", "VIM", "CD31", "PanKRT", "ECAD"
)
res <- runFuseSOM(
  risom_dat,
  markers = risomMarkers, numClusters = 23, size = 8
)
#> You have provided a dataset of class data.frame
#> Everything looks good. Now running the FuseSOM algorithm
#> Now Generating the Self Organizing Map Grid
#> You have provided a grid size of:64
#> Now Running the Self Organizing Map Model
#> Now Clustering the Prototypes
#> Now Mapping Clusters to the Original Data
#> The Prototypes have been Clustered and Mapped Successfully
#> The FuseSOM algorithm has completed successfully