CellexalVR  1.1.0
A virtual reality platform for the exploration and analysis of single-cell gene expression data
CellexalVR.AnalysisLogic.ScarfManager Class Reference

Class to handle the communication between the REST-ful scarf api and CellexalVR. The api is a flask app that gets http requests and sends back data in json format. The cellexal-scarf web api can be found here: https://github.com/sonejilab/scarf_for_cellexalvr/ More...

Inheritance diagram for CellexalVR.AnalysisLogic.ScarfManager:

Public Member Functions

void SetZarrLoc (string loc)
 
void LoadPreprocessedData (string label, string layoutKey="RNA_UMAP")
 
IEnumerator LoadPreprocessedDataCouroutine (string label, string layoutKey)
 Load data into CellexalVR that has been preprocessed in scarf. More...
 
void InitServer ()
 Initializes the flask app that runs the api. Start in a seperate thread. More...
 
IEnumerator GetDatasetsCoroutine ()
 Retrieves the scarf datasets in the data folder. More...
 
IEnumerator ConvertToZarrCoroutine (string dataLabel, string rawData)
 Convert h5 raw data to zarr format. More...
 
IEnumerator StageDataCoroutine (string dataLabel)
 Prepares the scarf object to work with. More...
 
IEnumerator MarkHVGSCoroutine (string topN, VisualElement running, VisualElement done)
 Calls the scarf backend function to marks highly variable genes in the staged data. More...
 
IEnumerator MakeNeighborhoodGraphCoroutine (string featureKey, VisualElement running, VisualElement done)
 Calls the scarf function to create a neighborhood graph. More...
 
IEnumerator RunClusteringCoroutine (string resolution, VisualElement running, VisualElement done)
 Calls the scarf function to do clustering. Requires the neighborhood graph to be made. More...
 
IEnumerator RunUMAPCoroutine (string nEpochs, VisualElement running, VisualElement done)
 Calls the scarf function to create a umap. Requires the neighborhood graph to be made. More...
 
IEnumerator GetFeatureNames ()
 Calls the scarf function to retrieve the feature names present in the dataset. This can be gene names or other features. More...
 
IEnumerator GetCellValues (string valueKey)
 Retrieves the cell values for a specific feature key. This can be a gene or some other feature present in your dataset. More...
 
IEnumerator ColorByClusters (string clusterName)
 Retrieves the cell values for the clustering and then colors the graphs accordingly. More...
 
IEnumerator ColorByGene (string geneName)
 Retrieves the cell values for the given gene or other feature and then colors the graphs accordingly. More...
 
IEnumerator RunMarkerSearch (string groupKey, float threshold)
 Find marker genes in the dataset. More...
 
IEnumerator GetMarkers (string groupKey)
 Retrieves the marker genes. Requires RunMarkerSearch to have been run or have been marked in the dataset in pre-processing. More...
 
void CloseServer ()
 
void LoadData (string dataset, string key)
 Load the dataset into CellexalVR which creates the graph object. More...
 

Public Attributes

string[] datasets
 
string[] geneNames
 
string[] markers
 
float[] cellValues
 
bool scarfActive
 
bool reqPending
 
string[] consoleLines = new string[5] { "\n", "\n ", "\n ", "\n ", "\n " }
 

Static Public Attributes

static ScarfManager instance
 
static StringBuilder procOutput = null
 
static StringBuilder procOutput2 = null
 

Detailed Description

Class to handle the communication between the REST-ful scarf api and CellexalVR. The api is a flask app that gets http requests and sends back data in json format. The cellexal-scarf web api can be found here: https://github.com/sonejilab/scarf_for_cellexalvr/

Member Function Documentation

◆ ColorByClusters()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.ColorByClusters ( string  clusterName)

Retrieves the cell values for the clustering and then colors the graphs accordingly.

Parameters
clusterNameThe name of the clustering label e.g. RNA_leiden_cluster.
Returns

◆ ColorByGene()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.ColorByGene ( string  geneName)

Retrieves the cell values for the given gene or other feature and then colors the graphs accordingly.

Parameters
geneNameThe name of the gene or feature to color by.
Returns

◆ ConvertToZarrCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.ConvertToZarrCoroutine ( string  dataLabel,
string  rawData 
)

Convert h5 raw data to zarr format.

Parameters
dataLabelWhat you want to call the resulting data folder.
rawDataThe name of the raw data file.
Returns

◆ GetCellValues()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.GetCellValues ( string  valueKey)

Retrieves the cell values for a specific feature key. This can be a gene or some other feature present in your dataset.

Parameters
valueKeyThe name of the feature.
Returns

◆ GetDatasetsCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.GetDatasetsCoroutine ( )

Retrieves the scarf datasets in the data folder.

Returns

◆ GetFeatureNames()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.GetFeatureNames ( )

Calls the scarf function to retrieve the feature names present in the dataset. This can be gene names or other features.

Returns

◆ GetMarkers()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.GetMarkers ( string  groupKey)

Retrieves the marker genes. Requires RunMarkerSearch to have been run or have been marked in the dataset in pre-processing.

Parameters
groupKeyThe key used to separate the cells into groups. For example RNA_leiden clusters.
Returns

◆ InitServer()

void CellexalVR.AnalysisLogic.ScarfManager.InitServer ( )

Initializes the flask app that runs the api. Start in a seperate thread.

◆ LoadData()

void CellexalVR.AnalysisLogic.ScarfManager.LoadData ( string  dataset,
string  key 
)

Load the dataset into CellexalVR which creates the graph object.

Parameters
dataset
key

◆ LoadPreprocessedDataCouroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.LoadPreprocessedDataCouroutine ( string  label,
string  layoutKey 
)

Load data into CellexalVR that has been preprocessed in scarf.

Parameters
labelName of the dataset folder.
layoutKeyName of the value you wish to plot. For example if you have made a umap based on RNA data it is usually called RNA_UMAP. Or whatever else you have named it when pre-processing the data.
Returns

◆ MakeNeighborhoodGraphCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.MakeNeighborhoodGraphCoroutine ( string  featureKey,
VisualElement  running,
VisualElement  done 
)

Calls the scarf function to create a neighborhood graph.

Parameters
featureKeyThe feature key in the scarf object to use to create the graph. E.g. hvgs (if you have marked hvgs that is.)
runningFor the user interface icons animation.
doneFor the user interface icons animation.
Returns

◆ MarkHVGSCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.MarkHVGSCoroutine ( string  topN,
VisualElement  running,
VisualElement  done 
)

Calls the scarf backend function to marks highly variable genes in the staged data.

Parameters
topNNumber of genes.
runningFor the user interface icons animation.
doneFor the user interface icons animation.
Returns

◆ RunClusteringCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.RunClusteringCoroutine ( string  resolution,
VisualElement  running,
VisualElement  done 
)

Calls the scarf function to do clustering. Requires the neighborhood graph to be made.

Parameters
resolutionResolution of clustering. Corresponding to the argument with the same name in the scarf clustering function.
runningFor the user interface icons animation.
doneFor the user interface icons animation.
Returns

◆ RunMarkerSearch()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.RunMarkerSearch ( string  groupKey,
float  threshold 
)

Find marker genes in the dataset.

Parameters
groupKeyThe key used to separate the cells into groups. For example RNA_leiden clusters.
thresholdThreshold to use for a gene correlation.
Returns

◆ RunUMAPCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.RunUMAPCoroutine ( string  nEpochs,
VisualElement  running,
VisualElement  done 
)

Calls the scarf function to create a umap. Requires the neighborhood graph to be made.

Parameters
nEpochsNumber of epochs to run.
runningFor the user interface icons animation.
doneFor the user interface icons animation.
Returns

◆ StageDataCoroutine()

IEnumerator CellexalVR.AnalysisLogic.ScarfManager.StageDataCoroutine ( string  dataLabel)

Prepares the scarf object to work with.

Parameters
dataLabel
Returns

The documentation for this class was generated from the following file: