<commit_before>package CoGe::Graphics::Feature::Gene;
use strict;
use base qw(CoGe::Graphics::Feature);


=head1 AUTHOR

	<NAME>
	<EMAIL>

=head1 COPYRIGHT

Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies, modifications, and distributions. Contact The Office of Technology Licensing, UC Berkeley, 2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620, (510) 643-7201, for commercial licensing opportunities.

The full text of the license can be found in the
LICENSE file included with this module.

=cut

BEGIN {
    use vars qw($VERSION $HEIGHT $BLOCK_HEIGHT);
    $VERSION     = '0.1';
    $HEIGHT = 25;
    $BLOCK_HEIGHT = 20;
    __PACKAGE__->mk_accessors(
"block_height",
"segments", 
"print_label", #flag for printing feature label in gene
"add_type", #flag to set if gene type should be appended to label
"no_3D", #switch between flat images and "3D" images, if given value, use flat images
"arrow_width", #width of arrow in pixels
"sequence",#store the sequence
"color_by_codon",#flag for coloring CDS by codon
"codon_limit",#number of codons to evaluate (5')
);
}

sub start
  {
    my $self = shift;
    return unless $self->segments;
    return $self->segments->[0][0];
  }

sub stop
  {
    my $self = shift;
    return unless $self->segments;
    return $self->segments->[-1][-1];
  }

sub add_segment
  {
    my $self = shift;
    my %opts = @_;
    my $start = $opts{start} || $opts{begin} || $opts{START} || $opts{BEGIN};
    my $stop = $opts{stop} || $opts{end} || $opts{STOP} || $opts{END};<commit_msg>update sub start and stop to accept values to set the first and last segments to new positions respectively<commit_after>package CoGe::Graphics::Feature::Gene;
use strict;
use base qw(CoGe::Graphics::Feature);


=head1 AUTHOR

	<NAME>
	<EMAIL>

=head1 COPYRIGHT

Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensing agreement, is hereby granted, provided that the above copyright notice, this paragraph and the following two paragraphs appear in all copies, modifications, and distributions. Contact The Office of Technology Licensing, UC Berkeley, 2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620, (510) 643-7201, for commercial licensing opportunities.

The full text of the license can be found in the
LICENSE file included with this module.

=cut

BEGIN {
    use vars qw($VERSION $HEIGHT $BLOCK_HEIGHT);
    $VERSION     = '0.1';
    $HEIGHT = 25;
    $BLOCK_HEIGHT = 20;
    __PACKAGE__->mk_accessors(
"block_height",
"segments", 
"print_label", #flag for printing feature label in gene
"add_type", #flag to set if gene type should be appended to label
"no_3D", #switch between flat images and "3D" images, if given value, use flat images
"arrow_width", #width of arrow in pixels
"sequence",#store the sequence
"color_by_codon",#flag for coloring CDS by codon
"codon_limit",#number of codons to evaluate (5')
);
}

sub start
  {
    my $self = shift;
    my $val = shift;
    if ($val) {$self->segments->[0][0] = $val;}
    return unless $self->segments;
    return $self->segments->[0][0];
  }

sub stop
  {
    my $self = shift;
    my $val = shift;
    if ($val) {$self->segments->[-1][-1] = $val;}
    return unless $self->segments;
    return $self->segments->[-1][-1];
  }

sub add_segment
  {
    my $self = shift;
    my %opts = @_;
    my $start = $opts{start} || $opts{begin} || $opts{START} || $opts{BEGIN};
    my $stop = $opts{stop} || $opts{end} || $opts{STOP} || $opts{END};
{'fraction_non_alphanumeric': 0.11951983298538622, 'fraction_numerical': 0.02244258872651357, 'mean_word_length': 4.200814111261873, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '2761582', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1185, 'n_words': 453}