class MzID::ParserSax::CounterHandler
counts the different element types
Constants
- ATTR
Attributes
dbseq_count[RW]
pep_count[RW]
pepev_count[RW]
spec_count[RW]
Public Class Methods
new()
click to toggle source
# File lib/mzid/parser_sax.rb, line 18 def initialize() @dbseq_count = 0 @pep_count = 0 @pepev_count = 0 @spec_count = 0 end
Public Instance Methods
start_element(name)
click to toggle source
# File lib/mzid/parser_sax.rb, line 26 def start_element(name) return unless ATTR.include?(name) case name when :DBSequence @dbseq_count += 1 when :Peptide @pep_count += 1 when :PeptideEvidence @pepev_count += 1 when :SpectrumIdentificationItem @spec_count += 1 end end