[Bioperl-l] Bio::Species irritated with "unclassified sequences"

Dave Messina David.Messina at sbc.su.se
Wed May 26 09:24:11 UTC 2010


Hi Charles,

Thanks for your report.

I believe your interpretation of Bio::Species::classification is correct. It looks like this is going to require a little more investigation. 

Could you please submit this as a bug report along with a little test case?

http://www.bioperl.org/wiki/Bugs


Dave




On May 20, 2010, at 22:27, Charles Tilford wrote:

> Bio::Species::classification() is irritated with me when I provide it with a @class_array that is composed of one node, particularly:
> 
> $obj->classification("unclassified sequences")
> 
> AFAICT this is a valid, single node taxa "tree":
> 
> http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=12908
> 
> Subroutine classification is expecting at least two class members, the problem with the above call crops up as:
> 
> Use of uninitialized value $vals[1] in quotemeta at /stf/biocgi/tilfordc/patch_lib/Bio/Species.pm line 179
> ( $Id: Species.pm 16700 2010-01-15 19:50:11Z dave_messina $)
> 
> 
> ... and the relevant code is:
> 
> sub classification {
>    my ($self, @vals) = @_;
> 
>    if (@vals) {
>        if (ref($vals[0]) eq 'ARRAY') {
>            @vals = @{$vals[0]};
>        }
> 
>        # make sure the lineage contains us as first or second element
>        # (lineage may have subspecies, species, genus ...)
>        my $name = $self->node_name;
>        my ($genus, $species) = (quotemeta($vals[1]), quotemeta($vals[0]));
> 
> 
> That is, it's expecting at least (species, genus) in the array. Am I misusing classification(), or Bio::Species in general? I know it's named "Species", but I've been using it as a generic tree object for arbitrary taxonomy nodes, not just species and subspecies. This block a little lower down:
> 
>        unless ($self->rank) {
>            # and that we are rank species
>            $self->rank('species');
>        }
> 
> 
> ... implies that the module can be used for taxa ranks other than species. However, doing so would not prevent the module being aggravated over a null $vals[1].
> 
> The use case here is building Bio::Seq::RichSeq objects pulled from a (very large) sequence database, and then dumped / displayed with SeqIO. Most are well behaved, but there's a non-trivial number of 'artificial' constructs that don't root to an organism.
> 
> -CAT
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list