[Bioperl-l] Bio::Root::Exception when using Bio::Seq

Clarke, Wayne ClarkeW at AGR.GC.CA
Tue Jun 20 12:57:34 EDT 2006

The Bioperl version is 1.4, the OS is Redhat linux fedora core 4, the
trace is 
STACK: Error::throw
STACK: Bio::Root::Root::throw
STACK: Bio::PrimarySeq::seq
STACK: Bio::PrimarySeq::new
STACK: Bio::Seq::new /usr/lib/perl5/site_perl/5.8.0/Bio/Seq.pm:498
STACK: /home/wayne/bin/mast_fasta.pl:59

And the full script is attached. 

However I would like to clarify that the actual sequence is not ACTG*,
this was a notation to represent that I had checked it to be sure that
it was a valid DNA sequence but due to confidentiality I cannot disclose
the actual sequence. I know this makes it more difficult and that I
perhaps should have been clearer about this originally. The $handle is a
Bio::SeqIO object. When I use Data::Dumper I get a printout of the clone

'Clone_Name' => 'sJ1485'
then the error message. I hope this is more helpful than my last

Thanks, Wayne

-----Original Message-----
From: Chris Fields [mailto:cjfields at uiuc.edu] 
Sent: Monday, June 19, 2006 9:23 PM
To: Clarke, Wayne; bioperl-l at lists.open-bio.org
Subject: RE: [Bioperl-l] Bio::Root::Exception when using Bio::Seq

You really haven't given us much to work with more than "this doesn't
We need the following information, otherwise we can't do anything.  

1)  Bioperl version (1.4, 1.5.1, live)
2)  OS
3)  The exception trace (not just the chunk you've shown)
4)  The full script.  What is $handle?  A Bio::SeqIO object?  

At first glance I would say Torsten's right, that it could be the '*' in
sequence.  The problem is, I don't think validate_seq (from PrimarySeq
where the warning came from) distinguishes between nucleotides and amino
acids, and it allows for '*' and various gap symbols in sequences.  If
caused the problem, the error would be: 

MSG: seq doesn't validate, mismatch is *

The actual error is:

MSG: seq doesn't validate, mismatch is 1

It looks like something is being evaluated in the wrong context (scalar
context is expected, but looks like it's evaluating a list).  Maybe it
thinks $hash->{'Sequence'} is a complex data type such as an array;
the mismatch is 1.  What do you get printing $hash using Data::Dumper?
tried using this anon hash and it work fine when a new Bio::Seq is

my $hash = {'Clone_Name' => 'test',
            'Sequence'   => 'ACTG*'};


> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Clarke, Wayne
> Sent: Monday, June 19, 2006 5:35 PM
> To: bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] Bio::Root::Exception when using Bio::Seq
> Hi,
> I am getting the following warning and then exception
> -------------------- WARNING ---------------------
> MSG: seq doesn't validate, mismatch is 1
> ---------------------------------------------------
> ------------- EXCEPTION: Bio::Root::Exception -------------
> MSG: Attempting to set the sequence to [ACTG*] which does not look
> healthy
> NOTE: ACTG* represents a sequence of those 4 characters(a valid DNA
> sequence)
> when extracting display name and sequence from a MYSQL database. My
> is as follows:
> my $sql = "select Clone_Name,Sequence from tbl_bgene";
>      my $sth = $dbh->prepare($sql);
>      $sth->execute();
>      while (my $hash = $sth->fetchrow_hashref()) {
>           # print("Name: ".$hash->{'Clone_Name'}."\n");
>           my $seq = new Bio::Seq(  -display_id     =>
> $hash->{'Clone_Name'},
>                                    -seq      =>
>           $handle->write_seq($seq);
>           # print("Sequence: ".$hash->{'Sequence'}."\n");
>      }
> For some reason it is failing on a particular sequence, which is a
> DNA sequence. If anyone has any ideas on why this is I would
> it.
> Thanks, Wayne
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mast_fasta.pl
Type: application/octet-stream
Size: 1998 bytes
Desc: mast_fasta.pl
Url : http://lists.open-bio.org/pipermail/bioperl-l/attachments/20060620/53770697/attachment.obj 

More information about the Bioperl-l mailing list