From f5f5a7ae4dcc93fa736b1b2451b17af12f563915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kusalananda=20K=C3=A4h=C3=A4ri?= <ak4@sanger.ac.uk> Date: Thu, 1 Apr 2010 11:08:42 +0000 Subject: [PATCH] When creating a Bio::Seq object, always specify '-alphabet'. --- modules/Bio/EnsEMBL/Exon.pm | 17 +++++++----- modules/Bio/EnsEMBL/PredictionTranscript.pm | 12 ++++++--- modules/Bio/EnsEMBL/Transcript.pm | 30 ++++++++++++--------- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/modules/Bio/EnsEMBL/Exon.pm b/modules/Bio/EnsEMBL/Exon.pm index 7024500ed0..47ddd923db 100755 --- a/modules/Bio/EnsEMBL/Exon.pm +++ b/modules/Bio/EnsEMBL/Exon.pm @@ -1260,10 +1260,11 @@ sub peptide { $pep_str = $tr->translate->subseq($start, $end); } - return Bio::Seq->new(-seq => $pep_str, - -moltype => 'protein', - -alphabet => 'protein', - -id => $self->display_id); + return + Bio::Seq->new( -seq => $pep_str, + -moltype => 'protein', + -alphabet => 'protein', + -id => $self->display_id ); } @@ -1309,9 +1310,11 @@ sub seq { $self->{'_seq_cache'} = $seq; } - return Bio::Seq->new(-seq => $self->{'_seq_cache'}, - -id => $self->display_id, - -moltype => 'dna'); + return + Bio::Seq->new( -seq => $self->{'_seq_cache'}, + -id => $self->display_id, + -moltype => 'dna', + -alphabet => 'dna' ); } diff --git a/modules/Bio/EnsEMBL/PredictionTranscript.pm b/modules/Bio/EnsEMBL/PredictionTranscript.pm index 2767e5020a..8d00206a32 100644 --- a/modules/Bio/EnsEMBL/PredictionTranscript.pm +++ b/modules/Bio/EnsEMBL/PredictionTranscript.pm @@ -277,9 +277,10 @@ sub translation { $Xseq = "N"x$start_phase . $Xseq; } - my $tmpSeq = new Bio::Seq( -id => $self->display_id, - -seq => $Xseq, - -moltype => "dna" ); + my $tmpSeq = new Bio::Seq( -id => $self->display_id, + -seq => $Xseq, + -moltype => 'dna', + -alphabet => 'dna' ); return Bio::EnsEMBL::Translation->new (-ADAPTOR => $pta, @@ -335,7 +336,10 @@ sub translate { # if you want to have a terminal stop codon either comment this line out # or call translatable seq directly and produce a translation from it - my $bioseq = new Bio::Seq( -id => $self->display_id, -seq => $dna, -moltype => 'dna' ); + my $bioseq = new Bio::Seq( -id => $self->display_id, + -seq => $dna, + -moltype => 'dna', + -alphabet => 'dna' ); my $translation = $bioseq->translate(undef,undef,undef,$codon_table_id); diff --git a/modules/Bio/EnsEMBL/Transcript.pm b/modules/Bio/EnsEMBL/Transcript.pm index 89cd813eae..109434c55f 100755 --- a/modules/Bio/EnsEMBL/Transcript.pm +++ b/modules/Bio/EnsEMBL/Transcript.pm @@ -1405,10 +1405,11 @@ sub five_prime_utr { return undef if(!$seq); - return Bio::Seq->new( - -DISPLAY_ID => $self->display_id, - -MOLTYPE => 'dna', - -SEQ => $seq); + return + Bio::Seq->new( -id => $self->display_id, + -moltype => 'dna', + -alphabet => 'dna', + -seq => $seq ); } @@ -1439,10 +1440,11 @@ sub three_prime_utr { return undef if(!$seq); - return Bio::Seq->new( - -DISPLAY_ID => $self->display_id, - -MOLTYPE => 'dna', - -SEQ => $seq); + return + Bio::Seq->new( -id => $self->display_id, + -moltype => 'dna', + -alphabet => 'dna', + -seq => $seq ); } @@ -1626,11 +1628,13 @@ sub translate { =cut sub seq { - my( $self ) = @_; - return Bio::Seq->new - (-DISPLAY_ID => $self->display_id, - -MOLTYPE => 'dna', - -SEQ => $self->spliced_seq); + my ($self) = @_; + + return + Bio::Seq->new( -id => $self->display_id, + -moltype => 'dna', + -alphabet => 'dna', + -seq => $self->spliced_seq ); } -- GitLab