[Bioperl-l] validate_species_name

Brian Osborne brian_osborne at cognia.com
Tue Sep 14 11:41:04 EDT 2004


Added "-" to that regular expression.

Brian O.

-----Original Message-----
From: bioperl-l-bounces at portal.open-bio.org
[mailto:bioperl-l-bounces at portal.open-bio.org]On Behalf Of Wes Barris
Sent: Tuesday, September 14, 2004 1:20 AM
To: Bioperl Mailing List
Subject: [Bioperl-l] validate_species_name

I am converting back and forth between genbank and fasta formats.
The NCBI accession "AY374167" is one of many genbank entries whos
ORGANISM is flagged as invalid when creating genbank output.
The bioperl error thrown is this:

------------- EXCEPTION  -------------
MSG: Invalid species name 'rosenbergii-Australia'
STACK Bio::Species::validate_species_name
STACK Bio::Species::classification
STACK toplevel /home/wes/proj/genbank/fastatogenbank.pl:29


The first few lines of the genbank file that I am trying to
match are:

LOCUS       AY374167                 867 bp    DNA     linear   INV
DEFINITION  Macrobrachium rosenbergii-Australia 18S ribosomal RNA gene,
VERSION     AY374167.1  GI:37675510
SOURCE      Macrobrachium rosenbergii-Australia
   ORGANISM  Macrobrachium rosenbergii-Australia
             Eukaryota; Metazoa; Arthropoda; Crustacea; Malacostraca;
             Eumalacostraca; Eucarida; Decapoda; Pleocyemata; Caridea;
             Palaemonoidea; Palaemonidae; Macrobrachium.

The relevant piece of bioperl code (Species.pm) is:

sub validate_species_name {
     my( $self, $string ) = @_;

     return 1 if $string eq "sp.";
     return 1 if $string =~ /^[a-z][\w\s]+$/i;
     $self->throw("Invalid species name '$string'");

I believe that a '-' could be added to the string test like this:

     return 1 if $string =~ /^[a-z][\w\s-]+$/i;

bioperl-live (as of today), redhat 8.
Wes Barris
E-Mail: Wes.Barris at csiro.au

Bioperl-l mailing list
Bioperl-l at portal.open-bio.org

More information about the Bioperl-l mailing list