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

Clarke, Wayne ClarkeW at AGR.GC.CA
Tue Jun 20 16:57:34 UTC 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
/usr/lib/perl5/site_perl/5.8.0/Bio/Root/Root.pm:328
STACK: Bio::PrimarySeq::seq
/usr/lib/perl5/site_perl/5.8.0/Bio/PrimarySeq.pm:267
STACK: Bio::PrimarySeq::new
/usr/lib/perl5/site_perl/5.8.0/Bio/PrimarySeq.pm:217
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
name  

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

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
work."
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
the
sequence.  The problem is, I don't think validate_seq (from PrimarySeq
and
where the warning came from) distinguishes between nucleotides and amino
acids, and it allows for '*' and various gap symbols in sequences.  If
this
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;
hence
the mismatch is 1.  What do you get printing $hash using Data::Dumper?
I
tried using this anon hash and it work fine when a new Bio::Seq is
constructed.

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

Chris

> -----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
code
> 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      =>
$hash->{'Sequence'});
> 
>           $handle->write_seq($seq);
> 
>           # print("Sequence: ".$hash->{'Sequence'}."\n");
> 
>      }
> 
> 
> 
> For some reason it is failing on a particular sequence, which is a
valid
> DNA sequence. If anyone has any ideas on why this is I would
appreciate
> 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-0004.obj>


More information about the Bioperl-l mailing list