[Bioperl-l] SimpleAlign object

Jason Stajich jason at bioperl.org
Fri May 22 03:51:05 UTC 2009


I'm not sure what you *want* to print in "alignment" section? you have  
the "actual alignment" as an object. It looks like you already got  
that alignment object with get_aln() from your HSP- did you look at  
the documentation for that method?  You can also get the query/hit/ 
homology strings with methods called on the HSP object.  The SearchIO  
HOWTO describes this.

See Bio::SearchIO::Writer::TextResultWriter if you want to reformat a  
blast report.

Or if you want to write it out in a Multiple alignment format (multi- 
fasta, clustalw, phylip, etc)  with Bio::AlignIO

You can use IO::String to write the sequence into a string instead of  
to a file/STDOUT if you want to format things in your script

my $str = IO::String->new;
my $alnio = Bio::AlignIO->new(-format => 'clustalw', -fh => $str);
$alnio->write_aln($str);
The alignment formatted as a string is now in $str->string_ref so you  
can access it from ${str->string_ref}


On May 21, 2009, at 8:38 PM, Mgavi Brathwaite wrote:

> Hello,
>
> I am parsing a blast report. My script is returning the following  
> output to file:
>
> Name: 13414|HD
> Percent Identity:  100
> Alignment:  Bio::SimpleAlign=HASH(0x40d0ac4)
> How do I access " Bio::SimpleAlign=HASH(0x40d0ac4)" actual alignment  
> for this object?
>
> LomSpace

Jason Stajich
jason at bioperl.org







More information about the Bioperl-l mailing list