From 1ba83b8da52d441ed00bbea1d6e60f04d05001da Mon Sep 17 00:00:00 2001 From: jason Date: Wed, 17 Feb 2010 19:50:58 +0000 Subject: [PATCH] rollback Florent's changes that defaulted Bio::PrimarySeq instead of Bio::Seq creation of objects svn path=/bioperl-live/trunk/; revision=16847 --- Bio/Seq/SeqFactory.pm | 6 +++--- Bio/Seq/SeqFastaSpeedFactory.pm | 12 ++++++------ Bio/SeqIO/fasta.pm | 2 +- Bio/SeqIO/metafasta.pm | 4 ++-- t/SeqIO/fasta.t | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Bio/Seq/SeqFactory.pm b/Bio/Seq/SeqFactory.pm index f1a60a36d..d44140e21 100644 --- a/Bio/Seq/SeqFactory.pm +++ b/Bio/Seq/SeqFactory.pm @@ -82,7 +82,7 @@ use strict; use base qw(Bio::Root::Root Bio::Factory::SequenceFactoryI); -our $default_type = 'Bio::PrimarySeq'; +our $default_type = 'Bio::Seq'; =head2 new @@ -91,7 +91,7 @@ our $default_type = 'Bio::PrimarySeq'; Function: Builds a new Bio::Seq::SeqFactory object Returns : Bio::Seq::SeqFactory Args : -type => string, name of a PrimarySeqI derived class - This is optional. Default=Bio::PrimarySeq. + This is optional. Default=Bio::Seq =cut @@ -111,7 +111,7 @@ sub new { Function: Instantiates new Bio::SeqI (or one of its child classes) This object allows us to genericize the instantiation of sequence objects. - Returns : Bio::PrimarySeq object (default) + Returns : Bio::Seq object (default) The return type is configurable using new(-type =>"..."). Args : initialization parameters specific to the type of sequence object we want. Typically diff --git a/Bio/Seq/SeqFastaSpeedFactory.pm b/Bio/Seq/SeqFastaSpeedFactory.pm index a44b5f19e..5c12b7019 100644 --- a/Bio/Seq/SeqFastaSpeedFactory.pm +++ b/Bio/Seq/SeqFastaSpeedFactory.pm @@ -23,9 +23,9 @@ Bio::Seq::SeqFastaSpeedFactory - Rapid instantiation of new Bio::SeqI objects th my $seq = $factory->create(-seq => 'WYRAVLC', -id => 'name'); - # If you want the factory to create Bio::Seq objects instead - # of the default Bio::PrimarySeq objects, use the -type parameter: - my $factory = Bio::Seq::SeqFactory->new(-type => 'Bio::Seq'); + # If you want the factory to create Bio::PrimarySeq objects instead + # of the default Bio::Seq objects, use the -type parameter: + my $factory = Bio::Seq::SeqFactory->new(-type => 'Bio::PrimarySeq'); =head1 DESCRIPTION @@ -94,7 +94,7 @@ use base qw(Bio::Root::Root Bio::Seq::SeqFactory); Function: Builds a new Bio::Seq::SeqFastaSpeedFactory object Returns : Bio::Seq::SeqFastaSpeedFactory Args : -type => string, name of a PrimarySeqI derived class - This is optional. Default=Bio::PrimarySeq. + This is optional. Default=Bio::Seq. =cut @@ -114,7 +114,7 @@ sub new { Function: Instantiates new Bio::SeqI (or one of its child classes) This object allows us to genericize the instantiation of sequence objects. - Returns : Bio::PrimarySeq object (default) + Returns : Bio::Seq object (default) The return type is configurable using new(-type =>"..."). Args : initialization parameters specific to the type of sequence object we want. Typically @@ -157,7 +157,7 @@ sub create { $seq = $t_pseq; } else { # Should not have any other sequence type - $self->warn("Expected sequence type Bio::Seq or Bio::Primary. Got ". + $self->warn("Expected sequence type Bio::Seq or Bio::PrimarySeq. Got ". "$type. Defaulting to Bio::PrimarySeq\n"); $self->type('Bio::PrimarySeq'); $seq = $t_pseq; diff --git a/Bio/SeqIO/fasta.pm b/Bio/SeqIO/fasta.pm index 6103cab37..9871d7864 100644 --- a/Bio/SeqIO/fasta.pm +++ b/Bio/SeqIO/fasta.pm @@ -95,7 +95,7 @@ sub _initialize { my ($width) = $self->_rearrange([qw(WIDTH)], @args); $width && $self->width($width); unless ( defined $self->sequence_factory ) { - $self->sequence_factory(Bio::Seq::SeqFastaSpeedFactory->new(-type => 'Bio::PrimarySeq')); + $self->sequence_factory(Bio::Seq::SeqFastaSpeedFactory->new(-type => 'Bio::Seq')); } } diff --git a/Bio/SeqIO/metafasta.pm b/Bio/SeqIO/metafasta.pm index 4310bddb3..1d956152e 100644 --- a/Bio/SeqIO/metafasta.pm +++ b/Bio/SeqIO/metafasta.pm @@ -111,7 +111,7 @@ sub _initialize { my ($width) = $self->_rearrange([qw(WIDTH)], @args); $width && $self->width($width); unless ( defined $self->sequence_factory ) { - $self->sequence_factory(Bio::Seq::SeqFastaSpeedFactory->new(-type => 'Bio::PrimarySeq')); + $self->sequence_factory(Bio::Seq::SeqFastaSpeedFactory->new(-type => 'Bio::Seq')); } } @@ -176,7 +176,7 @@ sub next_seq { -alphabet => $alphabet, -direct => 1, ); - + $seq = $seq->primary_seq; bless $seq, 'Bio::Seq::Meta'; foreach my $meta (@metas) { diff --git a/t/SeqIO/fasta.t b/t/SeqIO/fasta.t index e04356567..32b3924bc 100644 --- a/t/SeqIO/fasta.t +++ b/t/SeqIO/fasta.t @@ -31,7 +31,7 @@ foreach my $method (@methods) { # checking the first sequence object my $seq_obj = $seqio_obj->next_seq(); -isa_ok($seq_obj, 'Bio::PrimarySeq'); +isa_ok($seq_obj, 'Bio::Seq'); my %expected = ('seq' => 'MVNSNQNQNGNSNGHDDDFPQDSITEPEHMRKLFIGGL' . 'DYRTTDENLKAHEKWGNIVDVVVMKDPRTKRSRGFGFI' . 'TYSHSSMIDEAQKSRPHKIDGRVEPKRAVPRQDIDSPN' . @@ -54,7 +54,7 @@ like ($seq_obj->description(), $expected{'description'}, 'description'); # checking the second sequence object my $seq_obj2 = $seqio_obj->next_seq(); -isa_ok($seq_obj2, 'Bio::PrimarySeq'); +isa_ok($seq_obj2, 'Bio::Seq'); my %expected2 = ('seq' => 'MVNSNQNQNGNSNGHDDDFPQDSITEPEHMRKLFIGGL' . 'DYRTTDENLKAHEKWGNIVDVVVMKDPTSTSTSTSTST' . 'STSTSTMIDEAQKSRPHKIDGRVEPKRAVPRQDIDSPN' . -- 2.11.4.GIT