Class | Bio::TMHMM
In: | lib/bio/appl/tmhmm/report.rb
Parent: | Object

# TMHMM class for www.cbs.dtu.dk/services/TMHMM/

### Methods

reports

### Classes and Modules

Class Bio::TMHMM::Report
Class Bio::TMHMM::TMH

### Public Class methods

reports(data) {|Bio::TMHMM::Report.new(entry)| ...}

Splits multiple reports into a report entry.

[Source]

        # File lib/bio/appl/tmhmm/report.rb, line 25
    25:     def TMHMM.reports(data)
    26:       entry     = []
    27:       ent_state = ''
    28:       data.each_line do |line|
    29:         if /^\#/ =~ line
    30:           if ent_state == 'next'
    31:             ent_state = 'entry'
    32:           elsif ent_state == 'tmh'
    33:             ent_state = 'next'
    34:           end
    35:         else
    36:           ent_state = 'tmh'
    37:         end
    38:
    39:         if ent_state != 'next'
    40:           entry << line
    41:         else
    42:           if block_given?
    43:             yield Bio::TMHMM::Report.new(entry)
    44:           else
    45:             Bio::TMHMM::Report.new(entry)
    46:           end
    47:           entry = [line]
    48:         end
    49:       end
    50:
    51:       if block_given?
    52:         yield Bio::TMHMM::Report.new(entry)
    53:       else
    54:         Bio::TMHMM::Report.new(entry)
    55:       end
    56:     end

[Validate]