Skip to main content

Fast Cython-backed parsing for GTF attribute columns.

Project description

gtfreader

gtfreader is a small package for parsing and reading GTF files into pandas dataframes.

Install

python -m pip install -e .

Usage

from gtfreader import read_gtf, read_gtf_python

df = read_gtf("annotation.gtf")
df_python = read_gtf_python("annotation.gtf")

read_gtf(...) uses the compiled parser path when available. read_gtf_python(...) uses the high-level pure Python parser path used by the current pyrunges reader style.

If you want to use the compiled low-level parser directly, pass it raw attribute strings from column 9 of the GTF before they have been expanded:

import pandas as pd

from gtfreader import find_first_data_line_index, parse_chunk_columns

skiprows = find_first_data_line_index("annotation.gtf")
attribute_lines = pd.read_csv(
    "annotation.gtf",
    sep="\t",
    header=None,
    usecols=[8],
    names=["Attribute"],
    skiprows=skiprows,
)["Attribute"].tolist()

compiled_columns = parse_chunk_columns(attribute_lines)

Build

python -m build

Test

python -m pytest -q

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

gtfreader-0.1.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gtfreader-0.1.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (247.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gtfreader-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (248.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gtfreader-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (213.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gtfreader-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (189.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

gtfreader-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file gtfreader-0.1.1.tar.gz.

File metadata

  • Download URL: gtfreader-0.1.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gtfreader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 53f39086b21013b811d9e386fc90cf4649547eebdb00568f5be215d48843ae6e
MD5 1364b395fbe49fa3ada5a61e0c912644
BLAKE2b-256 ddc0a3917c1a635dfa11975dc4cc75b10f9349de4079710d09ad81fed3429d8b

See more details on using hashes here.

File details

Details for the file gtfreader-0.1.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtfreader-0.1.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d48669173412331b6b5f9f1d1042d9f159f696995c618e4f4eeb705cd66686a
MD5 823d5d616781e0e6edcd0d9622592393
BLAKE2b-256 515d21c666bd75db677d613e9a5cd1accac2ce1e104d7a83aa52cff7bd71d920

See more details on using hashes here.

File details

Details for the file gtfreader-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtfreader-0.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 28cea9a68eaa5a34389c76858fb8a90ffbc091f9ff276f953f97753bfcb849b5
MD5 89d026fe998b4d16b1c68fc150961d3a
BLAKE2b-256 6172a970617b86b9f74f2b6413ec22d11c115ce37821b3b2d01123e21e4ea34d

See more details on using hashes here.

File details

Details for the file gtfreader-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtfreader-0.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f21f0488dd1d69ced4df2d5a5b08362a72335baeb7eef201f64c96a0ad2f4d87
MD5 3fc8b6c880b82b237d656797c7d35e3d
BLAKE2b-256 a26f390dde721e545b25224954005fdae06e5c6780f8249c5a94ef6f08f01a57

See more details on using hashes here.

File details

Details for the file gtfreader-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtfreader-0.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e234a4687e04fb66394f2d9930b48e71a5d92ccf5fa6c068f0cf324e736de822
MD5 c212cbf0c7afe4605b1586344d2e5a2e
BLAKE2b-256 933a6a8dc9863fffba17ead4fb950d9878cf0b78d938f97a33be36381b2a7b2b

See more details on using hashes here.

File details

Details for the file gtfreader-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gtfreader-0.1.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b02b7f70269a2f55ed614e67caa31537d104fb186b571601415773849abe63a2
MD5 bae5b4fab12d634ad70b8e8b201016b1
BLAKE2b-256 7542f3063e17c0a46b5525a7a239a15d6ef17a6d8925e2728661497d7eb5ce67

See more details on using hashes here.

Supported by

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