Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/protk/psm.rb,
lib/protk/tandem_search_tool.rb
Instance Method Summary collapse
Instance Method Details
#to_bool ⇒ Object
9 10 11 12 13 |
# File 'lib/protk/psm.rb', line 9 def to_bool return true if self == true || self =~ (/^(true|t|yes|y|1)$/i) return false if self == false || self =~ (/^(false|f|no|n|0)$/i) raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") end |
#xtandem_modification_motif? ⇒ Boolean
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/protk/tandem_search_tool.rb', line 5 def xtandem_modification_motif? # 124@[ is not a modification motif, it is a residue (N-term) modification, # so when checking if modification is a motif look for paired square brackets. ismotif=false case self when /[\(\)\{\}\!]/,/\[.*\]/ ismotif=true end ismotif end |