[Bio] / FigKernelScripts / convert-blast-to-m8.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/convert-blast-to-m8.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : olson 1.1
2 :     use gjoparseblast;
3 :     use strict;
4 :     use Data::Dumper;
5 :     use FileHandle;
6 :    
7 :     my $input;
8 :     if (@ARGV == 0)
9 :     {
10 :     $input = \*STDIN;
11 :     }
12 :     else
13 :     {
14 :     my $f = shift;
15 :     $input = new FileHandle("<$f");
16 :     $input or die "Cannot open $f: $!";
17 :     }
18 :    
19 :     my $n;
20 :    
21 :     #
22 :     # 6: scr = bit-score
23 :     # 7: e_val
24 :     # 8 p_n k
25 :    
26 :     while (my $record = next_blast_hsp($input, 0))
27 :     {
28 :     my($qid, $qdef, $qlen, $sid, $sdef, $slen, $scr, $e_val, $p_n, $p_val, $n_mat, $n_id, $n_pos, $n_gap, $dir, $q1, $q2, $qseq, $s1, $s2, $sseq) = @$record;
29 :     # $record->[17] = $record->[20] = '';
30 :     # print Dumper($record);
31 :    
32 :     print join("\t", $qid, $sid, sprintf("%.2f", 100 * $n_id / $n_mat), $n_mat, $n_mat - $n_id - $n_gap, $n_gap, $q1, $q2, $s1, $s2, $e_val, $scr, $qlen, $slen), "\n";
33 :     }
34 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3