[Bioperl-l] SeqIO fails on masked sequences
nathanhaigh at ukonline.co.uk
Thu Dec 16 05:31:15 EST 2004
When I use the script you supplied, I get the exception shown below.
I'll try to get to the bottom of this.
In the meantime, what OS are you both using and what version of Bioperl?
------------- EXCEPTION: Bio::Root::Exception -------------
MSG: Got a sequence with no letters in it cannot guess alphabet 
STACK: Bio::Root::Root::throw I:/Programming/Perl/perl5.8.0/site/lib/Bio/Root/Root.pm:328
STACK: Bio::PrimarySeq::_guess_alphabet I:/Programming/Perl/perl5.8.0/site/lib/Bio/PrimarySeq.pm:837
STACK: Bio::Seq::SeqFastaSpeedFactory::create I:/Programming/Perl/perl5.8.0/site/lib/Bio/Seq/SeqFastaSpeedFactory.pm:134
STACK: Bio::SeqIO::fasta::next_seq I:/Programming/Perl/perl5.8.0/site/lib/Bio\SeqIO\fasta.pm:141
> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org [mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of Marc Logghe
> Sent: 16 December 2004 09:27
> To: Wes Barris
> Cc: Bioperl Mailing List
> Subject: RE: [Bioperl-l] SeqIO fails on masked sequences
> Hi Wes,
> > > Guess you can do it by setting the alphabet explicitely:
> > > $seq_in->alphabet('dna'); # or 'rna' or 'protein'
> > Sorry, that does not work. I tried this and got the same error:
> Yeah, some strange things seem to happen. You can set it this way but it is not taken into account anyhow by Bio::SeqIO::fasta:
> it is set and there is a sequence found, it is boldly set to undef !!!
> In object creation the type is guessed anyhow and in your case it ends up as protein because of the X's. It would end up as dna if
> were N's, though.
> > > Indirectly, you can do it also by setting the alphabet for
> > the factory object and passing the factory object with the
> > Bio::SeqIO constructor.
> > Would you provide an example?
> Think that did not make sense, sorry for that.
> On the other hand I was not able to mimick your problem generating the error. I got no errors, only the fact that the alphabet was
> to 'protein'. Initially I got a similar error but that was caused by the fact that $format was not set yet and I did not run using
> The script I used to find that out:
> use strict;
> use Bio::SeqIO;
> use Data::Dumper;
> my $format = 'fasta';
> my $seq_in = Bio::SeqIO->new(-format=>$format, -fh => \*DATA);
> my $seq_out = Bio::SeqIO->new(-format=>$format, -fh => \*STDOUT);
> my $seq = $seq_in->next_seq;
> print Data::Dumper->Dump([$seq],['seq']);
> I am afraid I can not be of more help here.
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> avast! Antivirus: Inbound message clean.
> Virus Database (VPS): 0451-1, 14/12/2004
> Tested on: 16/12/2004 10:00:11
> avast! is copyright (c) 2000-2003 ALWIL Software.
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0451-1, 14/12/2004
Tested on: 16/12/2004 10:30:08
avast! is copyright (c) 2000-2003 ALWIL Software.
More information about the Bioperl-l