gcell.cell.celltype.Celltype.gene_by_motif#
- property Celltype.gene_by_motif[source]#
This method retrieves gene data by motif. It first checks if a zarr file exists for the cell type. If it does, it opens the zarr file and checks if ‘gene_by_motif’ is in the keys of the zarr data. If ‘gene_by_motif’ is found, it loads the data into a pandas DataFrame. If not, it computes the jacobian for each gene and saves it to the zarr file.
If a zarr file does not exist, it checks if a feather file exists. If it does, it loads the data into a pandas DataFrame. If not, it computes the jacobian for each gene and saves it to a feather file.
Finally, if the gene_by_motif data is a pandas DataFrame, it is converted to a GeneByMotif object. If a zarr file exists, it checks if ‘gene_by_motif_corr’ is in the keys of the zarr data. If it is, it loads the correlation data into the GeneByMotif object. If not, it computes the correlation and saves it to the zarr file.