skillfed

gtfparse

Parsing library for extracting data frames of genomic features from GTF files

gtfparse v2.8.0 74.3K downloads/30d#14,849 on PyPI129
Permissive license Active released

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 gtfparse

uv

uv add gtfparse

poetry

poetry add gtfparse

Installing 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

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Bio-Informatics

Tags

gtf file parsergene transfer format readergenomic annotation parsergtf to dataframebioinformatics gtf parsing
bioinformaticsgenomicsgtf-parsing

More Bio-Informatics packages