<commit_before>package Bio::EnsEMBL::GlyphSet::sequence;

use strict;

use Bio::EnsEMBL::Feature;

use base qw(Bio::EnsEMBL::GlyphSet_simple);

sub features {
  my ($self) = @_;
  my $start  = 0;
  my $seq    = uc $self->{'container'}->seq;
  my $strand = $self->strand;
  
  $seq =~ tr/ACGT/TGCA/ if $strand == -1;
  
  my @features = map {
    Bio::EnsEMBL::Feature->new(
      -start   => ++$start,
      -end     => $start,
      -strand  => $strand,
      -seqname => $_,
    )
  } split //, $seq;
  
  return \@features;
}

# What to use as the colour key
sub colour_key {
  my ($self, $f) = @_;
  return lc $f->seqname;
}

# What to place on the feature
sub feature_label {
  my ($self, $f) = @_;
  return ($f->seqname, 'overlaid');
}

sub title {
  my ($self, $f) = @_;
  return sprintf '%s; Position: %s:%s', $f->seqname, $self->{'container'}->seq_region_name, $self->{'container'}->start + $f->start - 1;
}

sub fixed { return 1; }

sub errorTrack {}

1;<commit_msg>add slice to feature, so we can get seq_region_start<commit_after>package Bio::EnsEMBL::GlyphSet::sequence;

use strict;

use Bio::EnsEMBL::Feature;

use base qw(Bio::EnsEMBL::GlyphSet_simple);

sub features {
  my ($self) = @_;
  my $start  = 0;
  my $seq    = uc $self->{'container'}->seq;
  my $strand = $self->strand;
  
  $seq =~ tr/ACGT/TGCA/ if $strand == -1;
  
  my @features = map {
    Bio::EnsEMBL::Feature->new(
      -start   => ++$start,
      -end     => $start,
      -strand  => $strand,
      -seqname => $_,
      -slice   => $self->{'container'},
    )
  } split //, $seq;
  
  return \@features;
}

# What to use as the colour key
sub colour_key {
  my ($self, $f) = @_;
  return lc $f->seqname;
}

# What to place on the feature
sub feature_label {
  my ($self, $f) = @_;
  return ($f->seqname, 'overlaid');
}

sub title {
  my ($self, $f) = @_;
  return sprintf '%s; Position: %s:%s', $f->seqname, $self->{'container'}->seq_region_name, $f->seq_region_start;
}

sub fixed { return 1; }

sub errorTrack {}

1;
{'fraction_non_alphanumeric': 0.19372509960159362, 'fraction_numerical': 0.004482071713147411, 'mean_word_length': 2.978217821782178, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4613337', 'n_tokens_mistral': 820, 'n_tokens_neox': 789, 'n_words': 195}