Class: Bio::Blast::Report::BlastXmlSplitter
- Inherits:
-
FlatFile::Splitter::Default
- Object
- FlatFile::Splitter::Template
- FlatFile::Splitter::Default
- Bio::Blast::Report::BlastXmlSplitter
- Defined in:
- lib/bio/appl/blast/report.rb
Overview
Flatfile splitter for NCBI BLAST XML format. It is internally used when reading BLAST XML. Normally, users do not need to use it directly.
Instance Attribute Summary
Attributes inherited from FlatFile::Splitter::Default
#delimiter, #delimiter_overrun, #header
Attributes inherited from FlatFile::Splitter::Template
#entry_pos_flag, #parsed_entry
Instance Method Summary collapse
-
#entry ⇒ Object
current raw entry as a String.
-
#entry_ended_pos ⇒ Object
(end position of the entry) + 1.
-
#entry_start_pos ⇒ Object
start position of the entry.
-
#get_entry ⇒ Object
get an entry and return the entry as a string.
-
#get_parsed_entry ⇒ Object
get an entry as a Bio::Blast::Report object.
-
#initialize(klass, bstream) ⇒ BlastXmlSplitter
constructor
creates a new splitter object.
-
#rewind ⇒ Object
rewinds.
-
#skip_leader ⇒ Object
do nothing.
Constructor Details
#initialize(klass, bstream) ⇒ BlastXmlSplitter
creates a new splitter object
518 519 520 521 522 |
# File 'lib/bio/appl/blast/report.rb', line 518 def initialize(klass, bstream) super(klass, bstream) @parsed_entries = [] @raw_unsupported = false end |
Instance Method Details
#entry ⇒ Object
current raw entry as a String
563 564 565 566 |
# File 'lib/bio/appl/blast/report.rb', line 563 def entry raise 'not supported for new BLAST XML format' if @raw_unsupported super end |
#entry_ended_pos ⇒ Object
(end position of the entry) + 1
577 578 579 580 581 582 |
# File 'lib/bio/appl/blast/report.rb', line 577 def entry_ended_pos if entry_pos_flag then raise 'not supported for new BLAST XML format' if @raw_unsupported end super end |
#entry_start_pos ⇒ Object
start position of the entry
569 570 571 572 573 574 |
# File 'lib/bio/appl/blast/report.rb', line 569 def entry_start_pos if entry_pos_flag then raise 'not supported for new BLAST XML format' if @raw_unsupported end super end |
#get_entry ⇒ Object
get an entry and return the entry as a string
538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/bio/appl/blast/report.rb', line 538 def get_entry if @parsed_entries.empty? then @raw_unsupported = false ent = super prepare_parsed_entries(ent) self.parsed_entry = @parsed_entries.shift else raise 'not supported for new BLAST XML format' end ent end |
#get_parsed_entry ⇒ Object
get an entry as a Bio::Blast::Report object
551 552 553 554 555 556 557 558 559 560 |
# File 'lib/bio/appl/blast/report.rb', line 551 def get_parsed_entry if @parsed_entries.empty? then get_entry else self.parsed_entry = @parsed_entries.shift self.entry = nil @raw_unsupported = true end self.parsed_entry end |
#rewind ⇒ Object
rewinds
525 526 527 528 529 530 |
# File 'lib/bio/appl/blast/report.rb', line 525 def rewind ret = super @parsed_entries.clear @raw_unsupported = false ret end |
#skip_leader ⇒ Object
do nothing
533 534 535 |
# File 'lib/bio/appl/blast/report.rb', line 533 def skip_leader nil end |