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)
-
- (Object) entry
current raw entry as a String.
-
- (Object) entry_ended_pos
(end position of the entry) + 1.
-
- (Object) entry_start_pos
start position of the entry.
-
- (Object) get_entry
get an entry and return the entry as a string.
-
- (Object) get_parsed_entry
get an entry as a Bio::Blast::Report object.
-
- (BlastXmlSplitter) initialize(klass, bstream)
constructor
creates a new splitter object.
-
- (Object) rewind
rewinds.
-
- (Object) skip_leader
do nothing.
Constructor Details
- (BlastXmlSplitter) initialize(klass, bstream)
creates a new splitter object
482 483 484 485 486 |
# File 'lib/bio/appl/blast/report.rb', line 482 def initialize(klass, bstream) super(klass, bstream) @parsed_entries = [] @raw_unsupported = false end |
Instance Method Details
- (Object) entry
current raw entry as a String
527 528 529 530 |
# File 'lib/bio/appl/blast/report.rb', line 527 def entry raise 'not supported for new BLAST XML format' if @raw_unsupported super end |
- (Object) entry_ended_pos
(end position of the entry) + 1
541 542 543 544 545 546 |
# File 'lib/bio/appl/blast/report.rb', line 541 def entry_ended_pos if entry_pos_flag then raise 'not supported for new BLAST XML format' if @raw_unsupported end super end |
- (Object) entry_start_pos
start position of the entry
533 534 535 536 537 538 |
# File 'lib/bio/appl/blast/report.rb', line 533 def entry_start_pos if entry_pos_flag then raise 'not supported for new BLAST XML format' if @raw_unsupported end super end |
- (Object) get_entry
get an entry and return the entry as a string
502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/bio/appl/blast/report.rb', line 502 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 |
- (Object) get_parsed_entry
get an entry as a Bio::Blast::Report object
515 516 517 518 519 520 521 522 523 524 |
# File 'lib/bio/appl/blast/report.rb', line 515 def get_parsed_entry if @parsed_entries.empty? then ent = get_entry else self.parsed_entry = @parsed_entries.shift self.entry = nil @raw_unsupported = true end self.parsed_entry end |
- (Object) rewind
rewinds
489 490 491 492 493 494 |
# File 'lib/bio/appl/blast/report.rb', line 489 def rewind ret = super @parsed_entries.clear @raw_unsupported = false ret end |
- (Object) skip_leader
do nothing
497 498 499 |
# File 'lib/bio/appl/blast/report.rb', line 497 def skip_leader nil end |