• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openvax / gtfparse / 28965619839
96%
master: 96%

Build:
Build:
LAST BUILD BRANCH: feature/21-write-gtf
DEFAULT BRANCH: master
Ran 08 Jul 2026 06:19PM UTC
Jobs 1
Files 6
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Jul 2026 06:18PM UTC coverage: 95.703% (+0.5%) from 95.215%
28965619839

Pull #72

github

iskandr
Add write_gtf: serialize a DataFrame back to GTF (fixes #21)

Adds the inverse of read_gtf. A DataFrame produced by read_gtf -- whether
the attribute column was expanded into per-key columns or left as a raw
'attribute' string -- can be written back out and re-read to recover an
equivalent DataFrame.

This builds on the approach in #46 by Benoitdw, with fixes:

- Python 3.9 compatibility: use typing.Union / typing.Optional instead of
  the `str | Path` union syntax, which requires Python 3.10+ (the project
  targets >=3.9).
- No silent data loss: attribute values are omitted only when None (the
  way read_gtf represents an absent key), not when merely falsy. Values
  like 0 or the empty string are now written and survive a round trip.
- Missing values in the fixed columns are serialized as '.', and null
  scores/frames round-trip correctly.
- The attribute field ends with a trailing ';', matching the canonical
  GTF format emitted by Ensembl/GENCODE and re-parsed by read_gtf.
- A column literally named 'attribute' (unexpanded read) is emitted
  verbatim, so expand_attribute_column=False round-trips too.
- Accepts a pandas DataFrame as well as polars (result_type="pandas").
- Raises ValueError if any required fixed column is missing.

Tests cover round trips for RefSeq and Ensembl fixtures (expanded and
unexpanded), pandas input, header lines, missing-value handling, the
falsy-value regression, and the missing-column error.

Co-authored-by: Benoitdw <bw@oncodna.com>
Claude-Session: https://claude.ai/code/session_014fNxSBm5zvdsDNwN3nhmpS
Pull Request #72: Add write_gtf: serialize a DataFrame back to GTF (fixes #21)

245 of 256 relevant lines covered (95.7%)

0.96 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28965619839.1 08 Jul 2026 06:19PM UTC 6
95.7
GitHub Action Run
Source Files on build 28965619839
  • Tree
  • List 6
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28965619839
  • Pull Request #72
  • PR Base - master (#25821451381)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc