I am displaying the genes and exons of a GFF file with this module. However, I'd like to connect the corresponding exons, but it does not work.
In order to read the file, I'm doing a while loop, saving each line into an array. Later, I split the line stored into the array by its columns, and I do:
I'm doing a while loop, saving each line into an array.
What you want to do is display features, such as genes, and these are spread of over multiple lines. You need to use something like Bio::FeatureIO to get the sequence features you want, create a Bio::SeqFeature object like above with all the gene feature parts, then use Bio::Graphics::Panel to add those features to the plot.
Thanks for answering. So, now I read my GFF file with $in = Bio::FeatureIO->new(-file => "annot.gff" , -format => 'GFF');. What should I do now? What contains $in? Names, start, end positions...?
I think the best way would probably be to use Bio::Tools::GFF rather than Bio::FeatureIO (I was going from memory). The method would be to read through your features using (while my $feat = $gffio->next_feature) { ... }. Then select the features by looking at the primary tags, and add a track for each feature that you want to display. I recommend you read through the Bio::Graphics documentation and take a look at the examples. In particular, you should be able to follow the synopsis and make the changes I mentioned. That is the best I can do for now, I don't know what you want to display or what data you have.
But, I already have one track per feature. What is saved in $gffio? And, once I have the features I want to display, do I have to introduce an end and start position such as I show in my question? I just don't understand how connect exons if I have:
Thanks for answering. So, now I read my GFF file with
$in = Bio::FeatureIO->new(-file => "annot.gff" , -format => 'GFF');
. What should I do now? What contains$in
? Names, start, end positions...?I think the best way would probably be to use Bio::Tools::GFF rather than Bio::FeatureIO (I was going from memory). The method would be to read through your features using
(while my $feat = $gffio->next_feature) { ... }
. Then select the features by looking at the primary tags, and add a track for each feature that you want to display. I recommend you read through the Bio::Graphics documentation and take a look at the examples. In particular, you should be able to follow the synopsis and make the changes I mentioned. That is the best I can do for now, I don't know what you want to display or what data you have.But, I already have one track per feature. What is saved in
$gffio
? And, once I have the features I want to display, do I have to introduce an end and start position such as I show in my question? I just don't understand how connect exons if I have:where @gff_data has every row of the file I wanna show.