[Bioperl-l] question on simple align object

Shawn Hoon shawnh at stanford.edu
Fri Feb 6 17:09:32 EST 2004


use Bio::AlignIO;
use IO::String;

my $stringio = IO::String->new($string);
my $aout = Bio::AlignIO->new(-fh=>$stringio,-format=>'clustalw');

> my @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
> my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
>
> my $aln = $factory->align($seq_array_ref);

$aout->write_aln($aln);

print "Alignment\n".$string."\n";

something like above should work.

shawn


On Friday, February 6, 2004, at 1:43PM, Michael Cipriano wrote:

> Is there a way I can get a Simple Alignment object that I created from 
> a
> clustalw alignment into a string of a specific format? I do not want to
> deal with any files at all, I want to just be able to print the
> alignment from a cgi-script on a web page.
>
> So far I have this:
>
> # Create alignment
> my @params = ('ktuple' => 2, 'matrix' => 'BLOSUM');
> my $factory = Bio::Tools::Run::Alignment::Clustalw->new(@params);
>
> my $aln = $factory->align($seq_array_ref);
>
> I tried all sorts of things, but can't get specifically what I need
> (which is simply the whole alignment file as a msf formated string). I
> would like to not have to deal with any temporary files, unless there 
> is
> a way I can get to the temporary file that is created from the clustalw
> alignment and just stick that into a string.
>
> Thanks for any help in advance.
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list