Class: ProteinSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/protk/protein_summary.rb

Overview

Represents the protein_summary node of a protXML document This is the root of the document

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProteinSummary

Returns a new instance of ProteinSummary.



74
75
76
# File 'lib/protk/protein_summary.rb', line 74

def initialize()

end

Instance Attribute Details

#analysis_timeObject

Returns the value of attribute analysis_time.



29
30
31
# File 'lib/protk/protein_summary.rb', line 29

def analysis_time
  @analysis_time
end

#initial_min_peptide_probObject

Returns the value of attribute initial_min_peptide_prob.



24
25
26
# File 'lib/protk/protein_summary.rb', line 24

def initial_min_peptide_prob
  @initial_min_peptide_prob
end

#min_peptide_probabilityObject

Returns the value of attribute min_peptide_probability.



16
17
18
# File 'lib/protk/protein_summary.rb', line 16

def min_peptide_probability
  @min_peptide_probability
end

#min_peptide_weightObject

Returns the value of attribute min_peptide_weight.



17
18
19
# File 'lib/protk/protein_summary.rb', line 17

def min_peptide_weight
  @min_peptide_weight
end

#num_input_1_spectraObject

Returns the value of attribute num_input_1_spectra.



19
20
21
# File 'lib/protk/protein_summary.rb', line 19

def num_input_1_spectra
  @num_input_1_spectra
end

#num_input_2_spectraObject

Returns the value of attribute num_input_2_spectra.



20
21
22
# File 'lib/protk/protein_summary.rb', line 20

def num_input_2_spectra
  @num_input_2_spectra
end

#num_input_3_spectraObject

Returns the value of attribute num_input_3_spectra.



21
22
23
# File 'lib/protk/protein_summary.rb', line 21

def num_input_3_spectra
  @num_input_3_spectra
end

#num_input_4_spectraObject

Returns the value of attribute num_input_4_spectra.



22
23
24
# File 'lib/protk/protein_summary.rb', line 22

def num_input_4_spectra
  @num_input_4_spectra
end

#num_input_5_spectraObject

Returns the value of attribute num_input_5_spectra.



23
24
25
# File 'lib/protk/protein_summary.rb', line 23

def num_input_5_spectra
  @num_input_5_spectra
end

#num_predicted_correct_protsObject

Returns the value of attribute num_predicted_correct_prots.



18
19
20
# File 'lib/protk/protein_summary.rb', line 18

def num_predicted_correct_prots
  @num_predicted_correct_prots
end

#program_nameObject

Returns the value of attribute program_name.



28
29
30
# File 'lib/protk/protein_summary.rb', line 28

def program_name
  @program_name
end

#program_versionObject

Returns the value of attribute program_version.



30
31
32
# File 'lib/protk/protein_summary.rb', line 30

def program_version
  @program_version
end

#reference_databaseObject

Returns the value of attribute reference_database.



12
13
14
# File 'lib/protk/protein_summary.rb', line 12

def reference_database
  @reference_database
end

#residue_substitution_listObject

Returns the value of attribute residue_substitution_list.



13
14
15
# File 'lib/protk/protein_summary.rb', line 13

def residue_substitution_list
  @residue_substitution_list
end

#sample_enzymeObject

Returns the value of attribute sample_enzyme.



26
27
28
# File 'lib/protk/protein_summary.rb', line 26

def sample_enzyme
  @sample_enzyme
end

#source_filesObject

Returns the value of attribute source_files.



14
15
16
# File 'lib/protk/protein_summary.rb', line 14

def source_files
  @source_files
end

#source_files_altObject

Returns the value of attribute source_files_alt.



15
16
17
# File 'lib/protk/protein_summary.rb', line 15

def source_files_alt
  @source_files_alt
end

#total_no_spectrum_idsObject

Returns the value of attribute total_no_spectrum_ids.



25
26
27
# File 'lib/protk/protein_summary.rb', line 25

def total_no_spectrum_ids
  @total_no_spectrum_ids
end

Class Method Details

.from_mzid(mzid_doc) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/protk/protein_summary.rb', line 35

def from_mzid(mzid_doc)

	summary = new()
	# Things we cant retrieve
	summary.residue_substitution_list = ""
	summary.min_peptide_probability = ""
	summary.min_peptide_weight = ""
	summary.num_predicted_correct_prots = ""
	summary.num_input_1_spectra = ""
	summary.num_input_2_spectra = ""
	summary.num_input_3_spectra = ""
	summary.num_input_4_spectra = ""
	summary.num_input_5_spectra = ""
	summary.initial_min_peptide_prob = ""
	summary.total_no_spectrum_ids = ""			
	summary.analysis_time = ""

	db = mzid_doc.search_databases.first
	summary.reference_database = db.attributes['location']

	summary.source_files = mzid_doc.source_files.collect { |sf| sf.attributes['location'] }
	summary.source_files_alt = summary.source_files

	summary.sample_enzyme = mzid_doc.enzymes.first.attributes['name']
	if mzid_doc.enzymes.first.attributes['semiSpecific']=="true"
		summary.sample_enzyme = "semi#{summary.sample_enzyme}"
	end

	analysis_software = mzid_doc.analysis_software.first
	summary.program_name = analysis_software.attributes['name']
	summary.program_version = analysis_software.attributes['version']

	summary
end

Instance Method Details

#as_protxmlObject



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/protk/protein_summary.rb', line 78

def as_protxml()
	node = XML::Node.new('protein_summary_header')
	# node.space_preserve=true
	node["reference_database"] = self.reference_database
	node["min_peptide_probability"] = self.min_peptide_probability
	node["min_peptide_weight"] = self.min_peptide_weight
	node["num_predicted_correct_prots"] = self.num_predicted_correct_prots
	node["num_input_1_spectra"] = self.num_input_1_spectra
	node["num_input_2_spectra"] = self.num_input_2_spectra
	node["num_input_3_spectra"] = self.num_input_3_spectra
	node["num_input_4_spectra"] = self.num_input_4_spectra
	node["num_input_5_spectra"] = self.num_input_5_spectra
	node["initial_min_peptide_prob"] = self.initial_min_peptide_prob
	node["total_no_spectrum_ids"] = self.total_no_spectrum_ids
	node["sample_enzyme"] = self.sample_enzyme


	cnode = XML::Node.new('program_details')
	# node.space_preserve=true
	cnode["program_name"] = self.program_name
	cnode["analysis_time"] = self.analysis_time
	cnode["program_version"] = self.program_version
#		require 'byebug';byebug

	node << cnode

	# ddnode = XML::Node.new('dataset_derivation')
	# ddnode["generation_no"]="0"

	# node << ddnode

 	node
end