Switch branches/tags
tag-ensembl-stable-061 start snapshot-at-head-of-07-branch release-ensembl-06 release-06 release-06-2 release-1_01 release-1-7-2 release-1-7-1 release-1-7-0 release-1-7-0-RC6 release-1-7-0-RC5 release-1-7-0-RC4 release-1-6-zenodo release-1-6-924 release-1-6-923 release-1-6-922 release-1-6-921 release-1-6-920 release-1-6-910 release-0-9-3 release-0-9-2 release-0-9-0 release-0-7-2 release-0-7-1 release-0-7-0 release-0-05 release-0-05-1 release-0-04-4 release-0-04-3 release-0-04-2 release-0-04-1 prerelease-06 ontology-overhaul-start ontology-overhaul-end ontology-fix1 lightweight_feature join-0-04-to-0-05 gbrowse_1_65 for_gmod_0_003 bioperl-run-release-1-2-0 bioperl-release-1-6 bioperl-release-1-6-901 bioperl-release-1-6-9 bioperl-release-1-6-1 bioperl-release-1-5-2 bioperl-release-1-5-2-patch2 bioperl-release-1-5-2-patch1 bioperl-release-1-5-1 bioperl-release-1-5-1-rc4 bioperl-release-1-5-0 bioperl-release-1-5-0-rc2 bioperl-release-1-5-0-rc1 bioperl-release-1-4-0 bioperl-release-1-2-3 bioperl-release-1-2-2 bioperl-release-1-2-1 bioperl-release-1-2-0 bioperl-release-1-1-0 bioperl-release-1-0-2 bioperl-release-1-0-1 bioperl-release-1-0-0 bioperl-devel-1-3-04 bioperl-devel-1-3-03 bioperl-devel-1-3-02 bioperl-devel-1-3-01 bioperl-devel-1-1-1 bioperl-061-pre1 bioperl-06-1 bioperl-1-6-RC4 bioperl-1-6-RC3_15392 bioperl-1-6-RC3 bioperl-1-6-RC2_15306 bioperl-1-6-RC2 bioperl-1-6-RC1 bioperl-1-6-0_006 bioperl-1-6-0_005 bioperl-1-6-0_004 bioperl-1-6-0_003 bioperl-1-6-0_002 bioperl-1-6-0_001 bioperl-1-2-1-rc1 bioperl-1-0-alpha2-rc bioperl-1-0-alpha bioperl-1-0-0 before-05-to-06-trunk before-05-to-06-merge after004 after-05-06-merge after-05-06-merge-2
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 60 lines (51 sloc) 1.92 KB
#!/usr/bin/env perl
# Demonstrates the use of a SearchIO Blast parser for producing
# output of raw HSP data from a Blast report input stream.
# Shows how to print out raw BLAST alignment data for each HSP.
# Usage:
# STDIN: stream containing one or more BLAST or PSI-BLAST reports.
# STDOUT: Raw alignment data for each HSP of each hit (BLAST format)
# STDERR: Progress info and any errors.
# For more documentation about working with Blast result objects,
# see docs for these modules:
# Bio::Search::Result::BlastResult
# Bio::Search::Hit::BlastHit
# Bio::Search::HSP::BlastHSP
# For more documentation about the PSI-Blast parser, see docs for
# Bio::SearchIO::psiblast
# Author: Steve Chervitz <>
# * Implement a Bio::SearchIO::Writer::HSPTextWriter object
# that can do this. Then this example can fit into the standard
# model used by the other writer examples in which a writer
# object is created and hooked up with a SearchIO output object.
use strict;
use lib '../../';
use Bio::SearchIO;
# In this case, we only want raw alignments, and we only need to screen
# on significance info (E- or P-value) so we don't need
# to do a full parse of the alignments. Thus, we're using a -shalow_parse
# flag to indicate that we don't need to parse alignments. This should
# result in faster processing.
# TODO: Convert this to use -format='blast'. Shallow-parse option not supported there.
my $in = Bio::SearchIO->new(-format => 'psiblast',
-fh => \*ARGV,
-signif => 0.1,
-shallow_parse => 1,
-hold_raw_data => 1 );
while ( my $result = $in->next_result() ) {
print STDERR "\nBLAST Results for $result\n\n";
my $count = 0;
foreach( $result->hits ) {
print "Alignment for hit #", ++$count, "\n\n";
print $_->raw_hit_data();
print "=" x 50 , "\n";
printf STDERR "\n%d Blast report(s) processed.\n", $in->result_count;