Bioperl, Bio::Graphics
1
1
Entering edit mode
10.9 years ago
int11ap1 ▴ 490

Hi everybody,

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:

$feature = Bio::SeqFeature::Generic->new( -display_name => $item[8], -score => $item[5], -start => $item[3], -end => $item[4], -strand => $item[6] );

It works great. However, I don't know how to connect the exons... Anybody?

bioperl • 2.3k views
ADD COMMENT
2
Entering edit mode
10.9 years ago
SES 8.6k

I think the following line is your problem.

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.

ADD COMMENT
0
Entering edit mode

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...?

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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:

foreach $i (@gff_data) {
  @item = split(/\t+/, $i);
  $feature = Bio::SeqFeature::Generic->new(
                            -display_name => $item[8],
                            -score        => $item[5],
                            -start        => $item[3],
                            -end          => $item[4],
                            -strand => $item[6]
                            );

where @gff_data has every row of the file I wanna show.

ADD REPLY

Login before adding your answer.

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