Class: Proph::PepSummary

Inherits:
Object
  • Object
show all
Includes:
SpecID
Defined in:
lib/ms/ident/pepxml/pep_summary.rb

Defined Under Namespace

Classes: Pep, Prot

Constant Summary collapse

Filetype_and_version_re_new =
/version="PeptideProphet v([\d\.]+) /

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file = nil) ⇒ PepSummary

Returns a new instance of PepSummary.



54
55
56
57
58
59
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 54

def initialize(file=nil)
  if file
    @version = get_version(file)
    spec_id = SpecID::Parser::PepProph.new(:spec_id).parse(file, :spec_id => self)
  end
end

Instance Attribute Details

#msms_run_summariesObject

Returns the value of attribute msms_run_summaries.



29
30
31
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 29

def msms_run_summaries
  @msms_run_summaries
end

#peptideprophet_summaryObject

the protein groups currently these are just xml nodes returned!



28
29
30
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 28

def peptideprophet_summary
  @peptideprophet_summary
end

#versionObject

Returns the value of attribute version.



30
31
32
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 30

def version
  @version
end

Instance Method Details

#get_version(file) ⇒ Object

Raises:

  • (ArgumentError)


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 34

def get_version(file)
  answer = nil
  File.open(file) do |fh|
    8.times do
      line = fh.gets
      answer = 
        if line =~ Filetype_and_version_re_new
          $1.dup
        end
      break if answer
    end
  end
  raise(ArgumentError, "couldn't detect version in #{file}") unless answer
  answer
end

#hi_prob_bestObject



32
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 32

def hi_prob_best ; true end

#search_hit_classObject



50
51
52
# File 'lib/ms/ident/pepxml/pep_summary.rb', line 50

def search_hit_class
  PepSummary::Pep
end