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

The idea is that here is a bunch of the basics on using SQLite Nothing is some advanced course on doing joins and unions and trying to make your infinitely normalized schema work SQLite is simple. Very simple.
Pros: More...

Inheritance diagram for SQLiter.SQLite:

Public Types

enum  QueryTopGenesRankingMode { Mean, TTest }
 Different modes to sort genes. More...
 

Public Member Functions

void RunAsyncInit ()
 Example using the Loom to run an asynchronous method on another thread so SQLite lookups do not block the main Unity thread More...
 
void InitDatabase (string path)
 
IEnumerator ValidateDatabaseCoroutine ()
 Validates the database by making sure that the correct tabels exists. More...
 
void QueryTopGenes (QueryTopGenesRankingMode mode)
 Queries the database for all gene expressions and sorts them based on the difference in expression between two chosen groups. More...
 
void QueryMedianGeneExpressions (string[] genes)
 Queries the database for the median expressions of some genes. This fills the _result with Tuple<string, float> that each contain the median expression of a cell. More...
 
void QueryGene (string geneName, Action< SQLite > action)
 Query the database for a gene and set up a function to be called that reads the results More...
 
void QueryGene (string geneName, GraphManager.GeneExpressionColoringMethods coloringMethod)
 Queries the database for the expressions of a gene. More...
 
void ExecuteNonQuery (string commandText)
 Basic execute command - open, create command, execute, close More...
 

Public Attributes

bool DebugMode = false
 
bool _databaseOK = false
 
ReferenceManager referenceManager
 
ArrayList _result = new ArrayList()
 

Static Public Attributes

static SQLite Instance = null
 

Properties

bool QueryRunning [get]
 
float LowestExpression [get]
 
float HighestExpression [get]
 

Detailed Description

The idea is that here is a bunch of the basics on using SQLite Nothing is some advanced course on doing joins and unions and trying to make your infinitely normalized schema work SQLite is simple. Very simple.
Pros:

  • Very simple to use
  • Very small memory footprint

Cons:

  • It is a flat file database. You can change the settings to make it run completely in memory, which will make it even faster; however, you cannot have separate threads interact with it -ever-, so if you plan on using SQLite for any sort of multiplayer game and want different Unity instances to interact/read data... they absolutely cannot.
  • Doesn't offer as many bells and whistles as other DB systems
  • It is awfully slow. I mean dreadfully slow. I know "slow" is a relative term, but unless the DB is all in memory, every time you do a write/delete/update/replace, it has to write to a physical file - since SQLite is just a file based DB. If you ever do a write and then need to read it shortly after, like .5 to 1 second after... there's a chance it hasn't been updated yet... and this is local. So, just make sure you use a coroutine or whatever to make sure data is written before using it.

SQLite is nice for small games, high scores, simple saved, etc. It is not very secure and not very fast, but it's cheap, simple, and useful at times.

Here are some starting tools and information. Go explore.

Member Enumeration Documentation

◆ QueryTopGenesRankingMode

Different modes to sort genes.

Member Function Documentation

◆ ExecuteNonQuery()

void SQLiter.SQLite.ExecuteNonQuery ( string  commandText)

Basic execute command - open, create command, execute, close

Parameters
commandText

◆ QueryGene() [1/2]

void SQLiter.SQLite.QueryGene ( string  geneName,
Action< SQLite action 
)

Query the database for a gene and set up a function to be called that reads the results

Parameters
geneNameThe gene to query for
actionThe function to run when the results are ready

◆ QueryGene() [2/2]

void SQLiter.SQLite.QueryGene ( string  geneName,
GraphManager.GeneExpressionColoringMethods  coloringMethod 
)

Queries the database for the expressions of a gene.

Parameters
geneNameThe name of the gene
Returns
An array of all gene expression, ordered by cell

◆ QueryMedianGeneExpressions()

void SQLiter.SQLite.QueryMedianGeneExpressions ( string[]  genes)

Queries the database for the median expressions of some genes. This fills the _result with Tuple<string, float> that each contain the median expression of a cell.

Parameters
genesA list of genes to query for.

◆ QueryTopGenes()

void SQLiter.SQLite.QueryTopGenes ( QueryTopGenesRankingMode  mode)

Queries the database for all gene expressions and sorts them based on the difference in expression between two chosen groups.

Parameters
modeThe mode to sort the gene expressinos by.

◆ RunAsyncInit()

void SQLiter.SQLite.RunAsyncInit ( )

Example using the Loom to run an asynchronous method on another thread so SQLite lookups do not block the main Unity thread

◆ ValidateDatabaseCoroutine()

IEnumerator SQLiter.SQLite.ValidateDatabaseCoroutine ( )

Validates the database by making sure that the correct tabels exists.


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