Commit 5c4a5763 authored by Patrick Meidl's avatar Patrick Meidl
Browse files

changed display_id() to be more inventive to give the object a name

parent 23e02a2b
......@@ -793,7 +793,7 @@ sub peptide {
return Bio::Seq->new(-seq => $pep_str,
-moltype => 'protein',
-alphabet => 'protein',
-id => $self->stable_id);
-id => $self->display_id);
}
......@@ -841,7 +841,7 @@ sub seq {
}
return Bio::Seq->new(-seq => $self->{'_seq_cache'},
-id => $self->stable_id,
-id => $self->display_id,
-moltype => 'dna');
}
......@@ -910,8 +910,9 @@ sub hashkey {
Arg [1] : none
Example : print $exons->display_id();
Description: This method returns a string that is considered to be
the 'display' identifier. For exons this is the stable id if
it is available otherwise it is an empty string.
the 'display' identifier. For exons this is (depending on
availability and in this order) the stable Id, the dbID or an
empty string.
Returntype : string
Exceptions : none
Caller : web drawing code
......@@ -921,7 +922,7 @@ sub hashkey {
sub display_id {
my $self = shift;
return $self->{'stable_id'} || '';
return $self->{'stable_id'} || $self->dbID || '';
}
......
......@@ -949,8 +949,9 @@ sub recalculate_coordinates {
Arg [1] : none
Example : print $gene->display_id();
Description: This method returns a string that is considered to be
the 'display' identifier. For genes this is the stable id if
it is available otherwise it is an empty string.
the 'display' identifier. For genes this is (depending on
availability and in this order) the stable Id, the dbID or an
empty string.
Returntype : string
Exceptions : none
Caller : web drawing code
......@@ -960,7 +961,7 @@ sub recalculate_coordinates {
sub display_id {
my $self = shift;
return $self->{'stable_id'} || '';
return $self->{'stable_id'} || $self->dbID || '';
}
......
......@@ -456,9 +456,9 @@ sub get_all_Exons {
Arg [1] : none
Example : print $rf->display_id();
Description: This method returns a string that is considered to be
the 'display' identifier. For prediction transcripts this is
the stable_id if it is available otherwise it is an empty
string.
the 'display' identifier. For prediction transcripts this is
(depending on availability and in this order) the stable Id, the
dbID or an empty string.
Returntype : string
Exceptions : none
Caller : web drawing code
......@@ -468,7 +468,7 @@ sub get_all_Exons {
sub display_id {
my $self = shift;
return $self->stable_id() || '';
return $self->stable_id || $self->dbID || '';
}
......
......@@ -1276,7 +1276,7 @@ sub five_prime_utr {
return undef if(!$seq);
return Bio::Seq->new(
-DISPLAY_ID => $self->stable_id,
-DISPLAY_ID => $self->display_id,
-MOLTYPE => 'dna',
-SEQ => $seq);
}
......@@ -1311,7 +1311,7 @@ sub three_prime_utr {
return undef if(!$seq);
return Bio::Seq->new(
-DISPLAY_ID => $self->stable_id,
-DISPLAY_ID => $self->display_id,
-MOLTYPE => 'dna',
-SEQ => $seq);
}
......@@ -1419,15 +1419,7 @@ sub translate {
}
my $mrna = $self->translateable_seq();
my $display_id;
if( defined $self->translation->stable_id ) {
$display_id = $self->translation->stable_id;
} elsif ( defined $self->translation->dbID ) {
$display_id = $self->translation->dbID();
} else {
#use memory location as temp id
$display_id = scalar($self->translation());
}
my $display_id = $self->translation->display_id || scalar($self->translation);
# remove final stop codon from the mrna if it is present
# produced peptides will not have '*' at end
......@@ -1488,7 +1480,7 @@ sub translate {
sub seq {
my( $self ) = @_;
return Bio::Seq->new
(-DISPLAY_ID => $self->stable_id,
(-DISPLAY_ID => $self->display_id,
-MOLTYPE => 'dna',
-SEQ => $self->spliced_seq);
}
......@@ -2030,8 +2022,9 @@ sub recalculate_coordinates {
Arg [1] : none
Example : print $transcript->display_id();
Description: This method returns a string that is considered to be
the 'display' identifier. For transcripts this is the
stable id if it is available otherwise it is an empty string.
the 'display' identifier. For transcripts this is (depending on
availability and in this order) the stable Id, the dbID or an
empty string.
Returntype : string
Exceptions : none
Caller : web drawing code
......@@ -2041,7 +2034,7 @@ sub recalculate_coordinates {
sub display_id {
my $self = shift;
return $self->{'stable_id'} || '';
return $self->{'stable_id'} || $self->dbID || '';
}
......
......@@ -511,8 +511,9 @@ sub get_all_DomainFeatures{
Arg [1] : none
Example : print $translation->display_id();
Description: This method returns a string that is considered to be
the 'display' identifier. For translations this is the
stable id if it is available otherwise it is an empty string.
the 'display' identifier. For translations this is (depending on
availability and in this order) the stable Id, the dbID or an
empty string.
Returntype : string
Exceptions : none
Caller : web drawing code
......@@ -522,7 +523,7 @@ sub get_all_DomainFeatures{
sub display_id {
my $self = shift;
return $self->{'stable_id'} || '';
return $self->{'stable_id'} || $self->dbID || '';
}
......
Markdown is supported
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