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

A confirmed selection of Graph.GraphPoint. Selections are created through the SelectionManager and once done, an object of this class is created. More...

Inheritance diagram for CellexalVR.AnalysisLogic.Selection:

Public Member Functions

 Selection ()
 Creates a new empty selection. More...
 
 Selection (IEnumerable< Graph.GraphPoint > points)
 Creates a new selection from a collection of selected points. More...
 
 Selection (string selectionFilePath)
 Creates a new selection from a previous selection that was saved to the disk. More...
 
IEnumerator< Graph.GraphPointGetEnumerator ()
 
override string ToString ()
 
void SetPoints (IEnumerable< Graph.GraphPoint > points, bool copyIfList=false, bool saveToDisk=true)
 Sets this selections points. This overwrites any Graph.GraphPoint that were saved to this selection before. More...
 
bool AssertDirectory (bool deleteContents)
 Asserts that a suitable directory exists, this function will create a directory if needed. Directory name is based off this selection's id. More...
 
void LoadGroupMasksFromDisk ()
 Attempts to load group masks that have been saved with SaveGroupMasksToDisk(Graph). More...
 
void UpdateGroupMasks ()
 Updates all group masks to match the current required offset. More...
 
void UnloadSelection ()
 Unloads this selection, freeing some memory. More...
 
void SaveSelectionToDisk ()
 Saves this selection to the disk. More...
 
void SaveGroupMasksToDisk (Graph graphToSave=null)
 Saves the group masks to the disk. This is automatically done by the constructor or when points are assigned with SetPoints(IEnumerable<Graph.GraphPoint>, bool, bool). Calling this manually afterwards will update the group masks with the graph points current groups and overwrite the previously saved masks. More...
 

Public Attributes

string savedSelectionDirectory
 
string savedSelectionFilePath
 
string savedSelectionMetaPath
 
readonly int id
 
int size
 
readonly List< int > groups
 
readonly List< Color > colors
 
readonly Dictionary< int, int > groupSizes
 
bool pointsLoaded
 
Dictionary<(Graph graph, int group), Texture2D > groupMasks = new()
 
Dictionary< Graph, Texture2D > allGroupsCombinedMask = new()
 

Static Public Attributes

static string parentSelectionDirectory
 

Properties

List< Graph.GraphPointPoints [get]
 The points that this selection includes, in the order they were selected. Do not modify the contents of this list directly without calling SetPoints(IEnumerable<Graph.GraphPoint>, bool, bool) afterwards. More...
 
Graph.GraphPoint this[int index] [get, set]
 Indexer definition. More...
 

Detailed Description

A confirmed selection of Graph.GraphPoint. Selections are created through the SelectionManager and once done, an object of this class is created.

Constructor & Destructor Documentation

◆ Selection() [1/3]

CellexalVR.AnalysisLogic.Selection.Selection ( )

Creates a new empty selection.

◆ Selection() [2/3]

CellexalVR.AnalysisLogic.Selection.Selection ( IEnumerable< Graph.GraphPoint points)

Creates a new selection from a collection of selected points.

Parameters
pointsThe collection to of points this selection should include.

◆ Selection() [3/3]

CellexalVR.AnalysisLogic.Selection.Selection ( string  selectionFilePath)

Creates a new selection from a previous selection that was saved to the disk.

Parameters
selectionFilePathThe path to the saved selection.

Member Function Documentation

◆ AssertDirectory()

bool CellexalVR.AnalysisLogic.Selection.AssertDirectory ( bool  deleteContents)

Asserts that a suitable directory exists, this function will create a directory if needed. Directory name is based off this selection's id.

Parameters
deleteContentsDeletes all content in the directory this selection should use
Returns
False if a directory exists, but deleteContents is false. True otherwise. This makes the function usable for loops when looking for a suitable directory.

◆ LoadGroupMasksFromDisk()

void CellexalVR.AnalysisLogic.Selection.LoadGroupMasksFromDisk ( )

Attempts to load group masks that have been saved with SaveGroupMasksToDisk(Graph).

◆ SaveGroupMasksToDisk()

void CellexalVR.AnalysisLogic.Selection.SaveGroupMasksToDisk ( Graph  graphToSave = null)

Saves the group masks to the disk. This is automatically done by the constructor or when points are assigned with SetPoints(IEnumerable<Graph.GraphPoint>, bool, bool). Calling this manually afterwards will update the group masks with the graph points current groups and overwrite the previously saved masks.

Parameters
graphToSaveOptional. If left out, all graphs that are currently loaded will be saved, otherwise, only the graph passed in this argument is saved.

◆ SaveSelectionToDisk()

void CellexalVR.AnalysisLogic.Selection.SaveSelectionToDisk ( )

Saves this selection to the disk.

◆ SetPoints()

void CellexalVR.AnalysisLogic.Selection.SetPoints ( IEnumerable< Graph.GraphPoint points,
bool  copyIfList = false,
bool  saveToDisk = true 
)

Sets this selections points. This overwrites any Graph.GraphPoint that were saved to this selection before.

Parameters
pointsThe points that should be set to this selection.
copyIfListOptional. If points is a List<Graph.GraphPoint> and this argument is set to false, this Selection will use the reference to the List<Graph.GraphPoint>. If set to true, the contents will be copied to a new List<Graph.GraphPoint>
saveToDiskOptional. True if the selection should also be saved to the disk (default behaviour). False otherwise. Setting this to false can be useful if this selection is being loaded from the disk and the files are already generated.

If points is a List<Graph.GraphPoint> and copyIfList is set to false, this function will use the reference to the List<Graph.GraphPoint> that was passed. Otherwise, the contents will be copied to a new List<Graph.GraphPoint>. Not copying the List<Graph.GraphPoint> increases performance considerably when the List<Graph.GraphPoint> that is passed with points is not needed in the calling function after this.

◆ UnloadSelection()

void CellexalVR.AnalysisLogic.Selection.UnloadSelection ( )

Unloads this selection, freeing some memory.

◆ UpdateGroupMasks()

void CellexalVR.AnalysisLogic.Selection.UpdateGroupMasks ( )

Updates all group masks to match the current required offset.

Property Documentation

◆ Points

List<Graph.GraphPoint> CellexalVR.AnalysisLogic.Selection.Points
get

The points that this selection includes, in the order they were selected. Do not modify the contents of this list directly without calling SetPoints(IEnumerable<Graph.GraphPoint>, bool, bool) afterwards.

◆ this[int index]

Graph.GraphPoint CellexalVR.AnalysisLogic.Selection.this[int index]
getset

Indexer definition.

Parameters
index
Returns

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