Draw Gene Models From Gff3 File
1
2
Entering edit mode
10.2 years ago
inadamj ▴ 60

I have the following input GFF3 format and I want to pars it in javascript code since I did not find available tools to draw the gene models from gff file. I found many differences in the gff3 files.. What is the important fields to extract in order to draw the gene models.

I want to extract these field in order to give it to Scribl to draw the gene ..

I want the output to be like this genemodele

Here is the file : GFF

and this GFF

gene model visualization • 5.6k views
ADD COMMENT
0
Entering edit mode

"I have the following input GFF3 format ": where is it ?

ADD REPLY
0
Entering edit mode

I put the link .. but my question is based on the differences that I found.

ADD REPLY
0
Entering edit mode

Second link is not pointing to a GFF file. What differences are you seeing?

ADD REPLY
0
Entering edit mode

the number of the column is confusing some of the file they have 8 column while the other is less

ADD REPLY
0
Entering edit mode

There are lots of "available tools to draw the gene models from gff file." For example: the GenomeTools package (introduction) , the Bio::Graphics libraries of Perl or Ruby and Bioconductor's rtracklayer.

ADD REPLY
5
Entering edit mode
10.2 years ago
Chase Miller ▴ 410

Here's a jsbin that seems to work with both of your sample files (although I haven't checked very closely).

http://jsbin.com/cuy/1/edit?js,output

The parsing and drawing code is here

var canvas = document.getElementById('canvas');      
// Create Chart
chart1 = new Scribl(canvas, 770);
chart1.laneSizes = 18;

// grab gff data
var records = $("textarea").html().split('\n');

for (var i=0; i < records.length; i++) {
 // ignore comments
 if (records[i][0] == '#') continue;
 // parse gff fields
 var fields = records[i].split("\t");
 var seqid  = fields[0],
     source = fields[1],
     type   = fields[2],
     start  = parseInt(fields[3]),
     end    = parseInt(fields[4]),
     score  = fields[5],
     strand = fields[6],
     phase  = fields[7],
     attr   = fields[8];

 // add gene to chart with desired attributes
 var gene = chart1.addGene(start, end-start, strand);
 gene.name = type;
}

// Draw Chart
chart1.draw();
ADD COMMENT
0
Entering edit mode

thanks very much I wrote something similar and this makes me assure that I am correct.

ADD REPLY

Login before adding your answer.

Traffic: 2899 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