gtfparse
Parsing library for extracting data frames of genomic features from GTF files
What it is and what it does
gtfparse is a lightweight parser for GTF files, the standard format for storing genomic feature annotations (genes, transcripts, exons, etc.) with their genomic coordinates and metadata. It reads GTF files directly into pandas, polars, or pyarrow DataFrames, automatically extracting the fixed columns (feature type, sequence name, start, end, strand) and any optional attributes defined in the file's ninth column. The library is designed for bioinformaticians who need to filter, analyze, or combine genomic annotations programmatically.
The package depends on pandas, polars, and pyarrow for data handling, and supports Python 3.9 through 3.12. It has been actively maintained since 2015, with a recent release and steady development. The examples in its documentation show typical workflows: filtering features by type or chromosome, and extracting expression values (like FPKM from StringTie output) into Python dictionaries for downstream analysis.
Use it for:
- Filter GTF annotations by feature type (gene, transcript, exon) and genomic location for targeted analysis.
- Extract gene expression values (FPKM, TPM) from StringTie or similar GTF output into a structured format.
- Combine or compare annotations from multiple GTF files by loading them into DataFrames and performing joins.
- Convert GTF attribute columns into typed Python objects using custom column converters for downstream computation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses GTF (gene transfer format) files into DataFrames, extracting genomic feature annotations with their coordinates, types, and attributes for bioinformatics analysis.
Yes. gtfparse is a focused, actively maintained tool for a specific bioinformatics task with low install friction and no security vulnerabilities. It is well-suited for anyone working with GTF files in Python, especially in genomics pipelines. The permissive Apache license and support for current Python versions make it a safe choice.
Install
gtfparse on PyPI
pip
pip install gtfparseuv
uv add gtfparsepoetry
poetry add gtfparseInstalling gtfparse
Before you install
Low install friction; pure Python wheel with three common data-processing dependencies (polars, pyarrow, pandas). Actively maintained with recent release and steady commit history.
License in practice
Licensed under Apache Software License (permissive), imposing no significant restrictions on use or redistribution.
Quickstart
pip install gtfparse
from gtfparse import read_gtf
df = read_gtf("gene_annotations.gtf")
df_genes = df[df["feature"] == "gene"]
Requires Python 3.9 or later.
Verify before relying
- Whether the package handles malformed or non-standard GTF files gracefully.
- Performance characteristics when parsing very large GTF files (millions of rows).
- Whether StringTie-specific attributes beyond FPKM are reliably parsed.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — polars, pyarrow, pandas |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,339/month — #14,849 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gtfparse-2.8.0-py3-none-any.whl
Tags
More Bio-Informatics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
biopythonBiopython provides Python tools for…
unclear · top 5,000 on PyPI
firecrawl-pyClient library for the Firecrawl API that…
permissive · top 5,000 on PyPI
intervaltreeA self-balancing interval tree data structure…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
PubChemPyPubChemPy is a Python wrapper around the…
permissive · top 5,000 on PyPI
gseapyPerforms gene set enrichment analysis (GSEA) on…
permissive · top 15,000 on PyPI
pyensemblPyEnsembl provides a Python interface to query…
permissive · top 15,000 on PyPI
varcodeVarcode loads and analyzes genomic variant…
permissive · top 15,000 on PyPI
gprofiler-officialPython interface to g:Profiler toolkit for…
permissive · top 5,000 on PyPI
pybedtoolsWraps the BEDTools suite to perform genomic…
permissive · top 15,000 on PyPI
mygeneMygene is a Python wrapper for the MyGene.Info…
permissive · top 5,000 on PyPI
pyrangesPyRanges provides efficient querying and…
permissive · top 15,000 on PyPI
gspread-dataframeConverts between Google Sheets worksheets and…
permissive · top 5,000 on PyPI
pandas-read-xmlConverts XML files into pandas DataFrames, with…
permissive · top 15,000 on PyPI
bioA command-line toolkit that simplifies common…
permissive · top 5,000 on PyPI