Skip to main content

Python programs for processing GFF3 files

Project description

[![Build Status](](

[![Build status](](

[![PyPI version](](

[![Documentation Status](](

## Background

The [GFF3 format]( (Generic Feature Format Version 3) is one of the standard formats to describe and represent genomic features. It is an incredibly flexible, 9-column format, which is easily manipulated by biologists. This flexibility, however, makes it very easy to break the format. We have developed the GFF3toolkit to help identify common problems with GFF3 files; fix 30 of these common problems; sort GFF3 files (which can aid in using down-stream processing programs and custom parsing); merge two GFF3 files into a single, non-redundant GFF3 file; and generate FASTA files from a GFF3 file for many use cases (e.g. feature types beyond mRNA).

[Frequently Asked Questions/FAQ](docs/

## Prerequisite

  • Python 3.x
    • [wheel]( (should have been installed for most python distributions, if you don’t have, use pip install wheel to install it.)
  • Perl

## Installation

### Stable release on PyPI

pip install gff3tool

### Latest version

pip install git+

## Current Functions

  • [Detect GFF3 format errors](#detect-gff3-format-errors-back)
  • [Correct GFF3 format errors](#correct-gff3-format-errors-back)
  • [Merge two GFF3 files](#merge-two-gff3-files-back)
  • [Sort a GFF3 file](#sort-a-gff3-file-back)
  • [Generate biological sequences from a GFF3 file](#generate-biological-sequences-from-a-gff3-file-back)

## Usage

### Detect GFF3 format errors ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • gff3_QC - Detection of GFF format errors (~50 types of errors).

    • [gff3_QC readme](docs/

    • [gff3_QC full documentation](docs/Detection-of-GFF3-format-errors.rst)

    • Quick start:

      gff3_QC -g example_file/example.gff3 -f example_file/reference.fa -o error.txt -s statistic.txt

    • Please refer to [gff3tool/lib/ERROR/](gff3tool/lib/ERROR/ to see the full list of Error codes and the corresponding Error tags.

### Correct GFF3 format errors ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • gff3_fix - Correct GFF3 errors detected by (30 types of errors).

    • [gff3_fix readme](docs/

    • [gff3_fix full documentation](docs/

    • Quick start:

      gff3_fix -qc_r error.txt -g example_file/example.gff3 -og corrected.gff3

### Merge two GFF3 files ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • gff3_merge - Merge two GFF3 files

    • [gff3_merge readme](docs/

    • [gff3_merge full documentation](docs/

    • Quick start:

      • Merge the two file with auto-assignment of replace tags (default)

        gff3_merge -g1 example_file/new_models.gff3 -g2 example_file/reference.gff3 -f example_file/reference.fa -og merged.gff -r merged_report.txt

      • If your gff files have assigned proper replace tags at column 9 (Format: replace=[Transcript ID]), you could merge the two gff files without auto-assignment of tags.

        gff3_merge -g1 example_file/new_models_w_replace.gff3 -g2 example_file/reference.gff3 -f example_file/reference.fa -og merged.gff -r merged_report.txt -noAuto

### Sort a GFF3 file ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • gff3_sort - Sort a GFF3 file according to the order of Scaffold, coordinates on a Scaffold, and parent-child feature relationships

    • [gff3_sort readme](docs/

    • Quick start:

      gff3_sort -g example_file/example.gff3 -og example-sorted.gff3

### Generate biological sequences from a GFF3 file ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • bin/ - extract biological sequences (such as spliced transcripts, cds, or peptides) from specific regions of genome based on a GFF3 file

    • [gff3_to_fasta readme](docs/

    • Quick start:

      gff3_to_fasta -g example_file/example.gff3 -f example_file/reference.fa -st all -d simple -o test_sequences

## Example Files ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • [example_file](example_file)/
    • Example files for testing

## Internal Dependencies ([back](#gff3toolkit—python-programs-for-processing-gff3-files))

  • [gff3tool/lib/gff3](gff3tool/lib/gff3)/
    • Basic data structure used for nesting the information of genome annotations in GFF3 format.
  • [gff3tool/lib/gff3_to_fasta](gff3tool/lib/gff3_to_fasta)/
    • Extract specific sequences from genome sequences according to the GFF3 file.
  • [gff3tool/lib/ERROR](gff3tool/lib/ERROR)/
    • Contains the full list of Error codes and the corresponding Error tag
  • [gff3tool/lib/function4gff](gff3tool/lib/function4gff)/
    • Functions for gff3 processing
  • [gff3tool/lib/gff3/](gff3tool/lib/gff3/
  • [gff3tool/lib/inter_model](gff3tool/lib/inter_model)/
    • QC functions for processing multiple features between models (inter-model) in a GFF3 file.
  • [gff3tool/lib/intra_model](gff3tool/lib/intra_model)/
    • QC functions for processing multiple features within a model (intra-model) in a GFF3 file.
  • [gff3tool/lib/single_feature](gff3tool/lib/single_feature)/
    • QC functions for processing single features in a GFF3 file.

Keywords: gff3 gff bioinformatics Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Operating System :: POSIX :: Linux Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: MacOS :: MacOS X Classifier: Intended Audience :: Science/Research Classifier: Topic :: Scientific/Engineering :: Bio-Informatics Classifier: License :: Public Domain Classifier: Programming Language :: Python :: 2.7 Description-Content-Type: text/markdown

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gff3tool, version 2.0.3
Filename, size File type Python version Upload date Hashes
Filename, size gff3tool-2.0.3.tar.gz (83.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page