Skip to main content

matrix market tar archive access utilities

Project description

ci-test

Introduction

mex_gene_archive is a minimal file format designed to meet the needs of archiving sparse gene matrices in a format compatible with the ENCODE 4 Data Coordination Center.

We had the requirement that a data type result needed to be a single file and unfortunately the common output format for alignment programs of the matrix market exchange use three files. One to store the coordinates and values of the non-zero sparse matrix elements, one for the row labels, and one for the column labels.

Usage

Reading an archive

The archive format is fairly simple and started with just archiving the key matrix market files from a STAR Solo.out directory, with a simple manifest.tsv file included to help tell different files apart.

Probably the more useful function is the one that will read an archive into an anndata structure with the gene features going across the columns and the cell barcode observations going down across the rows.

from mex_gene_archive.reader import read_mex_as_anndata

adata = read_mex_as_anndata("archive.tar.gz")

req = requests.get(
    "https://www.encodeproject.org/files/ENCFFexample/@@download/ENCFFexample.fastq.gz",
    stream=True)
adata = read_mex_as_anndata(fileobj=req.raw)

The reader module can also convert archives to anndata directly from the command line

python -m mex_gene_archive.reader -o archive.h5ad archive.tar.gz

python -m mex_gene_archive.reader -o archive.h5ad \
  --url https://www.encodeproject.org/files/ENCFFexample/@@download/ENCFFexample.fastq.gz

Generating an STAR archive

Possibly you might want to generate an archive file currently only STAR is directly supported. See archive_star_solo for the full list of arguments.

from mex_gene_archive.starsolo import archive_star_solo

config = {
   "experiment_accession": "ENCSR724KET",
   "description": "snRNA on human adrenal gland.",
   "library_accession": "ENCLB002DZK",
}
archive_star_solo("experiment", config)

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

mex_gene_archive-0.1.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

mex_gene_archive-0.1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file mex_gene_archive-0.1.tar.gz.

File metadata

  • Download URL: mex_gene_archive-0.1.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

File hashes

Hashes for mex_gene_archive-0.1.tar.gz
Algorithm Hash digest
SHA256 912c3d3074530568bac237e6cc9992889b4b6b6d15649cd54dca75f37f361b64
MD5 6b61ab654fb199caed2815827b7fa498
BLAKE2b-256 36f7a6cb7eb7e1c3c2aecc747c092ee418185e5ee8191e4c4a160e389cd8311d

See more details on using hashes here.

File details

Details for the file mex_gene_archive-0.1-py3-none-any.whl.

File metadata

  • Download URL: mex_gene_archive-0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

File hashes

Hashes for mex_gene_archive-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6573d1590255854756e7bfeb94878774daa8e41a28ea346c78c293b74621f22b
MD5 39410c87ee8da3164e0dd1352942f79e
BLAKE2b-256 2c44ca032bb09dd2e17fa1636d6ff19905f8d2a2d2b6eea814d096bbd4ef740f

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