質問

I need to obtain something like this:

enter image description here

However, I cannot know how to continue... now I have this:

enter image description here

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.

役に立ちましたか?

解決 2

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.

他のヒント

use Bio::Graphics;
use Bio::Tools::GFF;
use Bio::SeqFeature::Generic;

$gfffile = shift;
my $gff = Bio::Tools::GFF->new(-file => $gfffile, -gff_version => 3);

while($feature = $gff->next_feature()) {
  $tag = $feature->primary_tag;
  push @{$hash{$tag}}, $feature;
}
$gff->close();

my $panel = Bio::Graphics::Panel->new(
                                  -length => 20000,
                                  -width  => 800,
                                  -key_style => 'between',
                                 );

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 @colors = qw(cyan orange blue);
my $idx    = 0;
for my $tag (sort keys %hash) {
  my $features = $hash{$tag};
  $panel->add_track($features,
                -glyph       =>  'generic',
                -bgcolor     =>  $colors[$idx++ % @colors],
                -fgcolor     => 'black',
                -font2color  => 'red',
                -key         => "${tag}s",
                -bump        => +1,
                -height      => 8,
                -label       => 1,
                -description => 1,
               );
} 
print $panel->png;

I had the same problem than you. The thing is not very easy to explain. Finally I solved it and mi figure is pretty much similar at yours. In my case I wanted to connect some encode data in the 5' UTR of several genes. And this encode data should be connected with dashed lines. So I create a Bio::SeqFeature::Generic object and the information to plot inside are my encode regions, so this encode regions need to be sub_located inside :

my $splitlocation = Bio::Location::Split->new();
foreach $encode_regions ....{
    $splitlocation->add_sub_Location(Bio::Location::Simple->new(-start=>$start,-end=>$end,-  strand=>$strand,-splittype=>"join"));
}

$exones = new Bio::SeqFeature::Generic(
    -primary_tag => 'Encode Regions',
    -location=>$splitlocation
);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top