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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| BinToGene-1.23.tar.gz | 22.3 MB | Without provenance | Details for BinToGene-1.23.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| BinToGene-1.23-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for BinToGene-1.23-py2.py3-none-any.whl |
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
|
Security for BinToGene 1.23
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.