[Bioperl-guts-l] bioperl commit
Steve Chervitz
sac at pub.open-bio.org
Wed May 5 22:08:18 EDT 2004
sac
Wed May 5 22:08:18 EDT 2004
Update of /home/repository/bioperl/bioperl-live/examples/searchio
In directory pub.open-bio.org:/tmp/cvs-serv23830/examples/searchio
Modified Files:
Tag: branch-1-4
hitwriter.pl
Log Message:
Exercising the interfaces a little more.
bioperl-live/examples/searchio hitwriter.pl,1.2,1.2.2.1
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/examples/searchio/hitwriter.pl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- /home/repository/bioperl/bioperl-live/examples/searchio/hitwriter.pl 2003/06/04 02:26:48 1.2
+++ /home/repository/bioperl/bioperl-live/examples/searchio/hitwriter.pl 2004/05/06 02:08:18 1.2.2.1
@@ -54,6 +54,7 @@
hit_length
num_hsps
expect
+ frac_aligned_query
frac_identical_query
length_aln_query
gaps_total
@@ -61,6 +62,14 @@
strand_hit
);
+# The following columns require HSP alignment data:
+# num_hsps
+# frac_identical_query
+# length_aln_query
+# gaps_total
+# strand_query
+# strand_hit
+
print STDERR "\nUsing SearchIO->new()\n";
# Note that all parameters for the $in, $out, and $writer objects are optional.
@@ -69,8 +78,10 @@
# called "hitwriter.out"
# TODO: write hitless reports to STDERR and note if filtered.
my $in = Bio::SearchIO->new( -format => 'blast',
+ -fh => \*ARGV,
-signif => 0.1,
- -verbose=> 0 );
+ # -verbose=> 2
+ );
my $writer = Bio::SearchIO::Writer::HitTableWriter->new( -columns => \@columns
);
my $out = Bio::SearchIO->new( -format => 'blast',
@@ -83,9 +94,15 @@
while ( my $blast = $in->next_result() ) {
printf STDERR "\nReport %d: $blast\n", $in->result_count;
+ printf STDERR "query=%s, length=%d\n", $blast->query_name, $blast->query_length;
+
if( $blast->hits ) {
- $hit_count++;
- $out->write_result($blast, $hit_count==1 );
+ print STDERR "# hits= ", $blast->num_hits, "\n";
+ $hit_count++;
+ my @hits= $blast->hits;
+ print STDERR "frac_aligned_query= ", $hits[0]->frac_aligned_query, "\n";
+
+ $out->write_result($blast, $hit_count==1 );
}
else {
print STDERR "Hitless Blast Report ";
More information about the Bioperl-guts-l
mailing list