[Bioperl-l] Bio::SimpleAlign, uniq_seq

Tristan Lefebure tristan.lefebure at gmail.com
Wed Apr 1 23:11:51 EDT 2009

Hi there,

I'm trying to use the uniq_seq function from the Bio::SimpleAlign module.
Here is the description:

 Title     : uniq_seq
 Usage     : $aln->uniq_seq():  Remove identical sequences in
             in the alignment.  Ambiguous base ("N", "n") and
             leading and ending gaps ("-") are NOT counted as
 Function  : Make a new alignment of unique sequence types (STs)
 Returns   : 1. a new Bio::SimpleAlign object (all sequences renamed as "ST")
             2. ST of each sequence in STDERR
 Argument  : None

What I'm trying to obtain is the ST composition (i.e. what is supposed to go 
to STDERR), but I see nothing...

An example:


#! /usr/bin/perl

use strict;
use warnings;
use Bio::AlignIO;
use Bio::SimpleAlign;
use Getopt::Long;

my $in  = Bio::AlignIO->new(-file   => 'test.fasta' ,
                             -format => 'fasta');

my $out = Bio::AlignIO->new(-file   => ">test.out" ,
                             -format => 'fasta');

while ( my $aln = $in->next_aln() ) {
	my $red_aln = $aln->uniq_seq;

If you run:

	./test.pl &> log

you will get nothing written into the log file... (but the test.out is OK)

Am I missing something?
By the way, wouldn't it be more convenient to have the ST composition returned 
in an array?


(BioPerl 1.6)

More information about the Bioperl-l mailing list