[Bioperl-guts-l] bioperl-live/Bio/DB/Taxonomy flatfile.pm, 1.19, 1.20

Senduran Balasubramaniam sendu at dev.open-bio.org
Wed Jan 10 06:52:45 EST 2007


Update of /home/repository/bioperl/bioperl-live/Bio/DB/Taxonomy
In directory dev.open-bio.org:/tmp/cvs-serv25996/Bio/DB/Taxonomy

Modified Files:
	flatfile.pm 
Log Message:
get_taxonids can now search for synonym names with user-input underscores intead of spaces, just like entrez

Index: flatfile.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/DB/Taxonomy/flatfile.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** flatfile.pm	24 Oct 2006 14:23:49 -0000	1.19
--- flatfile.pm	10 Jan 2007 11:52:42 -0000	1.20
***************
*** 207,211 ****
  sub get_taxonids {
      my ($self, $query) = @_;
!     my $ids = $self->{'_name2id'}->{lc($query)} || return;
      my @ids = split(SEPARATOR, $ids);
      return wantarray() ? @ids : shift @ids;
--- 207,219 ----
  sub get_taxonids {
      my ($self, $query) = @_;
!     my $ids = $self->{'_name2id'}->{lc($query)};
!     unless ($ids) {
!         if ($query =~ /_/) {
!             # try again converting underscores to spaces
!             $query =~ s/_/ /g;
!             $ids = $self->{'_name2id'}->{lc($query)};
!         }
!         $ids || return;
!     }
      my @ids = split(SEPARATOR, $ids);
      return wantarray() ? @ids : shift @ids;



More information about the Bioperl-guts-l mailing list