[Bioperl-l] PrimarySeq object question
Heikki Lehvaslaiho
heikki at sanbi.ac.za
Fri Dec 9 01:52:48 EST 2005
Kevin,
The message you get comes from Bio::Seq::SeqWithQuality module. It could be
argued that it is overzealous to throw an exception if it can not find a
sequence. Also, the message comes after it has come to the conclusion that
you have not set the alphabet that, according to your code snippet, you have.
Report this as a bug to bugzilla.bioperl.org and make sure you attach an
example scf file.
Meanwhile, you can always avoid exiting from you code by wrapping the code
within the eval statement.
eval {
# your code
}; # note the ';'
if ($@) {
# do something else
}
Yours,
-Heikki
On Thursday 08 December 2005 19:36, kevin.mcmahon at ttuhsc.edu wrote:
> Everyone,
>
> I'm new to this, so please bear with me.
>
> I'm having some trouble with a scf to fasta converting program I'm writing.
>
> my $in = Bio::SeqIO->new(-file => $infile , '-format' => 'scf',
> -alphabet => 'dna');
>
> my $seq = $in->next_seq();
> print "My sequence is: " . $seq->seq() . "\n";
>
> Above is the code in discussion. The $in object contains information from
> a file ($infile) in scf format.
>
> Here's my problem. When we get to $in->next_seq(), if the file is empty,
> the program dies and returns:
>
> "MSG: If you want me to create a PrimarySeq object for your empty sequence
> <boggle> you must specify a -alphabet to satisfy the constructor
> requirements for a Bio::PrimarySeq object with no sequence. Read the POD
> for it, luke."
>
> I guess what I need to know is: if this $in->next_seq() doesn't work, how
> can I test for this before I get this reply.
>
> Thanks in advance,
>
> Wyatt
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
--
______ _/ _/_____________________________________________________
_/ _/
_/ _/ _/ Heikki Lehvaslaiho heikki at_sanbi _ac _za
_/_/_/_/_/ Associate Professor skype: heikki_lehvaslaiho
_/ _/ _/ SANBI, South African National Bioinformatics Institute
_/ _/ _/ University of the Western Cape, South Africa
_/ Phone: +27 21 959 2096 FAX: +27 21 959 2512
___ _/_/_/_/_/________________________________________________________
More information about the Bioperl-l
mailing list