gefpy.cgef_reader_cy

Provides access to the cgef_reader interface.

class cgef_reader_cy.CgefR(filepath)
get_expression_num(self)

Get the number of expression.

get_cell_num(self)

Get the number of cell.

get_gene_num(self)

Get the number of gene.

get_gene_names(self)

Get a list of gene names. The type of gene name is 32 chars.

get_cell_names(self)

Get an array of cell ids. Each cell id is (cell.x <<32 | cell.y)

get_cells(self)

Get cells, each cell include (id, x, y, offset, geneCount, expCount, dnbCount, area, cellTypeID, clusterID)

get_genes(self)

Get genes, each gene include(geneName, offset, cellCount, expCount, maxMIDcount)

get_cellid_and_count(self)

Get the count of each cell in each gene.

Returns

(cell_id, count)

get_geneid_and_count(self)

Get the count of each gene in each cell.

Returns

(gene_id, count)

get_cellborders(self)

Gets cell borders.

Returns

borders_list

get_filtered_data(self, region, genelist)

Get the filtered data from cgef by region or gene.

Parameters
  • region – rect region(minx,maxx,miny,maxy)

  • genelist – gene name list

  • uniq_cell is list that save all cell, each cell val (exp.x<<32 | exp.y).

  • gene_names is a list of gene names.

  • count is a list that save the midcnt of each expression.

  • cell_index is a list that save the cell idx of each expression.

  • gene_index is a list that records the gene serial number corresponding to each exp.

Returns

(uniq_cell, gene_names, count, cell_index, gene_index)