I need to obtain something like this:
However, I cannot know how to continue... now I have this:
In other words... I cannot know how to add tags and the corresponding transcripts, CDS, etc.
My code right now is the following one:
#!/usr/bin/perl
#use strict;
use Bio::Graphics;
use Bio::SeqFeature::Generic;
my $panel = Bio::Graphics::Panel->new(
-length => 20000,
-width => 800
);
my $full_length = Bio::SeqFeature::Generic->new(
-start => 1,
-end => 20000,
);
$panel->add_track($full_length,
-key => "hola",
-glyph => 'arrow',
-tick => 2,
-fgcolor => 'black',
-double => 1,
);
my $track = $panel->add_track(
-glyph => 'generic',
-label => 1
);
my $track = $panel->add_track(
-glyph => 'generic',
-label => 1
);
$seq = "";
$seqlength = length($seq);
$count = 0;
while (<>) {
chomp;
next if /^\#/;
my @gff_data = split /\t+/;
next if ($gff_data[2] ne "gene");
my $feature = Bio::SeqFeature::Generic->new(
-display_name => $gff_data[8],
-score => $gff_data[5],
-start => $gff_data[3],
-end => $gff_data[4],
);
$track->add_feature($feature);
}
print $panel->png;
I've read as well the CPAN information but no clue... There is a lot of information for NCBI files but nothing for GFF...
My data:
313-9640000-9660000:19634:fwd maker gene 1978 7195 . + . ID=maker-313-9640000-9660000%3A19634%3Afwd-augustus-gene-0.10;Name=maker-313-9640000-9660000%253A19634%253Afwd-augustus-gene-0.10
313-9640000-9660000:19634:fwd maker mRNA 1978 7195 . + . ID=maker-313-9640000-9660000%3A19634%3Afwd-augustus-gene-0.10-mRNA-1;Name=maker-313-9640000-9660000%253A19634%253Afwd-augustus-gene-0.10-mRNA-1;Parent=maker-313-9640000-9660000%3A19634%3Afwd-augustus-gene-0.10
313-9640000-9660000:19634:fwd maker exon 1978 2207 0.48 + . Parent=maker-313-9640000-9660000%3A19634%3Afwd-augustus-gene-0.10-mRNA-1
313-9640000-9660000:19634:fwd maker exon 3081 3457 0.48 + . Parent=maker-313-9640000-9660000%3A19634%3Afwd-augustus-gene-0.10-mRNA-1
313-9640000-9660000:19634:fwd maker exon 3535 3700 0.48 + . Parent=maker-313-9640000-9660000%3A19634%3Afwd-augustus-gene-0.10-mRNA-1
Any help will be very wellcome.
What you are showing in the first screen capture is likely from GBrowse, and the track labels (I think this is what you mean by 'tags') are defined in the configuration file. The feature label can be turned on/off by setting the 'label' and 'label_feat' attributes when you create the object. You will have to manually edit the file if you don't like those long strings set as the ID by MAKER.
You can change the appearance of each feature by choosing a different glyph. For example, you chose the 'generic' glyph, so what you get is a pretty generic looking box which just shows you the location of the feature. For nice looking transcripts, take a look at the 'processed_transcript' and 'decorated_transcript' glyphs.
There are also some problems with your code, such duplication of certain sections, but that may be from doing a copy and paste of the code.