<commit_before>package Bio::EnsEMBL::GlyphSet::Pprotein;
use strict;
use vars qw(@ISA);
use Bio::EnsEMBL::GlyphSet;
@ISA = qw(Bio::EnsEMBL::GlyphSet);
use Sanger::Graphics::Glyph::Rect;
use Sanger::Graphics::Glyph::Text;

sub init_label {
    my ($self) = @_;
    return if( defined $self->{'config'}->{'_no_label'} );
    my $label = new Sanger::Graphics::Glyph::Text({
	'text'      => 'Peptide',
	'font'      => 'Small',
	'absolutey' => 1,
    });
    $self->label($label);
}

sub _init {
    my ($self) = @_;

    my $protein = $self->{'container'};
    my $Config  = $self->{'config'};
    my $y       = 0;
    my $h       = 4;
    my $colour  = $Config->get('Pprotein','col');

    my $rect = new Sanger::Graphics::Glyph::Rect({
	'x'        => 0,
	'y'        => $y,
	'width'    => $protein->length(),
	'height'   => $h,
	'id'       => $protein->id(),
	'colour'   => $colour,
    });
    
    $self->push($rect);
}

1;




















<commit_msg>add markup for  splice site on prot glyph<commit_after>package Bio::EnsEMBL::GlyphSet::Pprotein;
use strict;
use vars qw(@ISA);
use Bio::EnsEMBL::GlyphSet;
@ISA = qw(Bio::EnsEMBL::GlyphSet);
use Sanger::Graphics::Glyph::Rect;
use Sanger::Graphics::Glyph::Text;
use EnsEMBL::Web::GeneTrans::support;

sub init_label {
    my ($self) = @_;
    return if( defined $self->{'config'}->{'_no_label'} );
    my $label = new Sanger::Graphics::Glyph::Text({
	'text'      => 'Peptide',
	'font'      => 'Small',
	'absolutey' => 1,
    });
    $self->label($label);
}

sub _init {
    my ($self) = @_;
    my $protein = $self->{'container'};
	my $transcript = $protein->transcript();
	my $pep_splice = &EnsEMBL::Web::GeneTrans::support::prot_splice_site($transcript);
    my $Config  = $self->{'config'};
    my $x 		= 0;
	my $y       = 0;
    my $h       = 4; 
	my $flip = 0;
	my @colours  = ($Config->get('Pprotein','col1'), $Config->get('Pprotein','col2'));
	my $start_phase = 1;

	for my $exon_offset (sort { $a <=> $b } keys %$pep_splice){
	   my $colour = $colours[$flip];
	   my $exon_id = $pep_splice->{$exon_offset}{'exon'};
 	   my $rect = new Sanger::Graphics::Glyph::Rect({
		'x'        => $x,
		'y'        => $y,
		'width'    => $exon_offset - $x,
		'height'   => $h,
		'id'       => $protein->id(),
		'colour'   => $colour,
		'zmenu' => {
			'caption' => "Splice Information",
			"00:Exon: $exon_id" => "",
			"01:Start Phase: $start_phase" => "",
			'02:End Phase: '. ($pep_splice->{$exon_offset}{'phase'} +1) => "",
			'03:Length: '.($exon_offset - $x)  => "", },
    	});
  #/$ENV{'ENSEMBL_SPECIES'}/exonview?exon=$exon_id&db=$db
    $self->push($rect);
	$x = $exon_offset ;
	$start_phase = ($pep_splice->{$exon_offset}{'phase'} +1) ;
	$flip = 1-$flip;
	}
}
1;





















{'fraction_non_alphanumeric': 0.22984312294782927, 'fraction_numerical': 0.009120758847136081, 'mean_word_length': 3.186259541984733, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 50, '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': '7045877', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1088, 'n_words': 206}