class Ms::Ident::Pepxml::Ms::Ident::Pepxml::Ms::Ident::Pepxml::SearchHit
Constants
- DEFAULT_MEMBERS
- Non_standard_amino_acid_char_re
- Required
- Simple
Attributes
Peptide aminoacid sequence (with no indicated modifications) (required)
Peptide aminoacid sequence (with no indicated modifications) (required)
(required)
rank of the peptide hit (required)
Potential use in future for user manual validation (true/false) by default, this will be set to false (the xml is expressed as a 0 or 1)
Mass(precursor ion) - Mass(peptide) (required)
a ModificationInfo object
Number of peptide fragment ions found in spectrum (Integer)
Number of sample enzyme cleavage sites internal to peptide<
Number of peptide termini consistent with cleavage by sample enzyme
Number of unique proteins in search database containing peptide (required)
Peptide aminoacid sequence (with no indicated modifications) (required)
Aminoacid following peptide (- if none)
Aminoacid preceding peptide (‘-’ if none)
a protein identifier string (required)
Extracted from search database
a Hash with keys (the score type) and values (to_xml
calls each_pair to generate the xml, so a Struct would also work)
a link back to the spectrum_query
object
Number of peptide fragment ions predicted for peptide (Integer)
Public Class Methods
# File lib/ms/ident/pepxml/search_hit.rb, line 20 def members @members || DEFAULT_MEMBERS end
takes either a hash or an ordered list of values to set. yeilds an empty search_scores
hash if given a block. mind that you set the ModificationInfo object as needed.
# File lib/ms/ident/pepxml/search_hit.rb, line 94 def initialize(*args, &block) @search_scores = {} if args.first.is_a?(Hash) merge!(args.first) else self.class.members.zip(args) do |k,v| send("#{k}=", v) end end block.call(@search_scores) if block end
Public Instance Methods
# File lib/ms/ident/pepxml/search_hit.rb, line 122 def from_pepxml_node(node) node.attributes self[0] = node['hit_rank'].to_i self[1] = node['peptide'] self[2] = node['peptide_prev_aa'] self[3] = node['peptide_next_aa'] self[4] = node['protein'] ## will this be the string?? (yes, for now) self[5] = node['num_tot_proteins'].to_i self[6] = node['num_matched_ions'].to_i self[7] = node['tot_num_ions'].to_i self[8] = node['calc_neutral_pep_mass'].to_f self[9] = node['massdiff'].to_f self[10] = node['num_tol_term'].to_i self[11] = node['num_missed_cleavages'].to_i self[12] = node['is_rejected'].to_i self end
# File lib/ms/ident/pepxml/search_hit.rb, line 106 def members self.class.members end
# File lib/ms/ident/pepxml/search_hit.rb, line 110 def to_xml(builder=nil) xmlb = builder || Nokogiri::XML::Builder.new attrs = members[0,14].map {|k| v=send(k) ; [k, v] if v }.compact hash_attrs = Hash[attrs] hash_attrs[:massdiff] = hash_attrs[:massdiff].to_plus_minus_string xmlb.search_hit(hash_attrs) do |xmlb| @modification_info.to_xml(xmlb) if @modification_info @search_scores.each_pair {|k,v| xmlb.search_score(:name => k, :value => v) } end builder || xmlb.doc.root.to_xml end