extract-exons-py
Quick Start
- Command:
extract_exons.py [gtf_file] - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/extract_exons.py - Full reference: See references/help.md
When To Use This Tool
- Extract nonredundant exon intervals from a GTF annotation.
- Prepare exon lists for HISAT2 index building or transcriptome-aware downstream tooling.
- Collapse transcript-specific exon redundancy into a unique coordinate set.
Common Patterns
# 1) Extract exons from a GTF file
extract_exons.py genes.gtf > exons.tsv
# 2) Stream a GTF through stdin
zcat genes.gtf.gz | extract_exons.py - > exons.tsv
# 3) Inspect the first zero-based exon intervals
extract_exons.py genes.gtf | sed -n '1,20p'
Recommended Workflow
- Obtain a valid GTF annotation file for your reference genome
- Run
extract_exons.py gtf_fileto extract exon coordinates (use-for stdin) - Add
-vflag to print statistics to stderr for validation - Use output as input for downstream HISAT2 index building workflows
Guardrails
- Input must be a valid GTF file or
-for stdin - Verify GTF format compatibility before processing large files
- Review stderr output when using verbose mode to validate extraction statistics
- Output coordinates are zero-based (
left-1,right-1) and include strand as the fourth column. - Adjacent exons separated by 5 bp or less are merged before output, so the result is not a raw exon-by-exon dump from the source GTF.
--helpworks, but--versionis not implemented and exits with an argparse error.