Skip to content
Snippets Groups Projects
Commit 893438b2 authored by Web Admin's avatar Web Admin
Browse files

Added %age context on Gene based slices, tweaks to stable id fetches, and white space removal

parent 0364683f
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,14 @@ sub get_translation_archive_id {
my $self = shift;
if( $self->type() eq "Transcript" ) {
return $self->adaptor->fetch_by_transcript_archive_id( $self );
return [$self->adaptor->fetch_by_transcript_archive_id( $self )];
} elsif( $self->type() eq "Gene" ) {
my $transcripts = $self->adaptor->fetch_all_by_gene_archive_id( $self );
my @peptides ;
for (@$transcripts) {
push @peptides , $self->adaptor->fetch_by_transcript_archive_id( $_ );
}
return \@peptides;
} else {
return undef;
}
......
......@@ -468,10 +468,13 @@ sub fetch_by_gene_stable_id{
if( !defined $geneid ) {
$self->throw("Must have gene id to fetch Slice of gene");
}
if( !defined $size ) {$size=0;}
my ($chr_name,$start,$end) = $self->_get_chr_start_end_of_gene($geneid);
if( $size =~/([\d+\.]+)%/ ) {
$size = int($1/100 * ($end-$start+1));
}
if( !defined $size ) {$size=0;}
if( !defined $start ) {
my $type = $self->db->assembly_type()
or $self->throw("No assembly type defined");
......
......@@ -71,8 +71,6 @@ sub new {
return $self;
}
=head2 fetch_all_by_gene_id_list
Arg [1] : arrayref $gene_ids
......
......@@ -895,7 +895,6 @@ sub get_all_peptide_variations {
return \%out;
}
=head2 get_all_SNPs
Arg [1] : (optional) int $flanking
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment