convert json to gff
2
0
Entering edit mode
7.3 years ago
mail • 0

I have annotated a genome using maker and the json output can be used with jbrowse. All data are available on my local PC. So far so good, but now I would like to export the annotated regions of the json tree into gff or fasta files to use it e.g. for a local blast search (via viroblast). I now, that I can export a single file, but I've got more than 3000 annotated genes. Unfortunately, I found several tools to get json format from many other file formats but not the other way round.

And please keep in mind, that - unfortunately - I am a newby to both: genome annotation and unix based server systems ...

Is there any simple solution?

Thomas

sequence • 2.7k views
ADD COMMENT
0
Entering edit mode

Can you post a snippet of the JSON?

ADD REPLY
0
Entering edit mode
7.3 years ago
Felix Francis ▴ 600

You could use the following json2gff python script:

http://pythonhosted.org/mgkit/scripts/json2gff.html

usage: json2gff mongodb [-h] [-v | --quiet] [--cite] [--manual] [--version] [input_file] [output_file]

ADD COMMENT
0
Entering edit mode

This bit from the page you linked:

Annotations converted into MongoDB records with get-gff-info mongodb can be converted back into a GFF file using this command.

That makes me think this script may work for a specific application. We shall see if @mail is able to make it work.

ADD REPLY
0
Entering edit mode
7.3 years ago

It depends on the structure of your JSON, but you can do this type of conversion quite easily in Python. Here's a generic, basic example:

You just need to work with the structure of your JSON object to figure out how to loop through your array of annotation objects. You then dereference the keys in each annotation object, writing out GFF fields in an order that follows the format's specification. The example above turns the output into three-column BED, but you can simply reorder fields to get a different format.

ADD COMMENT

Login before adding your answer.

Traffic: 2660 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6