From 06b5d0db4c62821db55b45e193308ddaad8c1232 Mon Sep 17 00:00:00 2001 From: lapp Date: Mon, 10 Mar 2003 21:53:56 +0000 Subject: [PATCH] Sync'ed RichSeqI with the implementation. RichSeq provides backward compatibility to the old API. Fixed doc bug in SimpleValue. svn path=/bioperl-live/trunk/; revision=5736 --- Bio/Annotation/SimpleValue.pm | 3 ++- Bio/Seq/RichSeq.pm | 2 +- Bio/Seq/RichSeqI.pm | 33 ++++++++++++++++++++++++--------- t/Taxonomy.t | 1 + 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Bio/Annotation/SimpleValue.pm b/Bio/Annotation/SimpleValue.pm index fe54b3ff8..e2e3fd50f 100644 --- a/Bio/Annotation/SimpleValue.pm +++ b/Bio/Annotation/SimpleValue.pm @@ -221,7 +221,8 @@ sub value{ Example : Returns : a L compliant object, or undef - Args : on set, new value (a scalar or undef, optional) + Args : on set, new value (a L compliant + object or undef, optional) =cut diff --git a/Bio/Seq/RichSeq.pm b/Bio/Seq/RichSeq.pm index 7e8ed6b8d..715bcb8f7 100644 --- a/Bio/Seq/RichSeq.pm +++ b/Bio/Seq/RichSeq.pm @@ -131,7 +131,7 @@ sub new { defined $division && $self->division($division); defined $mol && $self->molecule($mol); if(defined($keywords)) { - if(ref($keywords) eq "ARRAY") { + if(ref($keywords) && (ref($keywords) eq "ARRAY")) { $self->add_keyword(@$keywords); } else { # got a string - use the old API diff --git a/Bio/Seq/RichSeqI.pm b/Bio/Seq/RichSeqI.pm index b3a9ca9ff..b7a93ddcb 100644 --- a/Bio/Seq/RichSeqI.pm +++ b/Bio/Seq/RichSeqI.pm @@ -12,7 +12,7 @@ =head1 NAME -Bio::Seq::RichSeqI - RichSeq interface, mainly for database orientated sequences +Bio::Seq::RichSeqI - interface for sequences from rich data sources, mostly databases =head1 SYNOPSIS @@ -22,7 +22,7 @@ Bio::Seq::RichSeqI - RichSeq interface, mainly for database orientated sequences @dates = $richseq->get_dates; $seq_version = $richseq->seq_version; $pid = $richseq->pid; - $keywords = $richseq->keywords; + @keywords = $richseq->get_keywords; =head1 DESCRIPTION @@ -80,6 +80,11 @@ use Bio::SeqI; Title : get_secondary_accessions Usage : Function: Get the secondary accessions for a sequence. + + An implementation that allows modification of this array + property should provide the methods add_secondary_accession + and remove_secondary_accessions, with obvious purpose. + Example : Returns : an array of strings Args : none @@ -165,6 +170,11 @@ sub pid { Usage : Function: Get (and set, depending on the implementation) the dates the databank entry specified for the sequence + + An implementation that allows modification of this array + property should provide the methods add_date and + remove_dates, with obvious purpose. + Example : Returns : an array of strings Args : @@ -200,18 +210,23 @@ sub seq_version{ } -=head2 keywords +=head2 get_keywords - Title : keywords - Usage : $obj->keywords($newval) - Function: - Returns : value of keywords (a string) - Args : newvalue (optional) (a string) + Title : get_keywords + Usage : $obj->get_keywords() + Function: Get the keywords for this sequence object. + + An implementation that allows modification of this array + property should provide the methods add_keyword and + remove_keywords, with obvious purpose. + + Returns : an array of strings + Args : =cut -sub keywords { +sub get_keywords { my ($self) = @_; $self->throw("hit keywords in interface definition - error"); } diff --git a/t/Taxonomy.t b/t/Taxonomy.t index 1f8549fce..5eb51ef61 100644 --- a/t/Taxonomy.t +++ b/t/Taxonomy.t @@ -31,6 +31,7 @@ unless( $n ) { ok($n->ncbi_taxid, 9606); ok($n->division, 'mammals'); } +sleep(3); my $yeastid = $db->get_taxaid('Saccharomyces cerevisiae'); ok($yeastid, 4932); -- 2.11.4.GIT