specs/spec_id/precision/prob_spec.rb in mspire-0.3.1 vs specs/spec_id/precision/prob_spec.rb in mspire-0.3.9

- old
+ new

@@ -39,73 +39,6 @@ end end -=begin - it 'gets precision with all validators (including probability and decoy)' do - ## create some decoy peptides! - @spec_id.peps.sort_by {|pep| pep.probability }[100..-1].each_with_index do |pep,i| - if i % 3 == 0 - pep.prots.each {|prot| prot.protein_name = 'DECOY_' + prot.protein_name } - end - end - # check which ones are ACTUALLY normal and decoy - (decoy, normal) = @spec_id.peps.partition do |pep| - pep.prots.all? {|prot| prot.protein_name =~ /^DECOY_/} - end - num_decoy = decoy.size - num_normal = normal.size - end -prob_spec_helper = File.expand_path( File.dirname(__FILE__) + '/prob_spec_helper' ) - -# this does a minimal test to see if this functions properly -# (not for accuracy, which is done in validator_spec) -## WITH FASTA FILE: -base_dir = Tfiles_l + '/opd1_2runs_2mods/sequest' -fasta_file = base_dir + '/ecoli_K12_ncbi_20060321.fasta' -params_file = base_dir + '/ecoli.params' -bias_file = base_dir + '/ecoli_K12_ncbi_20060321.bias.fasta' -toppred_file = base_dir + '/ecoli_K12_ncbi_20060321.toppred.xml' - -fasta_file.should exist - -prob = Validator::Probability.new -badaa_freq = Validator::AA.new('C', :frequency => 0.0115866200193321) -badaa_dig = Validator::AA.new('C') -bias = Validator::Bias.new(Fasta.new(bias_file)) -transmem = Validator::Transmem::Protein.new(toppred_file) -decoy = Validator::Decoy.new(/^DECOY_/) - -turn_on_digestion = true -if turn_on_digestion - # digestion based validators need this set! - digested_peps = Digestor.digest(Fasta.new(fasta_file), Sequest::Params.new(params_file)) - [badaa_dig, bias, transmem].each do |val| - val.set_false_to_total_ratio(digested_peps) - end -end -transmem.transmem_status_hash = transmem.create_transmem_status_hash(@spec_id.peps) -val_list = [decoy, badaa_freq, badaa_dig, prob, bias, transmem] - -opts = { :validators => val_list } - - -hash = SpecID::Precision::Prob.new.precision_vs_num_hits(@spec_id, opts) -#puts "OUTPUT: " -#puts hash.to_yaml - - -# frozen -e_hash = ProbMSHelper::Answer2 -# hash[:pephits_precision].size.should == e_hash[:pephits_precision].size -# other data types are tested above, just testing validators -hash[:pephits_precision].zip( e_hash[:pephits_precision] ) do |val_hash, val_hash_e| - val_hash[:values].size.should == num_normal - #val_hash[:validator].should == val_hash_e[:validator] - val_hash[:values].zip(val_hash_e[:values]) {|v,e| v.should be_close(e, 0.000000001)} -end - end -end - -=end