Region-aware GFF annotation integration toolkit
Project description
gffkit
gffkit is a lightweight toolkit for region-aware GFF/GTF annotation integration.
It combines four utilities:
detect-bridge: detect suspicious merged-gene artifacts caused by bridge transcripts.complement: complement/merge annotations, with optional region-swap mode.add-utr: reconstructfive_prime_UTRandthree_prime_UTRfeatures from exon/CDS coordinates.rename-sort: rename gene/transcript/child IDs with a prefix and sort the final GFF3.
Installation
pip install gffkit
Quick start
Full integration pipeline
gffkit integrate \
--annotation-a EviAnn.gff3 \
--annotation-b ANNEVO.gff3 \
--outdir gffkit_out \
--prefix sample \
-t 8
Outputs:
gffkit_out/sample.suspicious.tsvgffkit_out/sample.merged.gff3gffkit_out/sample.final.withUTR.gff3.pre_rename.gff3gffkit_out/sample.final.withUTR.gff3gffkit_out/sample.final.withUTR.gff3.id_map.tsv
In integrate, --prefix sample is also used for final ID renaming. Final gene IDs are written like sample_C01g00001, transcript IDs like sample_C01g00001.t1, and child IDs like sample_C01g00001.t1.exon1.
Step-by-step usage
# 1. Detect suspicious merged genes in Annotation A
gffkit detect-bridge -i EviAnn.gff3 -o suspicious.tsv -t 8
# 2. Use A as the global reference, but switch to B in suspicious regions
gffkit complement \
--ref EviAnn.gff3 \
--add ANNEVO.gff3 \
--swap_region_tsv suspicious.tsv \
--swap_region_flank 100 \
--output merged.gff3 \
-t 8
# 3. Add UTR features
gffkit add-utr -i merged.gff3 -o final.annotation.withUTR.pre_rename.gff3
# 4. Rename IDs, drop unplaced seqids, and sort the final GFF3
gffkit rename-sort \
-i final.annotation.withUTR.pre_rename.gff3 \
-o final.annotation.withUTR.gff3 \
--prefix sample
Merge three or more annotations
Use repeated --add arguments. Files are merged in the order provided.
gffkit complement \
--ref EviAnn.gff3 \
--add ANNEVO.gff3 \
--add Helixer.gff3 \
--add PASA.gff3 \
--output merged.multi.gff3 \
-t 8
Command overview
gffkit --help
gffkit detect-bridge --help
gffkit complement --help
gffkit add-utr --help
gffkit rename-sort --help
gffkit integrate --help
Threads
Version 0.3 and later add -t/--threads.
detect-bridgeanalyzes genes in parallel.complementpre-parses multiple--addfiles in parallel, then merges them in the original command-line order.integratepasses the thread count to the detect and complement steps.
Example:
gffkit integrate --annotation-a EviAnn.gff3 --annotation-b ANNEVO.gff3 -t 16
Annotation integration strategy
- Annotation A, for example EviAnn/RNA-seq-supported GFF, is used as the global primary reference.
- Annotation B, for example ANNEVO/deep-learning GFF, is used as the local primary reference only in suspicious merged-gene regions.
- UTR features are reconstructed after merging using an exon-minus-CDS strategy.
- Version 0.4.0 and later run
rename-sortas the finalintegratestep. The final GFF3 keeps chromosome-mounted records, removes unplaced/scaffold/contig records, sorts features, rewritesID/Parent, and writes an ID map next to the output. - When multiple tools annotate the same gene locus, the GFF source column is combined with
|, for exampleEviAnn|ANNEVO.
Rename and Sort
Run this step independently when you already have a merged GFF3:
gffkit rename-sort \
-i merged.withUTR.gff3 \
-o sample.renamed.sorted.gff3 \
--prefix sample \
--digits 5 \
--keep-old-ids
This writes sample.renamed.sorted.gff3 and sample.renamed.sorted.gff3.id_map.tsv.
Maintainer notes
When command-line options or behavior changes, update this README.md in the versioned package directory before building and uploading to PyPI.
License
MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gffkit-0.4.0.tar.gz.
File metadata
- Download URL: gffkit-0.4.0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ca5969110c429396df123ea94f7b24327e189e8e40c600bde38a45db9a6cb7d
|
|
| MD5 |
752c68ad14a989360f0eb56455211f1b
|
|
| BLAKE2b-256 |
38fe2a0104c840a44ec6cf03c1e458e209477a0e1a69ddccc47256442f2aa92f
|
File details
Details for the file gffkit-0.4.0-py3-none-any.whl.
File metadata
- Download URL: gffkit-0.4.0-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcd580a1a03989089f49f15b111e1ecab23186c3ab09e0ad28bb07653ce974b8
|
|
| MD5 |
74ef03f70933379fcc9231b9bc36c71f
|
|
| BLAKE2b-256 |
eb48ae800e12259a691ffa05132d48d38db24636148e0d5b92185a48608b0c39
|