gff2gff-py
Quick Start
- Command:
/home/vimalinx/miniforge3/envs/bio/bin/gff2gff.py input.gff scratch.db > output.gff3 - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/gff2gff.py - Full reference: See
references/help.mdfor complete options and usage
When To Use This Tool
- Salvage certain GenBank-style GFF inputs for downstream
bcftools csquse. - Build a temporary
gffutilsdatabase and emit a simplified gene / transcript / CDS hierarchy to stdout. - Use only when the input flavor matches the script's assumptions about
gene,mRNA,CDS,ncRNA,Name, andlocus_tagattributes.
Common Patterns
# 1) Convert a GenBank-derived GFF and keep the intermediate gffutils DB
/home/vimalinx/miniforge3/envs/bio/bin/gff2gff.py \
input.gff \
scratch.db \
> output.gff3
# 2) Write the scratch DB to a temporary location
tmp_db=$(mktemp /tmp/gffutils.XXXXXX.db)
/home/vimalinx/miniforge3/envs/bio/bin/gff2gff.py input.gff "$tmp_db" > output.gff3
Recommended Workflow
- Confirm that the Python environment actually provides
gffutils; this script imports it before any argument parsing. - Use a disposable path for the second argument, because the script creates a
gffutilsdatabase there withforce=True. - Redirect stdout to your desired output GFF3 file.
- Inspect the result for expected
###separators plusgene,transcript, andCDSrecords before trusting it in annotation workflows.
Guardrails
- In this environment
gff2gff.py --helpand--versionboth fail immediately withModuleNotFoundError: No module named 'gffutils'. - The second positional argument is a database path, not the converted GFF output path; converted records are printed to stdout.
- Source inspection shows it skips
ncRNAfeature groups and prints onlygene,transcript, andCDSrecords. - The script assumes attributes such as
Nameandlocus_tag; mismatched GFF flavors can crash or assert instead of degrading gracefully.