<commit_before>package Bio::EnsEMBL::GlyphSet::Videogram;
use strict;
use warnings;
no warnings 'uninitialized';
use base qw(Bio::EnsEMBL::GlyphSet::Videogram_legend);
use Carp;

####################################################################
### set true only while you're generating the vega karyotype image ##
#####################################################################
## end of vega karyotype static image colours ###                                                

sub _init {
  my ($self) = @_;
  my $config = $self->{'config'};

  my $i_w = $self->get_parameter('image_height');
  my $c_w = $self->get_parameter('container_width');
  return unless $c_w;

  $self->_init_bump( '_bump_forward' );
  $self->_init_bump( '_bump_reverse' );
  my $col   = undef;
  my $white = 'white';
  my $black = 'black';
  my $bg    = $self->get_parameter( 'bgcolor');
  my $red   = 'red';

  $self->{'pix_per_bp'}     = $i_w/$c_w;

  my $im_width    = $i_w;
  my $top_margin  = $self->get_parameter('top_margin');
  my ($w,$h)      = $self->{'config'}->texthelper->Vpx2bp('Tiny');
  my $chr         = $self->{'container'}->{'chr'} || $self->{'extras'}->{'chr'};

  ########## fetch the chromosome bands that cover this VC.
  my $kba           = $self->{'container'}->{'ka'};
  my $bands         = $kba->fetch_all_by_chr_name($chr);
  my $slice_adaptor = $self->{'container'}->{'sa'};
  my $slice         = $slice_adaptor->fetch_by_region(undef, $chr) or
    (carp "$slice_adaptor has no fetch_by_region(undef,$chr)" && return);

  my $chr_length = $slice->length || 1;

  ########## bottom align each chromosome!
  my $v_offset    = $c_w - $chr_length;
  my $bpperpx     = $c_w / $config->get_parameter('image_height');

  ########## overcome a bottom border/margin problem....
  my $done_1_acen = 0;        # flag for tracking place in chromosome
  my $wid         = $self->my_config('width') || 24;
  my $h_wid       = int $wid/2;
  my $padding     = $self->my_config('padding') || 6;
  my $style       = $self->my_config('style')   || q();
  ########## get text labels in correct place!
  my  $h_offset = $style eq 'text' ? $padding 
                :                    int($self->my_config('totalwidth') - $wid - ($self->get_parameter('band_labels') eq 'on' ? ($w * 6 + 4) : 0 ))/2<commit_msg>set background colour for jagged edges correctly<commit_after>package Bio::EnsEMBL::GlyphSet::Videogram;
use strict;
use warnings;
no warnings 'uninitialized';
use base qw(Bio::EnsEMBL::GlyphSet::Videogram_legend);
use Carp;

####################################################################
### set true only while you're generating the vega karyotype image ##
#####################################################################
## end of vega karyotype static image colours ###                                                

sub _init {
  my ($self) = @_;
  my $config = $self->{'config'};

  my $i_w = $self->get_parameter('image_height');
  my $c_w = $self->get_parameter('container_width');
  return unless $c_w;

  $self->_init_bump( '_bump_forward' );
  $self->_init_bump( '_bump_reverse' );
  my $col   = undef;
  my $white = 'white';
  my $black = 'black';
  my $bg    = 'background2';
  my $red   = 'red';

  $self->{'pix_per_bp'}     = $i_w/$c_w;

  my $im_width    = $i_w;
  my $top_margin  = $self->get_parameter('top_margin');
  my ($w,$h)      = $self->{'config'}->texthelper->Vpx2bp('Tiny');
  my $chr         = $self->{'container'}->{'chr'} || $self->{'extras'}->{'chr'};

  ########## fetch the chromosome bands that cover this VC.
  my $kba           = $self->{'container'}->{'ka'};
  my $bands         = $kba->fetch_all_by_chr_name($chr);
  my $slice_adaptor = $self->{'container'}->{'sa'};
  my $slice         = $slice_adaptor->fetch_by_region(undef, $chr) or
    (carp "$slice_adaptor has no fetch_by_region(undef,$chr)" && return);

  my $chr_length = $slice->length || 1;

  ########## bottom align each chromosome!
  my $v_offset    = $c_w - $chr_length;
  my $bpperpx     = $c_w / $config->get_parameter('image_height');

  ########## overcome a bottom border/margin problem....
  my $done_1_acen = 0;        # flag for tracking place in chromosome
  my $wid         = $self->my_config('width') || 24;
  my $h_wid       = int $wid/2;
  my $padding     = $self->my_config('padding') || 6;
  my $style       = $self->my_config('style')   || q();
  ########## get text labels in correct place!
  my  $h_offset = $style eq 'text' ? $padding 
                :                    int($self->my_config('totalwidth') - $wid - ($self->get_parameter('band_labels') eq 'on' ? ($w * 6 + 4) : 0 ))/2
{'fraction_non_alphanumeric': 0.2398356401384083, 'fraction_numerical': 0.005406574394463667, 'mean_word_length': 3.2863762743280818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5616743', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1522, 'n_words': 360}