my ( $options, $in, $out, $record, $keys, $vals_only, $keys_only, $invert,
- $patterns, $regex, %lookup_hash, $key, $op, $val, $found );
+ $patterns, $regex, %lookup_hash, $key, $op, $val, $found, $total, $grabbed );
$options = Maasha::Biopieces::parse_options(
[
}
}
+$total = 0;
+$grabbed = 0;
+
while ( $record = Maasha::Biopieces::get_record( $in ) )
{
$found = 0;
$found = grab_eval( $key, $op, $val, $record );
}
- if ( $found and not $invert ) {
+ if ( $found and not $invert )
+ {
Maasha::Biopieces::put_record( $record, $out );
- } elsif ( not $found and $invert ) {
+ $grabbed += 1;
+ }
+ elsif ( not $found and $invert )
+ {
Maasha::Biopieces::put_record( $record, $out );
+ $grabbed += 1;
}
+
+ $total += 1;
}
Maasha::Biopieces::close_stream( $in );
Maasha::Biopieces::close_stream( $out );
+if ( $options->{ 'verbose' } )
+{
+ print STDERR "Records grabbed: $grabbed\n";
+ print STDERR "Records missed: " . ( $total - $grabbed ) . "\n";
+}
+
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SUBROUTINES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<