4

I want to convert my gff3 annotation files to genbank format for use in Mauve. I found the seqret tool here https://www.ebi.ac.uk/Tools/sfc/emboss_seqret/ which can perform this task, but my files (bacterial genomes) are too big.

Can anyone suggest a simple method to make this conversion?

Mark
  • 143
  • 1
  • 8
  • 3
    Hi there. I don't know any simple method for what you ask, mainly because gff3 format does not contain sequences (only annotations) while fasta & genbank do. This thread on biostars might help tho : Gff3 + Fasta To Genbank. As the title suggest, you will need your genome gff3 and fasta reference as inputs. – Paul Endymion Jan 09 '20 at 16:56
  • 1
    THanks for taking the time to consider my question Paul. My gff3 files have the sequence in FASTA at the end of the file (following a ##FASTA indicator), but i take your point - will need some further leg work on this one! Thanks for the link also. – Mark Jan 10 '20 at 14:26

3 Answers3

3

I believe seqret is already the simplest approach. If you install the emboss command line utility, genome (file) sizes will not be a problem. You can even install it with conda, see https://anaconda.org/bioconda/emboss.

After that, you can use it as the example:

seqret -sequence {genome file} -feature -fformat gff -fopenfile {gff file} -osformat genbank -osname_outseq {output prefix} -ofdirectory_outseq gbk_file -auto

Hope it helps

1

You can use BioPerl to do this. Read in the GFF and make gene objects and write out those gene objects in Genbank format.

Perhaps this tool (doing the opposite) will get you started: https://metacpan.org/pod/bp_genbank2gff3.pl

Here is a script doing what you ask but it doesn't use any libraries (so is probably buggy): https://gist.github.com/avrilcoghlan/5386810

Hope that helps, Dan.

Dan Bolser
  • 188
  • 6
1

Here's a python script based on the bcbio-gff (reading gff3) and biopython (writing genbank): https://github.com/chapmanb/bcbb/blob/master/gff/Scripts/gff/gff_to_genbank.py

mgalardini
  • 977
  • 7
  • 18
  • 1
    just random ref, can pip install bcbio-gff and pip install BioPython to get these dependencies for this – Colin D Feb 07 '23 at 23:36