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

Clarke, Wayne ClarkeW at AGR.GC.CA
Tue Jun 20 13:44:42 EDT 2006


Hi all, 

It seems that there is a newline character which is causing the problem,
this wasn't obvious at first due to the size of my shell window but that
is what is giving the mismatch error. Thanks to Chris and Torsten for
the help and for pointing me in the direction of validate_seq which was
helpful in finding the problem.

Cheers, 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




More information about the Bioperl-l mailing list