@fields = split /\t/, $line;
+ next if scalar @fields < 9;
+
return wantarray ? @fields : \@fields;
}
}
my ( %record, @atts, $att, $key, $val );
%record = (
- 'Q_ID' => $entry->[ seqid ],
+ 'S_ID' => $entry->[ seqid ],
'SOURCE' => $entry->[ source ],
'TYPE' => $entry->[ type ],
- 'Q_BEG' => $entry->[ start ],
- 'Q_END' => $entry->[ end ],
+ 'S_BEG' => $entry->[ start ] - 1,
+ 'S_END' => $entry->[ end ] - 1,
+ 'S_LEN' => $entry->[ end ] - $entry->[ start ] + 1,
'SCORE' => $entry->[ score ],
'STRAND' => $entry->[ strand ],
'PHASE' => $entry->[ phase ],
my ( @entry, $key, $tag, @atts );
- $entry[ seqid ] = $record->{ 'Q_ID' };
- $entry[ source ] = $record->{ 'SOURCE' };
- $entry[ type ] = $record->{ 'TYPE' };
- $entry[ start ] = $record->{ 'Q_BEG' };
- $entry[ end ] = $record->{ 'Q_END' };
+ $entry[ seqid ] = $record->{ 'S_ID' };
+ $entry[ source ] = $record->{ 'SOURCE' } || $record->{ 'REC_TYPE' } || '.';
+ $entry[ type ] = $record->{ 'TYPE' } || '.';
+ $entry[ start ] = $record->{ 'S_BEG' };
+ $entry[ end ] = $record->{ 'S_END' };
$entry[ score ] = $record->{ 'SCORE' };
$entry[ strand ] = $record->{ 'STRAND' };
- $entry[ phase ] = $record->{ 'PHASE' };
+ $entry[ phase ] = $record->{ 'PHASE' } || '.';
+
+ if ( not exists $record->{ 'ATT_ID' } )
+ {
+ push @atts, "ID=$record->{ 'Q_ID' }" if exists $record->{ 'Q_ID' };
+ }
foreach $key ( %{ $record } )
{