ExpressionMatrix

Expression Matrix is a wrapper for xarray.DataArray that provides serialization adapters to netCDF, loom, and AnnData to enable it to be used with single-cell analysis software packages such as scanpy (python) and seurat (R).

class starfish.core.expression_matrix.expression_matrix.ExpressionMatrix(data=<NA>, coords=None, dims=None, name=None, attrs=None, indexes=None, fastpath=False)[source]

Container for expression data extracted from an IntensityTable

An ExpressionMatrix is a 2-dimensional cells x genes array whose values are the number of spots observed for each gene observed by the experiment. In addition to the basic xarray methods, ExpressionMatrix implements:

Methods

save(filename)

save the ExpressionMatrix to netCDF

save_loom(filename)

save the ExpressionMatrix to loom for use in R or python

save_anndata(filename)

save the ExpressionMatrix to AnnData for use in Scanpy

load(filename)

load an ExpressionMatrix from netCDF

classmethod load(filename)[source]

load an ExpressionMatrix from Netcdf

Parameters
filenamestr

File to load

Returns
ExpressionMatrix
Return type

ExpressionMatrix

save(filename)[source]

Save an ExpressionMatrix as a Netcdf File

Parameters
filenamestr

Name of Netcdf file

Return type

None

save_anndata(filename)[source]

Save an ExpressionMatrix as an AnnData file

Parameters
filenamestr

Name of AnnData file

Return type

None

save_loom(filename)[source]

Save an ExpressionMatrix as a loom file

Parameters
filenamestr

Name of loom file

Return type

None