[Bioperl-l] Bio::Tools::Run::Alignment::ClustalW output redirect?

Ryan Golhar golharam at umdnj.edu
Sun Jun 25 03:03:01 UTC 2006


Thanks Chris.  It is in fact when you call align() that clustalw
generates the output that you see on the console.  The alignment is
generates I'm parsing right away.  Here's the output (an example) of
what I'm referring to:

-- BEGIN --
 CLUSTAL W (1.83) Multiple Sequence Alignments



Sequence format is Pearson
Sequence 1: human           271 aa
Sequence 2: mouse           264 aa
Start of Pairwise alignments
Aligning...
Sequences (1:2) Aligned. Score:  90
Guide tree        file created:   [/tmp/TX4yxP9uKQ/80W87TkT5Z.dnd]
Start of Multiple Alignment
There are 1 groups
Aligning...
Group 1: Sequences:   2      Score:5469
Alignment Score 1480
GCG-Alignment file created      [/tmp/TX4yxP9uKQ/xE4GNyY7Rc]
-- END --

How do I get this to do to stderr instead of stdout? 

Ryan


-----Original Message-----
From: Chris Fields [mailto:cjfields at uiuc.edu] 
Sent: Saturday, June 24, 2006 9:22 PM
To: golharam at umdnj.edu; bioperl-l at bioperl.org
Subject: RE: [Bioperl-l] Bio::Tools::Run::Alignment::ClustalW output
redirect?


According to the docs ( ;> ) the default behaviour is to return "a
BioPerl Bio::SimpleAlign object which can then be printed and/or saved
in multiple formats using the AlignIO.pm module"; you should be able to
do something
like:

use Bio::AlignIO;
...
my $aln_factory = Bio::Tools::Run::Alignment::Clustalw->new();
my $aa_aln = $aln_factory->align(\@aa_seq);

my $al_out = Bio::AlignIO::new(-format => 'clustalw',
                               -fh     => \*STDERR);

$al_out->write_aln($aa_aln);

Chris

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l- 
> bounces at lists.open-bio.org] On Behalf Of Ryan Golhar
> Sent: Saturday, June 24, 2006 5:37 PM
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] Bio::Tools::Run::Alignment::ClustalW output 
> redirect?
> 
> I'm using Bio::Tools::Run::Alignment::ClustalW to generate some 
> alignments and parsing the resulting alignments.
> 
> The ClustalW output is being sent to STDOUT.  Is there a way I can 
> redirect the output to STDERR instead?
> 
> Here's how I'm using it:
> 
> my $aln_factory = Bio::Tools::Run::Alignment::Clustalw->new();
> my $aa_aln = $aln_factory->align(\@aa_seq);
> 
> (Forgive me if it in the docs - I've been coding for a week straight 
> now including saturday)
> 
> Thanks, Ryan
> 
> _______________________________________________
> 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