5
bp_search2table - turn SearchIO parseable reports into tab delimited format like NCBI's -m 9
9
bp_search2table -f fasta -i file.FASTA -o output.table
13
Turn SearchIO reports into a tabular format like NCBI's -m 9 output.
19
User feedback is an integral part of the evolution of this and other
20
Bioperl modules. Send your comments and suggestions preferably to
21
the Bioperl mailing list. Your participation is much appreciated.
23
bioperl-l@bioperl.org - General discussion
24
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
28
Report bugs to the Bioperl bug tracking system to help us keep track
29
of the bugs and their resolution. Bug reports can be submitted via
32
https://redmine.open-bio.org/projects/bioperl/
36
Jason Stajich jason_at_bioperl-dot-org
45
my ($format, $file,$output) = ('blast');
48
'f|format:s' => \$format,
49
'i|input:s' => \$file,
50
'o|output:s' => \$output);
56
my $in = Bio::SearchIO->new(-format => $format,
60
open($out,">$output") || die "cannot open $output for writing";
65
while( my $r = $in->next_result ) {
66
while( my $hit = $r->next_hit ) {
67
while( my $hsp = $hit->next_hsp ) {
68
my $mismatchcount = $hsp->length('total') -
69
($hsp->num_conserved + $hsp->gaps('total'));
70
print $out join("\t", ( $r->query_name,
72
sprintf("%.2f",$hsp->percent_identity),
73
$hsp->length('total'),
76
# flip start/end on rev strand
77
$hsp->query->strand < 0 ?
79
$hsp->query->start ) :
82
$hsp->hit->strand < 0 ?
89
# chance this to $hsp->sw_score
90
# if you would rather have that
91
# it will only work for FASTA parsing though!