Class Validator::ProtFromPep
In: lib/validator/prot_from_pep.rb
Parent: Validator

calculates protein hit precision based on peptide precision

Methods

Public Instance methods

normal as in a standard normal distribution of peptide hits per protein they are distributed randomly and the precision is assumed to take on a standard normal distribution. num_peps_per_protein is an array of the number of peptides per protein hit (these are the true hits) assumes that the number follows a gaussian distribution (binomial distributions tend toward gaussians, I believe, at large N) returns [mean_precision, stdev_precision] options:

  :num_its => Integer (default: 10)

if num_iterations is set at 1, then only the precision will be returned though random, the same seed is always used to start this process, meaning that the same results will be produced on consecutive attempts.

  validator.normal_prothit_precision(peps, 13, :num_its => 1) # -> 0.95433
  validator.normal_prothit_precision(peps, 13, :num_its => 2) # -> [0.92002, 1.2223]

returns an array of the number of peptide hits in each protein

calculate protein precision based on the number of false peptides returns the precision based on the number of proteins *completely false* calculates the worst precision by assuming that proteins with the fewest peptides are all false (before prots with more pephits) note that this approaches the worst, but is not guaranteed to be worst unless each pephit maps to a single protein hit. [worst, normal_mean, normal_stddev] options

   :num_its_normal => Integer, # num iterations for normal (d: 10)
   :num_its_worstcase => Integer, # num iterations for worstcase (d: 10)

returns the worstcase precision. This assumes that every small protein with the fewest peptide hits is completely ‘filled’ with incorrect hits in preference to any higher hit protein. Where each peptide hit maps to a single protein, this is guaranteed to be worst-case. If this doesn‘t hold, there are some extreme cases where a poorer precision could be generated, but this is still probably fairly close. Thus, a slightly different answer may be generated each time. …variation is produced by shuffling the order of the proteins from which peptides are removed within groups of proteins having the same number of peptides. This method does NOT require that the prothits be updated to reflect only those pephits being passed in.

  validator.worstcase_prothit_precision(peps, 14, 1) # => 0.232111

options:

  :num_its => Integer (default: 10) number of times to run (finds minimum)
  :one_prot_per_pep => true | *false   assumes each peptide maps to a
                                       single protein

returns the precision of the worst possible outcome

[Validate]