my ( @fields );
- $fh ||= \*STDOUT;
-
- $fields[ S_ID ] = $entry->{ 'S_ID' };
- $fields[ S_BEG ] = $entry->{ 'S_BEG' };
- $fields[ S_END ] = $entry->{ 'S_END' };
- $fields[ Q_ID ] = $entry->{ 'Q_ID' };
- $fields[ SCORE ] = $entry->{ 'SCORE' };
- $fields[ STRAND ] = $entry->{ 'STRAND' };
- $fields[ HITS ] = $entry->{ 'HITS' };
- $fields[ ALIGN ] = $entry->{ 'ALIGN' };
- $fields[ BLOCK_COUNT ] = $entry->{ 'BLOCK_COUNT' };
- $fields[ BLOCK_BEGS ] = $entry->{ 'BLOCK_BEGS' };
- $fields[ BLOCK_LENS ] = $entry->{ 'BLOCK_LENS' };
- $fields[ BLOCK_TYPE ] = $entry->{ 'BLOCK_TYPE' };
-
- print $fh join( "\t", @fields ), "\n";
+ if ( defined $entry->{ 'S_ID' } and
+ defined $entry->{ 'S_BEG' } and
+ defined $entry->{ 'S_END' }
+ )
+ {
+ $fh ||= \*STDOUT;
+
+ $fields[ S_ID ] = $entry->{ 'S_ID' };
+ $fields[ S_BEG ] = $entry->{ 'S_BEG' };
+ $fields[ S_END ] = $entry->{ 'S_END' };
+ $fields[ Q_ID ] = $entry->{ 'Q_ID' };
+ $fields[ SCORE ] = $entry->{ 'SCORE' };
+ $fields[ STRAND ] = $entry->{ 'STRAND' };
+ $fields[ HITS ] = $entry->{ 'HITS' };
+ $fields[ ALIGN ] = $entry->{ 'ALIGN' };
+ $fields[ BLOCK_COUNT ] = $entry->{ 'BLOCK_COUNT' };
+ $fields[ BLOCK_BEGS ] = $entry->{ 'BLOCK_BEGS' };
+ $fields[ BLOCK_LENS ] = $entry->{ 'BLOCK_LENS' };
+ $fields[ BLOCK_TYPE ] = $entry->{ 'BLOCK_TYPE' };
+
+ print $fh join( "\t", @fields ), "\n";
+ }
}
my ( $record, # Biopiece record
) = @_;
+ $record->{ 'SCORE' } ||= $record->{ 'E_VAL' } || ".";
$record->{ 'HITS' } ||= ".";
$record->{ 'BLOCK_COUNT' } ||= ".";
$record->{ 'BLOCK_BEGS' } ||= ".";
use warnings;
use strict;
use Data::Dumper;
+use Maasha::Common;
use Maasha::Calc;
use vars qw( @ISA @EXPORT );
{
foreach $align ( split /,/, $entry->{ 'ALIGN' } )
{
- if ( $align =~ /(\d+):(\w)>(\w)/ )
+ if ( $align =~ /(\d+):([ATCGN-])>([ATCGN-])/ )
{
$pos = $1;
$nt_before = $2;
}
else
{
- die;
+ Maasha::Common::error( qq(BAD align descriptor: "$align") );
}
$x1 = sprintf( "%.0f", ( $entry->{ 'S_BEG' } + $pos - $beg ) * $factor );