[Bioperl-l] PrimarySeq object question

kevin.mcmahon at ttuhsc.edu kevin.mcmahon at ttuhsc.edu
Thu Dec 8 12:36:57 EST 2005


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
 


More information about the Bioperl-l mailing list