Skip to main content

BinToGene

Library to convert a cell-by-bin matrix to cell-by-gene, i.e., it replaces the promoter accessibility with a gene activiy score. This can be useful, for e.g., when one wishes to use existing gene expression tools to a sc-ATAC-seq cell-by-bin matrix.

The package uses a gencode file (v34) to determine start and end locations for protein coding genes. This interval is then extended by fixed or gene-length dependent values to get a new interval I=(start-v1, end+v2). Then the bins in the provided data matrix are searched to see if they intersect I. An efficient binary search implementation is used to determine the first and last bin for which such intersection is found. Then the values of the bins are added or averaged as specified by the user. The resulting vector is a count vector for the gene in consideration. Note, the counts here do not represent expression of the gene, but chromatin accessibility counts in the case of sc-ATAC-seq. In the end, these vectors are stacked to form a cell-by-gene matrix. Tools that are used for analyzing gene expression data can be useful in analyzing the cell-by-gene matrix formed this way.

Example

import numpy as np

x = np.random.randint(0, 2, (200, 4000)) # your cell by bin matrix

bin_names = ['chr1:0-1000', 'chr1:1001-2000', ...] # your list of bin names

btg = BinToGene()  # Use default interval extension parameters
counts, ids = btg.convert(x, bin_names, prefix='chr', delim1=':', delim2='-')

Example of a cell-by-gene matrix obtained via UMAP after running some basic preprocessing

Metadata

Release files for BinToGene 1.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BinToGene 1.23
File Size Uploaded
BinToGene-1.23.tar.gz 22.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for BinToGene 1.23
File Interpreter ABI Platform
BinToGene-1.23-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 44.7 MB

Release files / BinToGene-1.23.tar.gz

Download URL BinToGene-1.23.tar.gz
Size 22.3 MB
Tags Source
SHA-256 checksum
How to use checksums
da5b05d75b8577ca3f8e6a9b50a72087d8f1366f642df9abf8ea8633bae83d79
BLAKE2b-256 checksum
How to use checksums
2e0e36ea22512689cb8f4749d85a6d39af3e818cabf180af6fa81fddce0af81f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.5

Release files / BinToGene-1.23-py2.py3-none-any.whl

Download URL BinToGene-1.23-py2.py3-none-any.whl
Size 22.3 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
44e4354805c0ae27c9c534cfbdc92954b49c8cac90ab7920c7ebdff3cef53a89
BLAKE2b-256 checksum
How to use checksums
d455d727ac459a690ea996169984d3791ba021459cb69f7cd0303d886e5c3941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

1.23 This release

2 release files

1.22

2 release files

1.21

2 release files

1.20

2 release files

1.16

2 release files

1.15

2 release files

1.11

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page