[Bioperl-l] Bio::SimpleAlign, uniq_seq

Tristan Lefebure tristan.lefebure at gmail.com
Thu Apr 2 03:11:51 UTC 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
             differences.
 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:

--------test.fasta:
>seq1
AAATTTC
>seq2
CAATTTC
>seq3
AAATTTC
-------


----------test.pl:
#! /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;
        $out->write_aln($red_aln);
    }
-------------

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?

Thanks,

--Tristan
(BioPerl 1.6)






More information about the Bioperl-l mailing list