[Bioperl-l] SimpleAlign Question

Iain Wallace iain.m.wallace at gmail.com
Sat Apr 8 12:29:08 EDT 2006

Hi all,

I am trying to extract slices out of an alignment, but sometimes the
slice I am trying to take contains a sequence that has no residues. I
would still like to add this sequence, unfortunately I am getting this

------------- EXCEPTION  -------------
MSG: Got a sequence with no letters in it cannot guess alphabet []
STACK Bio::PrimarySeq::_guess_alphabet
STACK Bio::PrimarySeq::seq /usr/lib/perl5/site_perl/5.8.0/Bio/PrimarySeq.pm:279
STACK Bio::SimpleAlign::slice

Is there a simple way I can override this behaviour, which I think is
just validating the sequence before it adds it to the alignment.

The code I am usinge is below followed by a test alignment,

Thanks for any help

use strict;

use Bio::AlignIO;
#read in the initial alignment from the command line.

my $in = $ARGV[0];

my $alignio = Bio::AlignIO->new(-file=> $in);
my $out = Bio::AlignIO->new(-file=> ">test.fasta");

       my $aln = $alignio->next_aln;
       my $new_aln = new Bio::SimpleAlign;

--sample file


More information about the Bioperl-l mailing list