Skip to content

Fix #177: push biotype filter into SQL for genes() / transcripts()#344

Merged
iskandr merged 1 commit into
mainfrom
fix-177-biotype-kwarg
May 12, 2026
Merged

Fix #177: push biotype filter into SQL for genes() / transcripts()#344
iskandr merged 1 commit into
mainfrom
fix-177-biotype-kwarg

Conversation

@iskandr

@iskandr iskandr commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Genome.genes(), Genome.transcripts(), gene_ids(), transcript_ids(), and the underlying Database.query_feature_values() now accept a biotype= kwarg that is pushed into the SQL query against the {feature}_biotype column.
  • Filtering by biotype on a feature whose biotype column doesn't exist (e.g. exons) raises ValueError instead of silently returning everything.
  • Combines with the existing contig / strand filters.

Closes #177.

Test plan

  • tests/test_biotype_filter.py covers transcripts/genes filtered by biotype, combined contig+strand+biotype, empty-result biotype, and the no-biotype-column error path
  • pytest tests/test_biotype_filter.py tests/test_mouse.py tests/test_tair10_complete.py tests/test_versions.py tests/test_serialization.py (41 passed locally)
  • ./lint.sh
  • CI on PR

Bumps version to 2.9.1.

Genome.genes(), Genome.transcripts(), gene_ids(), transcript_ids(), and
the underlying Database.query_feature_values() now take an optional
biotype= kwarg that filters on the matching {feature}_biotype column
inside the SQL query, avoiding a Python-side scan over every feature.

Filtering by biotype on a feature whose biotype column doesn't exist
(e.g. exons) raises ValueError rather than silently returning all rows.

Bump version to 2.9.1.
@iskandr iskandr merged commit b28e207 into main May 12, 2026
10 checks passed
@iskandr iskandr deleted the fix-177-biotype-kwarg branch May 12, 2026 21:52
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 84.599% (+0.2%) from 84.385% — fix-177-biotype-kwarg into main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add biotype argument to transcripts()

2 participants