Bio-BioStudio

 view release on metacpan or  search on metacpan

bin/BS_Cartoonist.pl  view on Meta::CPAN

$p{U_BIG_SCALE_MARK} = ceil(.2*$p{LEVEL_WIDTH});

my %drawing = ("stop_retained_variant" => 1, "CDS" => 1, "PCR_product" => 1,
  "centromere" => 1, "ARS" => 1, "restriction_enzyme_recognition_site" => 1,
  "enzyme_recognition_site" => 1,
  "site_specific_recombination_target_region" => 1, "intron" => 1,
  "repeat_family" => 1, "universal_telomere_cap" => 1, "deletion" => 1);
 
my %labeling = ("gene" => 1, "centromere" => 1, "ARS" => 1);

my %legending = (
  "stop_retained_variant" => "stop swap",
  "PCR_product" => "PCRTag amplicon",
  "ARS" => "ARS",
  "intron" => 0, "centromere" => 0,
  "universal_telomere_cap" => "Telomere seed sequence",
  "site_specific_recombination_target_region" => "loxPsym site",
  "repeat_family" => 0,
  "deletion" => 0,
  "CDS" => 0
);

bin/BS_Cartoonist.pl  view on Meta::CPAN

  my $tx = $x - $thref->{width}/2;
  $key->move_to($tx, $y);
  $key->show_text($text);
  $y = ($x+(2*$thref->{width}) > $width - 500)  ? $y+100 : $y + 2;
  $x = ($x+(2*$thref->{width}) > $width - 500)  ? 500 : $x+(2*$thref->{width});
}

#Draw Key
$x = 500;
$y += 100;
foreach my $type (grep {exists $legending{$_}} keys %index)
{
  print "got a $type!\n";
  my %objs;
  if ($type eq 'CDS')
  {
    my @CDSes = @{$index{$type}};
    if ($CDSes[0]->{feat}->has_tag('essential_status') && $CDSes[0]->{feat}->has_tag('orf_classification'))
    {
      $objs{"essential ORF"} = first {$_->{feat}->Tag_essential_status eq "Essential"} @{$index{$type}};
      $objs{"slow growth ORF"} = first {$_->{feat}->Tag_essential_status eq "fast_growth"} @{$index{$type}};

bin/BS_Cartoonist.pl  view on Meta::CPAN

    }
  }
  else
  {
    $objs{$type} = first {1} @{$index{$type}};
  }
  foreach my $text (keys %objs)
  {
    my $xywref = [$x, $y, 50];
    my $obj = $objs{$text};
    $text = $legending{$type} if ($legending{$type});
    print "keying $text\n";
    my $thref = ($key->text_extents($text));
    my $xbeg = $p{LEFT_MARGIN};
    my $xend = $p{LEFT_DATA_MARGIN} + $LastScaleMidLen + $p{RIGHT_REP_WIDTH};
    draw_feature($key, $obj, $xbeg, $xend, 0, \%p, $xywref);
    $key->move_to($x + 50 + ($thref->{width} / 2), $y);
    $key->show_text($text);
    $y = $y + 100;
    $x = 500;
  }



( run in 0.730 second using v1.01-cache-2.11-cpan-49f99fa48dc )