[Bioperl-l] Bio::SimpleAlign, uniq_seq

Mark A. Jensen maj at fortinbras.us
Wed Apr 1 23:28:23 EDT 2009


Tristan--
Strange: it looks like the prints to stderr have been commented out in the
source (back in revision 10242; 1.6 is rev 15582). The
two statements are easy to find in the SimpleAlign.pm uniq_seq() source; you can
uncomment them to work around this.
You are right, this is rather an unconventional way to specify an output
option-- can Chris comment?
Mark
----- Original Message ----- 
From: "Tristan Lefebure" <tristan.lefebure at gmail.com>
To: "BioPerl List" <bioperl-l at lists.open-bio.org>
Sent: Wednesday, April 01, 2009 11:11 PM
Subject: [Bioperl-l] Bio::SimpleAlign, uniq_seq


> 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)
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> 




More information about the Bioperl-l mailing list