Class: Mascot::DAT::Enzyme

Inherits:
Object
  • Object
show all
Defined in:
lib/mascot/dat/enzyme.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enz_section) ⇒ Enzyme

Returns a new instance of Enzyme.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/mascot/dat/enzyme.rb', line 22

def initialize(enz_section)
  @title = ""
  @independent = false
  @semi_specific = false
  @cleavages = []
  @restrictions = []
  @terminals  = []

  enz_section.split(/\n/).each do |line|
    k,v = line.chomp.split(":")
    case k
    when "Title"
      @title = v
    when "Independent"
      @independent = v.to_i > 0 ? true : false
    when "SemiSpecific"
      @semi_specific = v.to_i > 0 ? true : false
    when /^Cleavage/
      k =~ /\[(\d)\]/
      if $1
        @cleavages[$1.to_i] = v
      else
        @cleavages << v
      end
    when /^Restrict\[?(\d?)\]?/
      if $1
        @restrictions[$1.to_i] = v
      else
        @restrictions << v
      end
    when /^(\w)term\[?(\d?)\]?/
      idx = $2.empty? ? 0 : $2.to_i
      @terminals[idx] = $1
    end
  end
end

Instance Attribute Details

#cleavagesObject

example enzyme section

--gc0p4Jq0M2Yt08jU534c0p
Content-Type: application/x-Mascot; name="enzyme"

Title:V8-DE/Trypsin
Independent:0
SemiSpecific:0
Cleavage[0]:KR
Restrict[0]:P
Cterm[0]
Cleavage[1]:BDEZ
Restrict[1]:P
Cterm[1]
*


19
20
21
# File 'lib/mascot/dat/enzyme.rb', line 19

def cleavages
  @cleavages
end

#independentObject

example enzyme section

--gc0p4Jq0M2Yt08jU534c0p
Content-Type: application/x-Mascot; name="enzyme"

Title:V8-DE/Trypsin
Independent:0
SemiSpecific:0
Cleavage[0]:KR
Restrict[0]:P
Cterm[0]
Cleavage[1]:BDEZ
Restrict[1]:P
Cterm[1]
*


19
20
21
# File 'lib/mascot/dat/enzyme.rb', line 19

def independent
  @independent
end

#restrictionsObject

example enzyme section

--gc0p4Jq0M2Yt08jU534c0p
Content-Type: application/x-Mascot; name="enzyme"

Title:V8-DE/Trypsin
Independent:0
SemiSpecific:0
Cleavage[0]:KR
Restrict[0]:P
Cterm[0]
Cleavage[1]:BDEZ
Restrict[1]:P
Cterm[1]
*


19
20
21
# File 'lib/mascot/dat/enzyme.rb', line 19

def restrictions
  @restrictions
end

#semi_specificObject

example enzyme section

--gc0p4Jq0M2Yt08jU534c0p
Content-Type: application/x-Mascot; name="enzyme"

Title:V8-DE/Trypsin
Independent:0
SemiSpecific:0
Cleavage[0]:KR
Restrict[0]:P
Cterm[0]
Cleavage[1]:BDEZ
Restrict[1]:P
Cterm[1]
*


19
20
21
# File 'lib/mascot/dat/enzyme.rb', line 19

def semi_specific
  @semi_specific
end

#terminalsObject

example enzyme section

--gc0p4Jq0M2Yt08jU534c0p
Content-Type: application/x-Mascot; name="enzyme"

Title:V8-DE/Trypsin
Independent:0
SemiSpecific:0
Cleavage[0]:KR
Restrict[0]:P
Cterm[0]
Cleavage[1]:BDEZ
Restrict[1]:P
Cterm[1]
*


19
20
21
# File 'lib/mascot/dat/enzyme.rb', line 19

def terminals
  @terminals
end

#titleObject

example enzyme section

--gc0p4Jq0M2Yt08jU534c0p
Content-Type: application/x-Mascot; name="enzyme"

Title:V8-DE/Trypsin
Independent:0
SemiSpecific:0
Cleavage[0]:KR
Restrict[0]:P
Cterm[0]
Cleavage[1]:BDEZ
Restrict[1]:P
Cterm[1]
*


19
20
21
# File 'lib/mascot/dat/enzyme.rb', line 19

def title
  @title
end