Skip to main content

Genomap converts tabular gene expression data into spatially meaningful images.

Project description

Genomap creates images from gene expression data

Genomap is an entropy-based cartography strategy to contrive the high dimensional gene expression data into a configured image format with explicit integration of the genomic interactions. This unique cartography casts the gene-gene interactions into a spatial configuration and enables us to extract the deep genomic interaction features and discover underlying discriminative patterns of the data. For a wide variety of applications (cell clustering and recognition, gene signature extraction, single-cell data integration, cellular trajectory analysis, dimensionality reduction, and visualization), genomap drastically improves the accuracy of data analyses as compared to state-of-the-art techniques.

Required packages

scipy, scikit-learn, pot, numpy

If you face any issues with packages, please check the environment section of our Code-Ocean capsule (https://doi.org/10.24433/CO.0640398.v1), where you can check the package versions.

How to use genomap

The easiest way to start with genomap is to install it from pypi using

pip install genomap

The data should be in cell (row) x gene (column) format. Genomap construction needs only one parameter: the size of the genomap (row and column number). The row and column number can be any number starting from 1. You can create square or rectangular genomaps. The number of genes in your dataset should be less than or equal to the number of pixels in the genomap. Genomap construction is very fast and you should get the genomaps within a few seconds.

Sample data

To run the example codes below, you will need to download data files from here.

Example codes

Example 1 - Construct a genomap

import pandas as pd # Please install pandas and matplotlib before you run this example
import matplotlib.pyplot as plt
import scipy
import genomap as gp

data = pd.read_csv('TM_data.csv', header=None, delim_whitespace=False)
colNum=31 # Column number of genomap
rowNum=31 # Row number of genomap

dataNorm=scipy.stats.zscore(data,axis=0,ddof=1) # Normalization of the data

genoMaps=gp.construct_genomap(dataNorm,rowNum,colNum) # Construction of genomaps

findI=genoMaps[0,:,:,:]

plt.figure(1) # Plot the first genomap
plt.imshow(findI, origin = 'lower', extent = [0, 10, 0, 10], aspect = 1)
plt.title('Genomap of a cell from TM dataset')

Example 2 - Try out genoVis, genoTraj and genoMOI

import scipy.io as sio
import numpy as np
from genomap.genoVis import compute_genoVis
from genomap.genoTraj import compute_genoTraj
from genomap.genoMOI import compute_genoMOI

dx = sio.loadmat('reducedData_divseq.mat')
data=dx['X']
gt_data = sio.loadmat('GT_divseq.mat')
y = np.squeeze(gt_data['GT'])
n_clusters = len(np.unique(y))


resVis=compute_genoVis(data,n_clusters=n_clusters, colNum=33,rowNum=33)

dx = sio.loadmat('organoidData.mat')
data=dx['X3']
gt_data = sio.loadmat('cellsPsudo.mat')
Y_time = np.squeeze(gt_data['newGT'])


outGenoTraj=compute_genoTraj(data)

dx = sio.loadmat('dataBaronX.mat')
data=dx['dataBaron']
dx = sio.loadmat('dataMuraroX.mat')
data2=dx['dataMuraro']
dx = sio.loadmat('dataScapleX.mat')
data3=dx['dataScaple']
dx = sio.loadmat('dataWangX.mat')
data4=dx['dataWang']
dx = sio.loadmat('dataXinX.mat')
data5=dx['dataXin']

resVis=compute_genoMOI(data, data2, data3, data4, data5, colNum=44, rowNum=44)

Citation

If you use the genomap code, please cite our Nature Communications paper: https://www.nature.com/articles/s41467-023-36383-6

Islam, M.T., Xing, L. Cartography of Genomic Interactions Enables Deep Analysis of Single-Cell Expression Data. Nat Commun 14, 679 (2023). https://doi.org/10.1038/s41467-023-36383-6

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genomap-1.1.1.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

genomap-1.1.1-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file genomap-1.1.1.tar.gz.

File metadata

  • Download URL: genomap-1.1.1.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for genomap-1.1.1.tar.gz
Algorithm Hash digest
SHA256 38706ea17fbdd93acfd8cb13c82dfc65b502ffb11c33adb0398859870f2fd18c
MD5 a806ca22d007d3e7b0b2d63ab455a07c
BLAKE2b-256 19432c005f91ed808b75d01ee560943226787e8d8bb1b2e31b11b1e2dc5b7bd9

See more details on using hashes here.

File details

Details for the file genomap-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: genomap-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 49.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for genomap-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 334d20827aec12496ea29c1b7b334956a5110866cbfce6420025df7ed2efea8b
MD5 741a850860095a2e30cd4126ecdba4af
BLAKE2b-256 4d32bcdadbae0646f2617e9d3a2b9bc932e96990b5ec1acec90e1249a809399e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page