11346 |
|
|
11347 |
sub build_tree_of_complete { |
sub build_tree_of_complete { |
11348 |
my($self,$min_for_label) = @_; |
my($self,$min_for_label) = @_; |
11349 |
return $self->buld_tee_of_all($min_for_label, "complete"); |
return $self->build_tree_of_all($min_for_label, "complete"); |
11350 |
} |
} |
11351 |
|
|
11352 |
sub build_tree_of_all { |
sub build_tree_of_all { |
14296 |
return 0; |
return 0; |
14297 |
} |
} |
14298 |
|
|
14299 |
|
### Some rendering stuff |
14300 |
|
# |
14301 |
|
|
14302 |
|
=head2 genome_to_gg |
14303 |
|
|
14304 |
|
Render a genome's contig as GenoGraphics objects. |
14305 |
|
|
14306 |
|
=cut |
14307 |
|
|
14308 |
|
sub genome_to_gg |
14309 |
|
{ |
14310 |
|
my($self, $genome, $contig, $width) = @_; |
14311 |
|
|
14312 |
|
my $gg = []; |
14313 |
|
|
14314 |
|
my $len = $self->contig_ln($genome, $contig); |
14315 |
|
|
14316 |
|
my $next_color = 0; |
14317 |
|
my %sub_color; |
14318 |
|
|
14319 |
|
for (my $start = 0; $start + $width < $len; $start += $width) |
14320 |
|
{ |
14321 |
|
my $label = $start; |
14322 |
|
my $end = $start + $width; |
14323 |
|
|
14324 |
|
my($genes, $g_beg, $g_end) = $self->genes_in_region($genome, $contig, $start, $end); |
14325 |
|
|
14326 |
|
my $map = []; |
14327 |
|
|
14328 |
|
for my $gene (@$genes) |
14329 |
|
{ |
14330 |
|
my $loc = $self->feature_location($gene); |
14331 |
|
my($c, $b, $e) = $self->boundaries_of($loc); |
14332 |
|
|
14333 |
|
my $shape; |
14334 |
|
|
14335 |
|
if ($b < $e) |
14336 |
|
{ |
14337 |
|
$shape = "rightArrow"; |
14338 |
|
} |
14339 |
|
else |
14340 |
|
{ |
14341 |
|
$shape = "leftArrow"; |
14342 |
|
($b, $e) = ($e, $b); |
14343 |
|
} |
14344 |
|
|
14345 |
|
my($type, $peg_n) = ($gene =~ /fig\|\d+\.\d+\.(\w+)\.(\d+)$/); |
14346 |
|
|
14347 |
|
my $color = "red"; |
14348 |
|
if ($type eq 'rna') |
14349 |
|
{ |
14350 |
|
$color= 'black'; |
14351 |
|
} |
14352 |
|
|
14353 |
|
my @a = $self->feature_aliases($gene); |
14354 |
|
my @gene_names = grep { /^[a-zA-Z]{4}$/ } @a; |
14355 |
|
if (@gene_names) |
14356 |
|
{ |
14357 |
|
$peg_n = $gene_names[0]; |
14358 |
|
} |
14359 |
|
|
14360 |
|
my @subs = $self->peg_to_subsystems($gene); |
14361 |
|
if (@subs) |
14362 |
|
{ |
14363 |
|
my $sub = $subs[0]; |
14364 |
|
if (not exists $sub_color{$sub}) |
14365 |
|
{ |
14366 |
|
my $c = $next_color + 1; |
14367 |
|
$next_color = ($next_color + 1) % 20; |
14368 |
|
$sub_color{$sub} = "color$c"; |
14369 |
|
} |
14370 |
|
$color = $sub_color{$sub}; |
14371 |
|
} |
14372 |
|
|
14373 |
|
$b = $start if $b < $start; |
14374 |
|
$e = $end if $e > $end; |
14375 |
|
|
14376 |
|
push(@$map, [$b - $start, $e - $start, $shape, $color, $peg_n, '', '']); |
14377 |
|
} |
14378 |
|
|
14379 |
|
push(@$gg, [$label, 0, $width, $map]); |
14380 |
|
} |
14381 |
|
|
14382 |
|
for my $sub (sort keys %sub_color) |
14383 |
|
{ |
14384 |
|
my $map = [3000, $width - 10, 'rect', $sub_color{$sub}, $sub, '', '']; |
14385 |
|
push(@$gg, ['', 0, $width, $map]); |
14386 |
|
} |
14387 |
|
return $gg; |
14388 |
|
} |
14389 |
|
|
14390 |
|
|
14391 |
=head2 UserData Helper Methods |
=head2 UserData Helper Methods |
14392 |
|
|
14393 |
This section contains the methods used to implement UserData access. User data is |
This section contains the methods used to implement UserData access. User data is |