[Bioperl-l] SearchIO HOWTO
Chris Fields
cjfields at uiuc.edu
Wed Jul 19 10:44:30 EDT 2006
The information in that table is referring to the BLAST report example
before the table itself. However, I can tell you that using that report
works (sorry if the text wrapping here mangles the output), so the table
information is erroneous. I'll do some updating on that.
Chris
Here's the script:
use Bio::SearchIO;
use Bio::AlignIO;
my $parser = Bio::SearchIO->new (-file => shift @ARGV,
-format => 'blast');
my $aln_out = Bio::AlignIO->new(-fh => \*STDOUT,
-format => 'clustalw');
while (my $result = $parser->next_result) {
while (my $hit = $result->next_hit) {
while (my $hsp = $hit->next_hsp) {
$aln_out->write_aln($hsp->get_aln);
}
}
}
Output (via STDOUT):
------------------------------------
CLUSTAL W(1.81) multiple sequence alignment
gi|20521485|dbj|AP004641.2/2896-3051
DMGRCSSGCNRYPEPMTPDTMIKLYREKEGLGAYIWMPTPDMSTEGRVQMLP
gb|443893|124775/197-246
DIVQNSSGCNRYPEPMTPDTMIKLYRE-EGL-AYIWMPTPDMSTEGRVQMLP
*: : ********************** ***
********************
------------------------------------
> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Bernd Web
> Sent: Wednesday, July 19, 2006 6:36 AM
> To: bioperl-l at bioperl.org
> Subject: [Bioperl-l] SearchIO HOWTO
>
> Hi,
>
> On http://www.bioperl.org/wiki/HOWTO:SearchIO there is a great HOWTO
> parse your BLAST report.
> In the Table of methods, the third line from the bottom is:
> "HSP alignment Not available in this report Bio::SimpleAlign object "
>
> Would it not be good to add the get_aln method ( $hsp->get_aln) ?
>
> The line in "Using the methods"
> my $alignment_as_string = $alnIO->write_aln($aln);
>
> may be confusing: $alignment_as_string will be "1" on success and the
> alignment is printed to STDIO. Should IO::String be introduced here
> too set up a string filehandle?
>
>
> Best regards,
> Bernd
> _______________________________________________
> 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