Class: ProteinGroup
- Inherits:
-
Object
- Object
- ProteinGroup
- Defined in:
- lib/protk/protein_group.rb
Instance Attribute Summary collapse
-
#group_number ⇒ Object
Returns the value of attribute group_number.
-
#group_probability ⇒ Object
Returns the value of attribute group_probability.
-
#proteins ⇒ Object
Returns the value of attribute proteins.
Class Method Summary collapse
-
.from_mzid(groupnode) ⇒ Object
Note: This is hacked together to work for a specific PeptideShaker output type Refactor and properly respect cvParams for real conversion.
Instance Method Summary collapse
- #as_protxml ⇒ Object
-
#initialize ⇒ ProteinGroup
constructor
A new instance of ProteinGroup.
Constructor Details
#initialize ⇒ ProteinGroup
Returns a new instance of ProteinGroup.
57 58 59 |
# File 'lib/protk/protein_group.rb', line 57 def initialize() end |
Instance Attribute Details
#group_number ⇒ Object
Returns the value of attribute group_number.
12 13 14 |
# File 'lib/protk/protein_group.rb', line 12 def group_number @group_number end |
#group_probability ⇒ Object
Returns the value of attribute group_probability.
13 14 15 |
# File 'lib/protk/protein_group.rb', line 13 def group_probability @group_probability end |
#proteins ⇒ Object
Returns the value of attribute proteins.
14 15 16 |
# File 'lib/protk/protein_group.rb', line 14 def proteins @proteins end |
Class Method Details
.from_mzid(groupnode) ⇒ Object
Note: This is hacked together to work for a specific PeptideShaker output type Refactor and properly respect cvParams for real conversion
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/protk/protein_group.rb', line 38 def from_mzid(groupnode) group=new() group.group_number=groupnode.attributes['id'].split("_").last.to_i+1 group.group_probability=MzIdentMLDoc.get_cvParam(groupnode,"MS:1002470").attributes['value'].to_f # require 'byebug';byebug protein_nodes=MzIdentMLDoc.get_proteins_for_group(groupnode) group.proteins = protein_nodes.collect { |e| Protein.from_mzid(e) } group end |
Instance Method Details
#as_protxml ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/protk/protein_group.rb', line 61 def as_protxml() node = XML::Node.new('protein_group') node["group_number"] = self.group_number.to_s node["group_probability"] = self.group_probability.to_s self.proteins.each { |prot| node << prot.as_protxml } node end |