-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblast.pl
More file actions
38 lines (31 loc) · 856 Bytes
/
blast.pl
File metadata and controls
38 lines (31 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /usr/bin/perl -w
#handle blast report file
#by wb 12-02-2009
use strict;
use Bio::SearchIO;
use Bio::SeqIO;
use Bio::Seq;
use Bio::DB::GenBank;
my $infile=shift;
my $outfile=$infile.".out";
my $in = new Bio::SearchIO(-format => 'blast',
-file => $infile);
open(OUT,">",$outfile);
my $cc=0;
while( my $result = $in->next_result ) {
print OUT $result->query_name."\n";
while( my $hit = $result->next_hit ) {
my $report="\t".$hit->name.": ";
while( my $hsp = $hit->next_hsp ) {
if($hsp->evalue<1){
print OUT $report."(".$hsp->start('hit')."..".$hsp->end('hit').")\tE=".$hsp->evalue."\n";
print "strand: ".$hsp->strand('hit')."\n";
print "start: ".$hsp->start('hit')."\n";
print "end: ".$hsp->end('hit')."\n\n";
}
}
}
$cc++;
print OUT "-----------------\n" if $cc%2==0;
}
exit;