Gem

Constructor

Gem(*args, **kwargs)

A Gem object is a pandas.DataFrame with adapted method for stereo-seq GEM file.

Attributes

Gem.img_shape

the shape of representative image.

Gem.center

Center of the object in both axis coordinate and data coordinate (axis_x, axis_y, data_x, data_y)

Reading

Gem.readin(gem[, drop0])

Alternate constructor to create a Gem from a file.

Reshaping / selection

Gem.roi([x, y, width, height, inplace, outfile])

Subset the gem object with specified coordinate, width and height

Gem.mask(matrix[, outfile, label_object, ...])

Subset the gem object with a numpy array mask

Gem.relocation([x, y, canvas, width, ...])

Re-locate the object coordinates with

Gem.rearrange(batch[, order, rotation, ...])

Auto rearrange the location for batch gem

Computations / descriptive stats

Gem.stat([genes, batch, bycell, outfile])

Compute some basic statistic for the object

Grouping

Gem.binning([bin_size, batch, inplace, ...])

Group gem into square bins with fixed width and height.

Conversion / IO

Gem.to_img([on, bin_size, outfile, ...])

Convert gem into image using nCount or nFeature as pixel value.

Gem.to_matrix([bin_size, outfile])

convert the tabular structure to sparse matrix.

Gem.to_anndata([bin_size, cell_loc, batch])

Convert the binning or cell labeling object to anndata

Plotting

Gem.plot([color, cmap, category, ncols, ps, ...])

Plot the object in spatial coordinate