FAST
view release on metacpan or search on metacpan
lib/FAST/Bio/SearchIO/XML/BlastHandler.pm view on Meta::CPAN
'Parameters_gap-open' => { 'RESULT-parameters' => 'gapopen'},
'Parameters_gap-extend' => { 'RESULT-parameters' => 'gapext'},
'Parameters_filter' => {'RESULT-parameters' => 'filter'},
'Statistics_db-num' => 'RESULT-database_entries',
'Statistics_db-len' => 'RESULT-database_letters',
'Statistics_hsp-len' => { 'RESULT-statistics' => 'hsplength'},
'Statistics_eff-space' => { 'RESULT-statistics' => 'effectivespace'},
'Statistics_kappa' => { 'RESULT-statistics' => 'kappa' },
'Statistics_lambda' => { 'RESULT-statistics' => 'lambda' },
'Statistics_entropy' => { 'RESULT-statistics' => 'entropy'},
# HSP specific fields
'Hsp_bit-score' => 'HSP-bits',
'Hsp_score' => 'HSP-score',
'Hsp_evalue' => 'HSP-evalue',
'Hsp_query-from' => 'HSP-query_start',
'Hsp_query-to' => 'HSP-query_end',
'Hsp_hit-from' => 'HSP-hit_start',
'Hsp_hit-to' => 'HSP-hit_end',
'Hsp_positive' => 'HSP-conserved',
'Hsp_identity' => 'HSP-identical',
'Hsp_gaps' => 'HSP-gaps',
'Hsp_hitgaps' => 'HSP-hit_gaps',
'Hsp_querygaps' => 'HSP-query_gaps',
'Hsp_qseq' => 'HSP-query_seq',
'Hsp_hseq' => 'HSP-hit_seq',
'Hsp_midline' => 'HSP-homology_seq',
'Hsp_align-len' => 'HSP-hsp_length',
'Hsp_query-frame'=> 'HSP-query_frame',
'Hsp_hit-frame' => 'HSP-hit_frame',
# Hit specific fields
'Hit_id' => 'HIT-name',
'Hit_len' => 'HIT-length',
'Hit_accession' => 'HIT-accession',
'Hit_def' => 'HIT-description',
'Hit_num' => 'HIT-order',
'Iteration_iter-num' => 'HIT-iteration',
'Iteration_stat' => 'HIT-iteration_statistic',
# if these tags are present, they will overwrite the
# above with more current data (i.e. multiquery hits)
'Iteration_query-def' => 'RESULT-query_description',
'Iteration_query-len' => 'RESULT-query_length',
'Iteration_query-ID' => 'runid',
);
# these XML tags are ignored for now
my %IGNOREDTAGS = (
'Hsp_num' => 1,#'HSP-order',
'Hsp_pattern-from' => 1,#'patternend',
'Hsp_pattern-to' => 1,#'patternstart',
'Hsp_density' => 1,#'hspdensity',
'Iteration_message' => 1,
'Hit_hsps' => 1,
'BlastOutput_param' => 1,
'Iteration_hits' => 1,
'Statistics' => 1,
'Parameters' => 1,
'BlastOutput' => 1,
'BlastOutput_iterations' => 1,
);
=head2 SAX methods
=cut
=head2 start_document
Title : start_document
Usage : $parser->start_document;
Function: SAX method to indicate starting to parse a new document
Returns : none
Args : none
=cut
sub start_document{
my ($self) = @_;
$self->{'_lasttype'} = '';
$self->{'_values'} = {};
$self->{'_result'}= [];
}
=head2 end_document
Title : end_document
Usage : $parser->end_document;
Function: SAX method to indicate finishing parsing a new document
Returns : FAST::Bio::Search::Result::ResultI object
Args : none
=cut
sub end_document{
my ($self,@args) = @_;
# reset data carried throughout parse
$self->{'_resultdata'} = undef;
# pass back ref to results queue; caller must reset handler results queue
return $self->{'_result'};
}
=head2 start_element
Title : start_element
Usage : $parser->start_element($data)
Function: SAX method to indicate starting a new element
Returns : none
Args : hash ref for data
=cut
sub start_element{
my ($self,$data) = @_;
# we currently don't care about attributes
my $nm = $data->{'Name'};
if( my $type = $MODEMAP{$nm} ) {
if( $self->eventHandler->will_handle($type) ) {
( run in 1.009 second using v1.01-cache-2.11-cpan-71847e10f99 )