Question: convert json to gff
0
gravatar for mail
2.4 years ago by
mail0
mail0 wrote:

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 • 907 views
ADD COMMENTlink modified 2.4 years ago by Alex Reynolds28k • written 2.4 years ago by mail0

Can you post a snippet of the JSON?

ADD REPLYlink written 2.4 years ago by Alex Reynolds28k
0
gravatar for Felix Francis
2.4 years ago by
Felix Francis490
United States/University of Delaware
Felix Francis490 wrote:

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 COMMENTlink written 2.4 years ago by Felix Francis490

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 REPLYlink written 2.4 years ago by genomax67k
0
gravatar for Alex Reynolds
2.4 years ago by
Alex Reynolds28k
Seattle, WA USA
Alex Reynolds28k wrote:

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 COMMENTlink written 2.4 years ago by Alex Reynolds28k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 815 users visited in the last hour