-1

我需要获得这样的东西:

在此处输入图像描述

但是,我不知道如何继续......现在我有了这个:

在此处输入图像描述

换句话说......我不知道如何添加标签和相应的成绩单,CDS等。

我现在的代码如下:

#!/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;

我也阅读了 CPAN 信息,但没有任何线索...... NCBI 文件有很多信息,但 GFF 没有......

我的数据:

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

任何帮助都会非常受欢迎。

4

3 回答 3

1
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;
于 2015-01-15T08:34:38.913 回答
0

您在第一个屏幕截图中显示的内容可能来自 GBrowse,并且轨道标签(我认为这就是您所说的“标签”)是在配置文件中定义的。在创建对象时,可以通过设置“label”和“label_feat”属性来打开/关闭特征标签。如果您不喜欢 MAKER 设置为 ID 的长字符串,则必须手动编辑该文件。

您可以通过选择不同的字形来更改每个功能的外观。例如,您选择了“通用”字形,因此您得到的是一个外观非常通用的框,它只向您显示特征的位置。要获得好看的成绩单,请查看“processed_transcript”和“decorated_transcript”字形。

您的代码也存在一些问题,例如某些部分的重复,但这可能是由于复制和粘贴代码造成的。

于 2014-01-19T16:43:49.883 回答
0

我和你有同样的问题。事情不是很容易解释。最后我解决了它,我的数字与你的非常相似。就我而言,我想在几个基因的 5' UTR 中连接一些编码数据。并且这个编码数据应该用虚线连接。因此,我创建了一个 Bio::SeqFeature::Generic 对象,并且要在其中绘制的信息是我的编码区域,因此该编码区域需要在内部进行子定位:

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
);
于 2014-01-21T16:26:30.227 回答