mspire 0.4.9 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +27 -17
- data/changelog.txt +31 -62
- data/lib/ms/calc.rb +32 -0
- data/lib/ms/data/interleaved.rb +60 -0
- data/lib/ms/data/lazy_io.rb +73 -0
- data/lib/ms/data/lazy_string.rb +15 -0
- data/lib/ms/data/simple.rb +59 -0
- data/lib/ms/data/transposed.rb +41 -0
- data/lib/ms/data.rb +57 -0
- data/lib/ms/format/format_error.rb +12 -0
- data/lib/ms/spectrum.rb +25 -384
- data/lib/ms/support/binary_search.rb +126 -0
- data/lib/ms.rb +10 -10
- metadata +38 -350
- data/INSTALL +0 -58
- data/README.rdoc +0 -18
- data/Rakefile +0 -330
- data/bin/aafreqs.rb +0 -23
- data/bin/bioworks2excel.rb +0 -14
- data/bin/bioworks_to_pepxml.rb +0 -148
- data/bin/bioworks_to_pepxml_gui.rb +0 -225
- data/bin/fasta_shaker.rb +0 -5
- data/bin/filter_and_validate.rb +0 -5
- data/bin/gi2annot.rb +0 -14
- data/bin/id_class_anal.rb +0 -112
- data/bin/id_precision.rb +0 -172
- data/bin/ms_to_lmat.rb +0 -67
- data/bin/pepproph_filter.rb +0 -16
- data/bin/prob_validate.rb +0 -6
- data/bin/protein_summary.rb +0 -6
- data/bin/protxml2prots_peps.rb +0 -32
- data/bin/raw_to_mzXML.rb +0 -55
- data/bin/run_percolator.rb +0 -122
- data/bin/sqt_group.rb +0 -26
- data/bin/srf_group.rb +0 -27
- data/bin/srf_to_sqt.rb +0 -40
- data/lib/align/chams.rb +0 -78
- data/lib/align.rb +0 -154
- data/lib/archive/targz.rb +0 -94
- data/lib/bsearch.rb +0 -120
- data/lib/core_extensions.rb +0 -16
- data/lib/fasta.rb +0 -626
- data/lib/gi.rb +0 -124
- data/lib/group_by.rb +0 -10
- data/lib/index_by.rb +0 -11
- data/lib/merge_deep.rb +0 -21
- data/lib/ms/converter/mzxml.rb +0 -77
- data/lib/ms/gradient_program.rb +0 -170
- data/lib/ms/msrun.rb +0 -244
- data/lib/ms/msrun_index.rb +0 -108
- data/lib/ms/parser/mzdata/axml.rb +0 -67
- data/lib/ms/parser/mzdata/dom.rb +0 -175
- data/lib/ms/parser/mzdata/libxml.rb +0 -7
- data/lib/ms/parser/mzdata.rb +0 -31
- data/lib/ms/parser/mzxml/axml.rb +0 -70
- data/lib/ms/parser/mzxml/dom.rb +0 -182
- data/lib/ms/parser/mzxml/hpricot.rb +0 -253
- data/lib/ms/parser/mzxml/libxml.rb +0 -19
- data/lib/ms/parser/mzxml/regexp.rb +0 -122
- data/lib/ms/parser/mzxml/rexml.rb +0 -72
- data/lib/ms/parser/mzxml/xmlparser.rb +0 -248
- data/lib/ms/parser/mzxml.rb +0 -282
- data/lib/ms/parser.rb +0 -108
- data/lib/ms/precursor.rb +0 -25
- data/lib/ms/scan.rb +0 -81
- data/lib/mspire.rb +0 -4
- data/lib/pi_zero.rb +0 -244
- data/lib/qvalue.rb +0 -161
- data/lib/roc.rb +0 -187
- data/lib/sample_enzyme.rb +0 -160
- data/lib/scan_i.rb +0 -21
- data/lib/spec_id/aa_freqs.rb +0 -170
- data/lib/spec_id/bioworks.rb +0 -497
- data/lib/spec_id/digestor.rb +0 -138
- data/lib/spec_id/mass.rb +0 -179
- data/lib/spec_id/parser/proph.rb +0 -335
- data/lib/spec_id/precision/filter/cmdline.rb +0 -218
- data/lib/spec_id/precision/filter/interactive.rb +0 -134
- data/lib/spec_id/precision/filter/output.rb +0 -148
- data/lib/spec_id/precision/filter.rb +0 -637
- data/lib/spec_id/precision/output.rb +0 -60
- data/lib/spec_id/precision/prob/cmdline.rb +0 -160
- data/lib/spec_id/precision/prob/output.rb +0 -94
- data/lib/spec_id/precision/prob.rb +0 -249
- data/lib/spec_id/proph/pep_summary.rb +0 -104
- data/lib/spec_id/proph/prot_summary.rb +0 -484
- data/lib/spec_id/proph.rb +0 -4
- data/lib/spec_id/protein_summary.rb +0 -489
- data/lib/spec_id/sequest/params.rb +0 -316
- data/lib/spec_id/sequest/pepxml.rb +0 -1458
- data/lib/spec_id/sequest.rb +0 -33
- data/lib/spec_id/sqt.rb +0 -349
- data/lib/spec_id/srf.rb +0 -973
- data/lib/spec_id.rb +0 -778
- data/lib/spec_id_xml.rb +0 -99
- data/lib/transmem/phobius.rb +0 -147
- data/lib/transmem/toppred.rb +0 -368
- data/lib/transmem.rb +0 -157
- data/lib/validator/aa.rb +0 -48
- data/lib/validator/aa_est.rb +0 -112
- data/lib/validator/background.rb +0 -77
- data/lib/validator/bias.rb +0 -95
- data/lib/validator/cmdline.rb +0 -431
- data/lib/validator/decoy.rb +0 -107
- data/lib/validator/digestion_based.rb +0 -70
- data/lib/validator/probability.rb +0 -51
- data/lib/validator/prot_from_pep.rb +0 -234
- data/lib/validator/q_value.rb +0 -32
- data/lib/validator/transmem.rb +0 -272
- data/lib/validator/true_pos.rb +0 -46
- data/lib/validator.rb +0 -197
- data/lib/xml.rb +0 -38
- data/lib/xml_style_parser.rb +0 -119
- data/lib/xmlparser_wrapper.rb +0 -19
- data/release_notes.txt +0 -2
- data/script/compile_and_plot_smriti_final.rb +0 -97
- data/script/create_little_pepxml.rb +0 -61
- data/script/degenerate_peptides.rb +0 -47
- data/script/estimate_fpr_by_cysteine.rb +0 -226
- data/script/extract_gradient_programs.rb +0 -56
- data/script/find_cysteine_background.rb +0 -137
- data/script/genuine_tps_and_probs.rb +0 -136
- data/script/get_apex_values_rexml.rb +0 -44
- data/script/histogram_probs.rb +0 -61
- data/script/mascot_fix_pepxml.rb +0 -123
- data/script/msvis.rb +0 -42
- data/script/mzXML2timeIndex.rb +0 -25
- data/script/peps_per_bin.rb +0 -67
- data/script/prep_dir.rb +0 -121
- data/script/simple_protein_digestion.rb +0 -27
- data/script/smriti_final_analysis.rb +0 -103
- data/script/sqt_to_meta.rb +0 -24
- data/script/top_hit_per_scan.rb +0 -67
- data/script/toppred_to_yaml.rb +0 -47
- data/script/tpp_installer.rb +0 -249
- data/specs/align_spec.rb +0 -79
- data/specs/bin/bioworks_to_pepxml_spec.rb +0 -79
- data/specs/bin/fasta_shaker_spec.rb +0 -259
- data/specs/bin/filter_and_validate__multiple_vals_helper.yaml +0 -199
- data/specs/bin/filter_and_validate_spec.rb +0 -180
- data/specs/bin/ms_to_lmat_spec.rb +0 -34
- data/specs/bin/prob_validate_spec.rb +0 -86
- data/specs/bin/protein_summary_spec.rb +0 -14
- data/specs/fasta_spec.rb +0 -354
- data/specs/gi_spec.rb +0 -22
- data/specs/load_bin_path.rb +0 -7
- data/specs/merge_deep_spec.rb +0 -13
- data/specs/ms/gradient_program_spec.rb +0 -77
- data/specs/ms/msrun_spec.rb +0 -498
- data/specs/ms/parser_spec.rb +0 -92
- data/specs/ms/spectrum_spec.rb +0 -87
- data/specs/pi_zero_spec.rb +0 -115
- data/specs/qvalue_spec.rb +0 -39
- data/specs/roc_spec.rb +0 -251
- data/specs/rspec_autotest.rb +0 -149
- data/specs/sample_enzyme_spec.rb +0 -126
- data/specs/spec_helper.rb +0 -135
- data/specs/spec_id/aa_freqs_spec.rb +0 -52
- data/specs/spec_id/bioworks_spec.rb +0 -148
- data/specs/spec_id/digestor_spec.rb +0 -75
- data/specs/spec_id/precision/filter/cmdline_spec.rb +0 -20
- data/specs/spec_id/precision/filter/output_spec.rb +0 -31
- data/specs/spec_id/precision/filter_spec.rb +0 -246
- data/specs/spec_id/precision/prob_spec.rb +0 -44
- data/specs/spec_id/precision/prob_spec_helper.rb +0 -0
- data/specs/spec_id/proph/pep_summary_spec.rb +0 -98
- data/specs/spec_id/proph/prot_summary_spec.rb +0 -128
- data/specs/spec_id/protein_summary_spec.rb +0 -189
- data/specs/spec_id/sequest/params_spec.rb +0 -68
- data/specs/spec_id/sequest/pepxml_spec.rb +0 -374
- data/specs/spec_id/sequest_spec.rb +0 -38
- data/specs/spec_id/sqt_spec.rb +0 -246
- data/specs/spec_id/srf_spec.rb +0 -172
- data/specs/spec_id/srf_spec_helper.rb +0 -139
- data/specs/spec_id_helper.rb +0 -33
- data/specs/spec_id_spec.rb +0 -366
- data/specs/spec_id_xml_spec.rb +0 -33
- data/specs/transmem/phobius_spec.rb +0 -425
- data/specs/transmem/toppred_spec.rb +0 -298
- data/specs/transmem_spec.rb +0 -60
- data/specs/transmem_spec_shared.rb +0 -64
- data/specs/validator/aa_est_spec.rb +0 -66
- data/specs/validator/aa_spec.rb +0 -40
- data/specs/validator/background_spec.rb +0 -67
- data/specs/validator/bias_spec.rb +0 -122
- data/specs/validator/decoy_spec.rb +0 -51
- data/specs/validator/fasta_helper.rb +0 -26
- data/specs/validator/prot_from_pep_spec.rb +0 -141
- data/specs/validator/transmem_spec.rb +0 -146
- data/specs/validator/true_pos_spec.rb +0 -58
- data/specs/validator_helper.rb +0 -33
- data/specs/xml_spec.rb +0 -12
- data/test_files/000_pepxml18_small.xml +0 -206
- data/test_files/020a.mzXML.timeIndex +0 -4710
- data/test_files/4-03-03_mzXML/000.mzXML.timeIndex +0 -3973
- data/test_files/4-03-03_mzXML/020.mzXML.timeIndex +0 -3872
- data/test_files/4-03-03_small-prot.xml +0 -321
- data/test_files/4-03-03_small.xml +0 -3876
- data/test_files/7MIX_STD_110802_1.sequest_params_fragment.srf +0 -0
- data/test_files/bioworks-3.3_10prots.xml +0 -5999
- data/test_files/bioworks31.params +0 -77
- data/test_files/bioworks32.params +0 -62
- data/test_files/bioworks33.params +0 -63
- data/test_files/bioworks_single_run_small.xml +0 -7237
- data/test_files/bioworks_small.fasta +0 -212
- data/test_files/bioworks_small.params +0 -63
- data/test_files/bioworks_small.phobius +0 -109
- data/test_files/bioworks_small.toppred.out +0 -2847
- data/test_files/bioworks_small.xml +0 -5610
- data/test_files/bioworks_with_INV_small.xml +0 -3753
- data/test_files/bioworks_with_SHUFF_small.xml +0 -2503
- data/test_files/corrupted_900.srf +0 -0
- data/test_files/head_of_7MIX.srf +0 -0
- data/test_files/interact-opd1_mods_small-prot.xml +0 -304
- data/test_files/messups.fasta +0 -297
- data/test_files/opd1/000.my_answer.100lines.xml +0 -101
- data/test_files/opd1/000.tpp_1.2.3.first10.xml +0 -115
- data/test_files/opd1/000.tpp_2.9.2.first10.xml +0 -126
- data/test_files/opd1/000.v2.1.mzXML.timeIndex +0 -3748
- data/test_files/opd1/000_020-prot.png +0 -0
- data/test_files/opd1/000_020_3prots-prot.mod_initprob.xml +0 -62
- data/test_files/opd1/000_020_3prots-prot.xml +0 -62
- data/test_files/opd1/opd1_cat_inv_small-prot.xml +0 -139
- data/test_files/opd1/sequest.3.1.params +0 -77
- data/test_files/opd1/sequest.3.2.params +0 -62
- data/test_files/opd1/twenty_scans.mzXML +0 -418
- data/test_files/opd1/twenty_scans.v2.1.mzXML +0 -382
- data/test_files/opd1/twenty_scans_answ.lmat +0 -0
- data/test_files/opd1/twenty_scans_answ.lmata +0 -9
- data/test_files/opd1_020_beginning.RAW +0 -0
- data/test_files/opd1_2runs_2mods/data/020.mzData.xml +0 -683
- data/test_files/opd1_2runs_2mods/data/020.readw.mzXML +0 -382
- data/test_files/opd1_2runs_2mods/data/040.mzData.xml +0 -683
- data/test_files/opd1_2runs_2mods/data/040.readw.mzXML +0 -382
- data/test_files/opd1_2runs_2mods/data/README.txt +0 -6
- data/test_files/opd1_2runs_2mods/interact-opd1_mods__small.xml +0 -753
- data/test_files/orbitrap_mzData/000_cut.xml +0 -1920
- data/test_files/pepproph_small.xml +0 -4691
- data/test_files/phobius.small.noheader.txt +0 -50
- data/test_files/phobius.small.small.txt +0 -53
- data/test_files/s01_anC1_ld020mM.key.txt +0 -25
- data/test_files/s01_anC1_ld020mM.meth +0 -0
- data/test_files/small.fasta +0 -297
- data/test_files/small.sqt +0 -87
- data/test_files/smallraw.RAW +0 -0
- data/test_files/tf_bioworks2excel.bioXML +0 -14340
- data/test_files/tf_bioworks2excel.txt.actual +0 -1035
- data/test_files/toppred.small.out +0 -416
- data/test_files/toppred.xml.out +0 -318
- data/test_files/validator_hits_separate/bias_bioworks_small_HS.fasta +0 -7
- data/test_files/validator_hits_separate/bioworks_small_HS.xml +0 -5651
- data/test_files/yeast_gly_small-prot.xml +0 -265
- data/test_files/yeast_gly_small.1.0_1.0_1.0.parentTimes +0 -6
- data/test_files/yeast_gly_small.xml +0 -3807
- data/test_files/yeast_gly_small2.parentTimes +0 -6
@@ -1,189 +0,0 @@
|
|
1
|
-
require File.expand_path( File.dirname(__FILE__) + '/../spec_helper' )
|
2
|
-
require 'spec_id/protein_summary'
|
3
|
-
|
4
|
-
xdescribe ProteinSummary do
|
5
|
-
|
6
|
-
before(:all) do
|
7
|
-
@tf_proph = Tfiles_l + "/opd1/000_020-prot.xml"
|
8
|
-
@tf_summary = Tfiles_l + "/opd1/000_020-prot.summary.html"
|
9
|
-
@tf_bioworks_small = Tfiles + '/bioworks_small.xml'
|
10
|
-
@tf_bioworks_small_summary_html = Tfiles + '/bioworks_small.summary.html'
|
11
|
-
@tf_proph_cat_inv = Tfiles + '/opd1/opd1_cat_inv_small-prot.xml'
|
12
|
-
@tf_proph_cat_inv_summary_html = Tfiles + '/opd1/opd1_cat_inv_small-prot.summary.html'
|
13
|
-
@tf_proph_cat_inv_summary_png = Tfiles + '/opd1/opd1_cat_inv_small-prot.summary.png'
|
14
|
-
@tf_peptide_count = Tfiles + "/peptide_counts.tmp.txt"
|
15
|
-
@no_delete = false
|
16
|
-
end
|
17
|
-
|
18
|
-
spec_large do
|
19
|
-
it 'does basic summary on prophet file' do
|
20
|
-
runit "-c 5.0 #{@tf_proph}"
|
21
|
-
@tf_summary.exist_as_a_file?.should be_true
|
22
|
-
string = IO.read(@tf_summary)
|
23
|
-
string.should =~ /gi\|16132176\|ref\|NP_418775\.1\|/
|
24
|
-
string.should =~ /16132176/
|
25
|
-
File.unlink(@tf_summary) unless @no_delete
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'does basic summary on bioworks.xml file' do
|
30
|
-
runit "#{@tf_bioworks_small}"
|
31
|
-
@tf_bioworks_small_summary_html.exist_as_a_file?.should be_true
|
32
|
-
File.unlink @tf_bioworks_small_summary_html unless @no_delete
|
33
|
-
# @TODO: need to freeze the output here
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
it 'calculates precision values with bioworks files' do
|
38
|
-
## Could reimplement a separate file approach?
|
39
|
-
#reply = `#{@cmd} -f #{@tf_bioworks_small} #{@tf_bioworks_small} --precision`
|
40
|
-
runit "#{@tf_bioworks_small} --precision"
|
41
|
-
IO.read(@tf_bioworks_small_summary_html).should =~ /# hits.*106/m
|
42
|
-
# should add more tests here...
|
43
|
-
@tf_bioworks_small_summary_html.exist_as_a_file?.should be_true
|
44
|
-
File.unlink @tf_bioworks_small_summary_html unless @no_delete
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'calculates precision values with prophet files' do
|
48
|
-
runit "#{@tf_proph_cat_inv} -f INV_ --prefix --precision"
|
49
|
-
html = IO.read(@tf_proph_cat_inv_summary_html)
|
50
|
-
html.should =~ /# hits/
|
51
|
-
html.should =~ /2.*0\.0000/m
|
52
|
-
html.should =~ /3.*0\.3333/m
|
53
|
-
html.should =~ /7.*0\.5714/m
|
54
|
-
|
55
|
-
File.unlink @tf_proph_cat_inv_summary_html unless @no_delete
|
56
|
-
File.unlink @tf_proph_cat_inv_summary_png unless @no_delete
|
57
|
-
end
|
58
|
-
|
59
|
-
spec_large do
|
60
|
-
it 'gives correct peptide counts' do
|
61
|
-
runit "-c 5.0 #{@tf_proph} --peptide_count #{@tf_peptide_count}"
|
62
|
-
@tf_peptide_count.exist_as_a_file?.should be_true
|
63
|
-
file = IO.read(@tf_peptide_count)
|
64
|
-
file.should include("gi|16132176|ref|NP_418775.1|\t2")
|
65
|
-
file.should include("gi|16131996|ref|NP_418595.1|\t1")
|
66
|
-
file.should include("gi|16131692|ref|NP_418288.1|\t4")
|
67
|
-
File.unlink @tf_peptide_count unless @no_delete
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def runit(string_or_args)
|
72
|
-
args = if string_or_args.is_a? String
|
73
|
-
string_or_args.split(/\s+/)
|
74
|
-
else
|
75
|
-
string_or_args
|
76
|
-
end
|
77
|
-
ProteinSummary.new.create_from_command_line_args(args)
|
78
|
-
end
|
79
|
-
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
|
-
|
84
|
-
=begin
|
85
|
-
|
86
|
-
require 'test/unit'
|
87
|
-
require 'spec_id/protein_summary'
|
88
|
-
require File.dirname(__FILE__) + '/test_helper'
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
class ProphProtSummaryTest < Test::Unit::TestCase
|
93
|
-
|
94
|
-
NODELETE = false
|
95
|
-
|
96
|
-
def initialize(arg)
|
97
|
-
super(arg)
|
98
|
-
@tfiles = File.dirname(__FILE__) + '/tfiles/'
|
99
|
-
@tfiles_l = File.dirname(__FILE__) + '/tfiles_large/'
|
100
|
-
@tf_proph = @tfiles_l + "opd1/000_020-prot.xml"
|
101
|
-
@tf_summary = @tfiles_l + "opd1/000_020-prot.summary.html"
|
102
|
-
@tf_bioworks_small = @tfiles + 'bioworks_small.xml'
|
103
|
-
@tf_bioworks_small_summary_html = @tfiles + 'bioworks_small.summary.html'
|
104
|
-
@tf_proph_cat_inv = @tfiles + 'opd1/opd1_cat_inv_small-prot.xml'
|
105
|
-
@tf_proph_cat_inv_summary_html = @tfiles + 'opd1/opd1_cat_inv_small-prot.summary.html'
|
106
|
-
@tf_proph_cat_inv_summary_png = @tfiles + 'opd1/opd1_cat_inv_small-prot.summary.png'
|
107
|
-
@tf_peptide_count = @tfiles + "peptide_counts.tmp.txt"
|
108
|
-
end
|
109
|
-
|
110
|
-
def runit(string_or_args)
|
111
|
-
args = if string_or_args.is_a? String
|
112
|
-
string_or_args.split(/\s+/)
|
113
|
-
else
|
114
|
-
string_or_args
|
115
|
-
end
|
116
|
-
ProteinSummary.new.create_from_command_line_args(args)
|
117
|
-
end
|
118
|
-
|
119
|
-
|
120
|
-
def test_usage
|
121
|
-
output = capture_stdout {
|
122
|
-
runit('')
|
123
|
-
}
|
124
|
-
assert_match(/usage:/, output)
|
125
|
-
end
|
126
|
-
|
127
|
-
def test_proph_basic
|
128
|
-
if File.exist? @tfiles_l
|
129
|
-
runit "-c 5.0 #{@tf_proph}"
|
130
|
-
ProteinSummary.new.create_from_command_line_args([@tf_proph, '-c', '5.0'])
|
131
|
-
assert(File.exist?(@tf_summary), "file #{@tf_summary} exists")
|
132
|
-
string = IO.read(@tf_summary)
|
133
|
-
assert_match(/gi\|16132176\|ref\|NP_418775\.1\|/, string)
|
134
|
-
assert_match(/16132176/, string)
|
135
|
-
File.unlink(@tf_summary) unless NODELETE
|
136
|
-
else
|
137
|
-
assert_nil( puts("--SKIPPING TEST-- (missing dir: #{@tfiles_l})") )
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
def test_bioworks_basic
|
142
|
-
runit "#{@tf_bioworks_small}"
|
143
|
-
assert(File.exist?(@tf_bioworks_small_summary_html), "file #{@tf_bioworks_small_summary_html} exists")
|
144
|
-
File.unlink @tf_bioworks_small_summary_html unless NODELETE
|
145
|
-
|
146
|
-
# @TODO: need to freeze the output here
|
147
|
-
end
|
148
|
-
|
149
|
-
def test_bioworks_with_precision
|
150
|
-
## Could reimplement a separate file approach?
|
151
|
-
#reply = `#{@cmd} -f #{@tf_bioworks_small} #{@tf_bioworks_small} --precision`
|
152
|
-
runit "#{@tf_bioworks_small} --precision"
|
153
|
-
assert_match(/# hits.*106/m, IO.read(@tf_bioworks_small_summary_html))
|
154
|
-
#assert_match(/False Positive Rate.*: 0.500/, IO.read(@tf_bioworks_small_summary_html))
|
155
|
-
#assert_match(/False Positive Rate.*: 0.500/, IO.read(@tf_bioworks_small_summary_html))
|
156
|
-
assert(File.exist?(@tf_bioworks_small_summary_html), "file #{@tf_bioworks_small_summary_html} exists")
|
157
|
-
File.unlink @tf_bioworks_small_summary_html unless NODELETE
|
158
|
-
end
|
159
|
-
|
160
|
-
def test_proph_with_precision
|
161
|
-
#puts @cmd
|
162
|
-
runit "#{@tf_proph_cat_inv} -f INV_ --prefix --precision"
|
163
|
-
html = IO.read(@tf_proph_cat_inv_summary_html)
|
164
|
-
assert_match(/# hits/, html, "in #{@tf_proph_cat_inv_summary_html}")
|
165
|
-
assert_match(/2.*0\.0000/m, html, "in #{@tf_proph_cat_inv_summary_html}")
|
166
|
-
assert_match(/3.*0\.3333/m, html, "in #{@tf_proph_cat_inv_summary_html}")
|
167
|
-
assert_match(/7.*0\.5714/m, html, "in #{@tf_proph_cat_inv_summary_html}")
|
168
|
-
|
169
|
-
File.unlink @tf_proph_cat_inv_summary_html unless NODELETE
|
170
|
-
File.unlink @tf_proph_cat_inv_summary_png unless NODELETE
|
171
|
-
end
|
172
|
-
|
173
|
-
def test_peptide_count
|
174
|
-
if File.exist? @tfiles_l
|
175
|
-
runit "-c 5.0 #{@tf_proph} --peptide_count #{@tf_peptide_count}"
|
176
|
-
assert(File.exist?(@tf_peptide_count), "file #{@tf_peptide_count} exists")
|
177
|
-
file = IO.read(@tf_peptide_count)
|
178
|
-
assert_match("gi|16132176|ref|NP_418775.1|\t2", file)
|
179
|
-
assert_match("gi|16131996|ref|NP_418595.1|\t1", file)
|
180
|
-
assert_match("gi|16131692|ref|NP_418288.1|\t4", file)
|
181
|
-
File.unlink @tf_peptide_count unless NODELETE
|
182
|
-
else
|
183
|
-
assert_nil( puts("--SKIPPING TEST-- (missing dir: #{@tfiles_l})") )
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
end
|
188
|
-
|
189
|
-
=end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require File.expand_path( File.dirname(__FILE__) + '/../../spec_helper' )
|
2
|
-
require 'spec_id/sequest/params'
|
3
|
-
|
4
|
-
|
5
|
-
describe "a sequest params object", :shared => true do
|
6
|
-
before(:each) do
|
7
|
-
@obj = Sequest::Params.new(@file)
|
8
|
-
end
|
9
|
-
it 'gives enzyme_specificity' do
|
10
|
-
ar = @obj.enzyme_specificity
|
11
|
-
ar.size.should == 3
|
12
|
-
ar.should == @enzyme_specificity
|
13
|
-
end
|
14
|
-
it 'returns static mods callable by key' do
|
15
|
-
@obj.add_Cterm_peptide.should == @add_Cterm_peptide
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
describe Sequest::Params, "with a bioworks 3.1 params" do
|
21
|
-
before(:all) do
|
22
|
-
@file = Tfiles + '/bioworks31.params'
|
23
|
-
@obj = Sequest::Params.new(@file)
|
24
|
-
@enzyme_specificity = [1, 'KR', '']
|
25
|
-
@add_Cterm_peptide = '0.0000'
|
26
|
-
end
|
27
|
-
it_should_behave_like 'a sequest params object'
|
28
|
-
end
|
29
|
-
|
30
|
-
describe Sequest::Params, "with a bioworks 3.2 params" do
|
31
|
-
before(:all) do
|
32
|
-
@file = Tfiles + '/bioworks32.params'
|
33
|
-
@obj = Sequest::Params.new(@file)
|
34
|
-
@enzyme_specificity = [1, 'KR', 'P']
|
35
|
-
@add_Cterm_peptide = '0.0000'
|
36
|
-
end
|
37
|
-
it_should_behave_like 'a sequest params object'
|
38
|
-
end
|
39
|
-
|
40
|
-
describe Sequest::Params, "with a bioworks 3.3 params" do
|
41
|
-
before(:all) do
|
42
|
-
@file = Tfiles + '/bioworks33.params'
|
43
|
-
@obj = Sequest::Params.new(@file)
|
44
|
-
@enzyme_specificity = [1, 'KR', '']
|
45
|
-
@add_Cterm_peptide = '0.0000'
|
46
|
-
end
|
47
|
-
it_should_behave_like 'a sequest params object'
|
48
|
-
end
|
49
|
-
|
50
|
-
describe Sequest::Params, "given a bioworks 3.2 params (from .srf file)" do
|
51
|
-
before(:all) do
|
52
|
-
@file = Tfiles + '/7MIX_STD_110802_1.sequest_params_fragment.srf'
|
53
|
-
@obj = Sequest::Params.new(@file)
|
54
|
-
@enzyme_specificity = [1, 'KR', 'P']
|
55
|
-
@add_Cterm_peptide = '0.0000'
|
56
|
-
end
|
57
|
-
it_should_behave_like 'a sequest params object'
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
|
-
describe Sequest::Params do
|
62
|
-
it '(private) can give a system independent basename' do
|
63
|
-
Sequest::Params.new._sys_ind_basename("C:\\Xcalibur\\database\\hello.fasta").should == "hello.fasta"
|
64
|
-
Sequest::Params.new._sys_ind_basename("/work/john/hello.fasta").should == "hello.fasta"
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
@@ -1,374 +0,0 @@
|
|
1
|
-
|
2
|
-
require File.expand_path( File.dirname(__FILE__) + '/../../spec_helper' )
|
3
|
-
|
4
|
-
require 'spec_id'
|
5
|
-
require 'spec_id/sequest/pepxml'
|
6
|
-
#require 'ms/mzxml'
|
7
|
-
|
8
|
-
|
9
|
-
NODELETE = false
|
10
|
-
|
11
|
-
describe Sequest::PepXML, " created from small bioworks.xml" do
|
12
|
-
|
13
|
-
spec_large do
|
14
|
-
before(:all) do
|
15
|
-
tf_mzxml_path = Tfiles_l + "/yeast_gly_mzXML"
|
16
|
-
|
17
|
-
tf_params = Tfiles + "/bioworks32.params"
|
18
|
-
tf_bioworks_xml = Tfiles + "/bioworks_small.xml"
|
19
|
-
out_path = Tfiles
|
20
|
-
@pepxml_objs = Sequest::PepXML.set_from_bioworks(tf_bioworks_xml, :params => tf_params, :ms_data => tf_mzxml_path, :out_path => out_path)
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'gets some spectrum queries' do
|
24
|
-
@pepxml_objs.each do |obj|
|
25
|
-
(obj.spectrum_queries.size > 2).should be_true
|
26
|
-
(obj.spectrum_queries.first.search_results.first.search_hits.size > 0).should be_true
|
27
|
-
end
|
28
|
-
#@pepxml_objs.each do |pep| puts pep.to_pepxml end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
describe Sequest::PepXML, " created from large bioworks.xml" do
|
36
|
-
# assert_equal_by_pairs (really any old array)
|
37
|
-
def assert_equal_pairs(obj, arrs)
|
38
|
-
arrs.each do |arr|
|
39
|
-
#if obj.send(arr[1]) != arr[0]
|
40
|
-
# puts "HELLO"
|
41
|
-
# puts "OBJ answer"
|
42
|
-
# p obj.send(arr[1])
|
43
|
-
# puts "ar0"
|
44
|
-
# p arr[0]
|
45
|
-
# puts "ar1"
|
46
|
-
# p arr[1]
|
47
|
-
#end
|
48
|
-
if arr[0].is_a? Float
|
49
|
-
obj.send(arr[1]).should be_close(arr[0], 0.0000000001)
|
50
|
-
else
|
51
|
-
obj.send(arr[1]).should == arr[0]
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
#swap the first to guys first
|
57
|
-
def assert_equal_pairs_swapped(obj, arrs)
|
58
|
-
arrs.each do |arr|
|
59
|
-
arr[0], arr[1] = arr[1], arr[0]
|
60
|
-
end
|
61
|
-
assert_equal_pairs(obj, arrs)
|
62
|
-
end
|
63
|
-
|
64
|
-
spec_large do
|
65
|
-
before(:all) do
|
66
|
-
st = Time.new
|
67
|
-
params = Tfiles + "/opd1/sequest.3.2.params"
|
68
|
-
bioworks_xml = Tfiles_l + "/opd1/bioworks.000.oldparams.xml"
|
69
|
-
mzxml_path = Tfiles_l + "/opd1"
|
70
|
-
out_path = Tfiles
|
71
|
-
@pepxml_version = 18
|
72
|
-
@pepxml_objs = Sequest::PepXML.set_from_bioworks_xml(bioworks_xml, params, {:ms_data => mzxml_path, :out_path => out_path, :pepxml_version => @pepxml_version})
|
73
|
-
puts "- takes #{Time.new - st} secs"
|
74
|
-
end
|
75
|
-
|
76
|
-
it 'extracts MSMSPipelineAnalysis' do
|
77
|
-
######## HMMMMM...
|
78
|
-
Sequest::PepXML.pepxml_version.should == @pepxml_version
|
79
|
-
|
80
|
-
# MSMSPipelineAnalysis
|
81
|
-
po = @pepxml_objs.first
|
82
|
-
msms_pipeline = po.msms_pipeline_analysis
|
83
|
-
msms_pipeline.xmlns.should == 'http://regis-web.systemsbiology.net/pepXML'
|
84
|
-
msms_pipeline.xmlns_xsi.should == 'http://www.w3.org/2001/XMLSchema-instance'
|
85
|
-
msms_pipeline.xsi_schema_location.should == 'http://regis-web.systemsbiology.net/pepXML /tools/bin/TPP/tpp/schema/pepXML_v18.xsd'
|
86
|
-
msms_pipeline.summary_xml.should == '000.xml'
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'extracts MSmSRunSummary' do
|
90
|
-
# MSMSRunSummary
|
91
|
-
rs = @pepxml_objs.first.msms_pipeline_analysis.msms_run_summary
|
92
|
-
rs.base_name.should =~ /\/000/
|
93
|
-
assert_equal_pairs(rs, [ ['ThermoFinnigan', :ms_manufacturer], ['LCQ Deca XP Plus', :ms_model], ['ESI', :ms_ionization], ['Ion Trap', :ms_mass_analyzer], ['UNKNOWN', :ms_detector], ['raw', :raw_data_type], ['.mzXML', :raw_data], ])
|
94
|
-
end
|
95
|
-
|
96
|
-
it 'extracts SampleEnzyme' do
|
97
|
-
# SampleEnzyme
|
98
|
-
se = @pepxml_objs.first.msms_pipeline_analysis.msms_run_summary.sample_enzyme
|
99
|
-
assert_equal_pairs(se, [ ['Trypsin', :name], ['KR', :cut], [nil, :no_cut], ['C', :sense], ])
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'extracts SearchSummary' do
|
103
|
-
# SearchSummary
|
104
|
-
ss = @pepxml_objs.first.msms_pipeline_analysis.msms_run_summary.search_summary
|
105
|
-
ss.is_a?(Sequest::PepXML::SearchSummary).should be_true
|
106
|
-
ss.base_name.should =~ /\/000/
|
107
|
-
ss.peptide_mass_tol.should =~ /1\.500/
|
108
|
-
assert_equal_pairs_swapped(ss, [ # normal attributes
|
109
|
-
[:search_engine, "SEQUEST"], [:precursor_mass_type, "average"], [:fragment_mass_type, "average"], [:out_data_type, "out"], [:out_data, ".tgz"], [:search_id, "1"],
|
110
|
-
|
111
|
-
# enzymatic_search_constraint
|
112
|
-
[:enzyme, 'Trypsin'], [:max_num_internal_cleavages, '2'], [:min_number_termini, '2'],
|
113
|
-
|
114
|
-
# parameters
|
115
|
-
[:fragment_ion_tol, "1.0000"], [:ion_series, "0 1 1 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0"], [:max_num_differential_AA_per_mod, "3"], [:nucleotide_reading_frame, "0"], [:num_output_lines, "10"], [:remove_precursor_peak, "0"], [:ion_cutoff_percentage, "0.0000"], [:match_peak_count, "0"], [:match_peak_allowed_error, "1"], [:match_peak_tolerance, "1.0000"], [:protein_mass_filter, "0 0"],
|
116
|
-
])
|
117
|
-
|
118
|
-
end
|
119
|
-
it 'extracts SearchDatabase' do
|
120
|
-
# SearchDatabase
|
121
|
-
sd = @pepxml_objs.first.msms_pipeline_analysis.msms_run_summary.search_summary.search_database
|
122
|
-
sd.is_a?(Sequest::PepXML::SearchDatabase).should be_true
|
123
|
-
assert_equal_pairs_swapped(sd, [ [:local_path, "C:\\Xcalibur\\database\\ecoli_K12.fasta"], [:seq_type, 'AA'], ])
|
124
|
-
end
|
125
|
-
|
126
|
-
it 'returns SpectrumQueries' do
|
127
|
-
# SpectrumQueries
|
128
|
-
sq = @pepxml_objs.first.msms_pipeline_analysis.msms_run_summary.spectrum_queries
|
129
|
-
spec = sq.first
|
130
|
-
assert_equal_pairs_swapped(spec, [
|
131
|
-
[:spectrum, "000.100.100.1"], [:start_scan, "100"], [:end_scan, "100"],
|
132
|
-
#[:precursor_neutral_mass, "1074.5920"], # out2summary
|
133
|
-
[:precursor_neutral_mass, 1074.666926], # mine
|
134
|
-
[:assumed_charge, 1], [:index, "1"],
|
135
|
-
])
|
136
|
-
sh = spec.search_results.first.search_hits.first
|
137
|
-
assert_equal_pairs_swapped(sh, [
|
138
|
-
# normal attributes
|
139
|
-
[:hit_rank, 1],
|
140
|
-
[:peptide, "SIYFRNFK"],
|
141
|
-
[:peptide_prev_aa, "R"],
|
142
|
-
[:peptide_next_aa, "G"],
|
143
|
-
[:protein, "gi|16130084|ref|NP_416651.1|"],
|
144
|
-
[:num_tot_proteins, 1],
|
145
|
-
[:num_matched_ions, 4],
|
146
|
-
[:tot_num_ions, 14],
|
147
|
-
#[:calc_neutral_pep_mass, "1074.1920"], # out2summary
|
148
|
-
[:calc_neutral_pep_mass, 1074.23261], # mine
|
149
|
-
#[:massdiff, "+0.400000"], # out2summary
|
150
|
-
[:massdiff, 0.434316000000081], # mine
|
151
|
-
[:num_tol_term, 2], [:num_missed_cleavages, 1], [:is_rejected, 0],
|
152
|
-
|
153
|
-
# search_score
|
154
|
-
[:xcorr, 0.4], [:deltacn, 0.023], [:deltacnstar, "0"], [:spscore, 78.8], [:sprank, 1],
|
155
|
-
])
|
156
|
-
|
157
|
-
spec = sq[1]
|
158
|
-
assert_equal_pairs_swapped(spec, [
|
159
|
-
[:spectrum, "000.1000.1000.1"], [:start_scan, "1000"], [:end_scan, "1000"], #[:precursor_neutral_mass, "663.1920"], # out2summary
|
160
|
-
[:precursor_neutral_mass, 663.206111], # mine
|
161
|
-
[:assumed_charge, 1], [:index, "2"],
|
162
|
-
])
|
163
|
-
|
164
|
-
sh = spec.search_results.first.search_hits.first
|
165
|
-
assert_equal_pairs_swapped(sh, [
|
166
|
-
# normal attributes
|
167
|
-
[:hit_rank, 1], [:peptide, "ALADFK"], [:peptide_prev_aa, "R"], [:peptide_next_aa, "S"], [:protein, "gi|16128765|ref|NP_415318.1|"], [:num_tot_proteins, 1], [:num_matched_ions, 5], [:tot_num_ions, 10],
|
168
|
-
[:num_tol_term, 2], [:num_missed_cleavages, 0], [:is_rejected, 0],
|
169
|
-
#[:massdiff, "-0.600000"], # out2summary
|
170
|
-
[:massdiff, -0.556499000000031], # mine
|
171
|
-
#[:calc_neutral_pep_mass, 663.7920], # out2summary
|
172
|
-
[:calc_neutral_pep_mass, 663.76261], # mine
|
173
|
-
|
174
|
-
# search_score
|
175
|
-
[:xcorr, 0.965], [:deltacn, 0.132], [:deltacnstar, "0"], [:spscore, 81.1], [:sprank, 1],
|
176
|
-
])
|
177
|
-
|
178
|
-
spec = sq[9]
|
179
|
-
assert_equal_pairs_swapped(spec, [
|
180
|
-
[:spectrum, "000.1008.1008.2"], [:start_scan, "1008"], [:end_scan, "1008"], [:assumed_charge, 2],
|
181
|
-
#[:precursor_neutral_mass, "691.0920"], # out2summary
|
182
|
-
[:precursor_neutral_mass, 691.150992], # mine
|
183
|
-
])
|
184
|
-
|
185
|
-
sh = spec.search_results.first.search_hits.first
|
186
|
-
assert_equal_pairs_swapped(sh, [
|
187
|
-
# normal attributes
|
188
|
-
[:hit_rank, 1], [:peptide, "RLFTR"], [:peptide_prev_aa, "R"], [:peptide_next_aa, "A"], [:protein, "gi|16130457|ref|NP_417027.1|"], [:num_tot_proteins, 1], [:num_matched_ions, 5], [:tot_num_ions, 8], [:num_tol_term, 2],
|
189
|
-
|
190
|
-
#[:num_missed_cleavages, "0"], # out2summary misses this!
|
191
|
-
[:num_missed_cleavages, 1],
|
192
|
-
[:is_rejected, 0],
|
193
|
-
#[:calc_neutral_pep_mass, "691.7920"], # out2summary
|
194
|
-
[:calc_neutral_pep_mass, 691.82261], # mine
|
195
|
-
#[:massdiff, "-0.700000"], # out2summary
|
196
|
-
[:massdiff, -0.67161800000008], # mine
|
197
|
-
|
198
|
-
# search_score
|
199
|
-
[:xcorr, 0.903], [:deltacn, 0.333], [:deltacnstar, "0"], [:spscore, 172.8], [:sprank, 1],
|
200
|
-
])
|
201
|
-
end
|
202
|
-
|
203
|
-
it 'can generate correct pepxml file' do
|
204
|
-
|
205
|
-
## IF OUR OBJECT IS CORRECT, THEN WE GET THE OUTPUT:
|
206
|
-
string = @pepxml_objs.first.to_pepxml
|
207
|
-
ans_lines = IO.read(Tfiles + "/opd1/000.my_answer.100lines.xml").split("\n")
|
208
|
-
base_name_re = /base_name=".*?files\//o
|
209
|
-
date_re = /date=".*?"/
|
210
|
-
string.split("\n").each_with_index do |line,i|
|
211
|
-
if i > 99 ; break end
|
212
|
-
ans, exp =
|
213
|
-
if i == 1
|
214
|
-
[line.sub(date_re,''), ans_lines[i].sub(date_re,'')]
|
215
|
-
elsif i == 2
|
216
|
-
[line.sub(base_name_re,''), ans_lines[i].sub(base_name_re, '').sub(/^\s+/, "\t")]
|
217
|
-
elsif i == 6
|
218
|
-
[line.sub(base_name_re,''), ans_lines[i].sub(base_name_re, '').sub(/^\s+/, "\t\t")]
|
219
|
-
else
|
220
|
-
[line, ans_lines[i]]
|
221
|
-
end
|
222
|
-
|
223
|
-
#ans.split('').zip(exp.split('')) do |l,a|
|
224
|
-
# if l != a
|
225
|
-
# puts line
|
226
|
-
# puts ans_lines[i]
|
227
|
-
# puts l
|
228
|
-
# puts a
|
229
|
-
# end
|
230
|
-
#end
|
231
|
-
if ans != exp
|
232
|
-
puts ans
|
233
|
-
puts exp
|
234
|
-
end
|
235
|
-
ans.should == exp
|
236
|
-
#line.sub(base_name_re,'').should == ans_lines[i].sub(base_name_re,'')
|
237
|
-
end
|
238
|
-
end
|
239
|
-
end
|
240
|
-
end
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
describe Sequest::PepXML::Modifications do
|
245
|
-
before(:each) do
|
246
|
-
tf_params = Tfiles + "/bioworks32.params"
|
247
|
-
@params = Sequest::Params.new(tf_params)
|
248
|
-
# The params object here is completely unnecessary for this test, except
|
249
|
-
# that it sets up the mass table
|
250
|
-
@obj = Sequest::PepXML::Modifications.new(@params, "(M* +15.90000) (M# +29.00000) (S@ +80.00000) (C^ +12.00000) (ct[ +12.33000) (nt] +14.20000) ")
|
251
|
-
end
|
252
|
-
it 'creates a mod_symbols_hash' do
|
253
|
-
answ = {[:C, 12.0]=>"^", [:S, 80.0]=>"@", [:M, 29.0]=>"#", [:M, 15.9]=>"*", [:ct, 12.33]=>"[", [:nt, 14.2]=>"]"}
|
254
|
-
@obj.mod_symbols_hash.should == answ
|
255
|
-
## need more here
|
256
|
-
end
|
257
|
-
|
258
|
-
it 'creates a ModificationInfo object given a special peptide sequence' do
|
259
|
-
mod_string = "(M* +15.90000) (M# +29.00000) (S@ +80.00000) (C^ +12.00000) (ct[ +12.33000) (nt] +14.20000) "
|
260
|
-
@params.diff_search_options = "15.90000 M 29.00000 M 80.00000 S 12.00000 C"
|
261
|
-
@params.term_diff_search_options = "14.20000 12.33000"
|
262
|
-
mod = Sequest::PepXML::Modifications.new(@params, mod_string)
|
263
|
-
## no mods
|
264
|
-
peptide = "PEPTIDE"
|
265
|
-
mod.modification_info(peptide).should be_nil
|
266
|
-
peptide = "]M*EC^S@IDM#M*EMSCM["
|
267
|
-
modinfo = mod.modification_info(peptide)
|
268
|
-
modinfo.modified_peptide.should == peptide
|
269
|
-
modinfo.mod_nterm_mass.should be_close(146.40054, 0.000001)
|
270
|
-
modinfo.mod_cterm_mass.should be_close(160.52994, 0.000001)
|
271
|
-
end
|
272
|
-
|
273
|
-
end
|
274
|
-
|
275
|
-
describe Sequest::PepXML::SearchHit::ModificationInfo do
|
276
|
-
|
277
|
-
before(:each) do
|
278
|
-
modaaobjs = [[3, 150.3], [6, 345.2]].map do |ar|
|
279
|
-
Sequest::PepXML::SearchHit::ModificationInfo::ModAminoacidMass.new(ar)
|
280
|
-
end
|
281
|
-
hash = {
|
282
|
-
:mod_nterm_mass => 520.2,
|
283
|
-
:modified_peptide => "MOD*IFI^E&D",
|
284
|
-
:mod_aminoacid_masses => modaaobjs,
|
285
|
-
}
|
286
|
-
#answ = "<modification_info mod_nterm_mass=\"520.2\" modified_peptide=\"MOD*IFI^E&D\">\n\t<mod_aminoacid_mass position=\"3\" mass=\"150.3\"/>\n\t<mod_aminoacid_mass position=\"6\" mass=\"345.2\"/>\n</modification_info>\n"
|
287
|
-
@obj = Sequest::PepXML::SearchHit::ModificationInfo.new(hash)
|
288
|
-
end
|
289
|
-
|
290
|
-
def _re(st)
|
291
|
-
/#{Regexp.escape(st)}/
|
292
|
-
end
|
293
|
-
|
294
|
-
it 'can produce pepxml' do
|
295
|
-
answ = @obj.to_pepxml
|
296
|
-
answ.should =~ _re('<modification_info')
|
297
|
-
answ.should =~ _re(" mod_nterm_mass=\"520.2\"")
|
298
|
-
answ.should =~ _re(" modified_peptide=\"MOD*IFI^E&D\"")
|
299
|
-
answ.should =~ _re("<mod_aminoacid_mass")
|
300
|
-
answ.should =~ _re(" position=\"3\"")
|
301
|
-
answ.should =~ _re(" mass=\"150.3\"")
|
302
|
-
answ.should =~ _re(" position=\"6\"")
|
303
|
-
answ.should =~ _re(" mass=\"345.2\"")
|
304
|
-
answ.should =~ _re("</modification_info>")
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
|
-
describe 'bioworks file with modifications transformed into pepxml' do
|
309
|
-
|
310
|
-
spec_large do
|
311
|
-
before(:all) do
|
312
|
-
modfiles_sequest_dir = Tfiles_l + '/opd1_2runs_2mods/sequest33/'
|
313
|
-
modfiles_data_dir = Tfiles_l + '/opd1_2runs_2mods/data/'
|
314
|
-
@srgfile = modfiles_sequest_dir + 'tmp.srg'
|
315
|
-
@out_path = modfiles_sequest_dir + 'pepxml'
|
316
|
-
modfiles = %w(020 040).map do |file|
|
317
|
-
modfiles_sequest_dir + file + ".srf"
|
318
|
-
end
|
319
|
-
objs = Sequest::PepXML.set_from_bioworks( SRFGroup.new(modfiles).to_srg(@srgfile), {:ms_data => modfiles_data_dir, :out_path => @out_path, :print => true, :backup_db_path => '/project/marcotte/marcotte/ms/database'} )
|
320
|
-
@out_files = %w(020 040).map do |file|
|
321
|
-
@out_path + '/' + file + '.xml'
|
322
|
-
end
|
323
|
-
end
|
324
|
-
|
325
|
-
after(:all) do
|
326
|
-
File.unlink(@srgfile) unless NODELETE
|
327
|
-
FileUtils.rm_r(@out_path)
|
328
|
-
#@out_files.each do |fn|
|
329
|
-
# File.unlink(fn) unless NODELETE
|
330
|
-
#end
|
331
|
-
end
|
332
|
-
|
333
|
-
# splits string on ' 'and matches the line found by find_line_regexp in
|
334
|
-
# lines
|
335
|
-
def match_modline_pieces(lines, find_line_regexp, string)
|
336
|
-
pieces = string.split(' ').map {|v| /#{Regexp.escape(v)}/ }
|
337
|
-
lines.each do |line|
|
338
|
-
if line =~ find_line_regexp
|
339
|
-
pieces.each do |piece|
|
340
|
-
line.should =~ piece
|
341
|
-
end
|
342
|
-
end
|
343
|
-
end
|
344
|
-
end
|
345
|
-
|
346
|
-
it 'gets modifications right in real run' do
|
347
|
-
@out_files.each do |fn|
|
348
|
-
fn.exist_as_a_file?.should be_true
|
349
|
-
beginning = IO.read(fn)
|
350
|
-
lines = beginning.split("\n")
|
351
|
-
[
|
352
|
-
[/aminoacid="M"/, '<aminoacid_modification symbol="*" massdiff="+15.9994" aminoacid="M" variable="Y" binary="N" mass="147.192"'],
|
353
|
-
|
354
|
-
[/aminoacid="S"/, '<aminoacid_modification symbol="#" massdiff="+79.9799" aminoacid="S" variable="Y" binary="N" mass="167.0581"'],
|
355
|
-
[/aminoacid="T"/, '<aminoacid_modification symbol="#" massdiff="+79.9799" aminoacid="T" variable="Y" binary="N" mass="181.085"'],
|
356
|
-
[/aminoacid="Y"/, '<aminoacid_modification symbol="#" massdiff="+79.9799" aminoacid="Y" variable="Y" binary="N" mass="243.1559"'],
|
357
|
-
[/parameter name="diff_search_options"/, '<parameter name="diff_search_options" value="15.999400 M 79.979900 STY 0.000000 M 0.000000 X 0.000000 T 0.000000 Y"/>'],
|
358
|
-
].each do |a,b|
|
359
|
-
match_modline_pieces(lines, a, b)
|
360
|
-
end
|
361
|
-
[
|
362
|
-
'<modification_info modified_peptide="Y#RLGGS#T#K">',
|
363
|
-
'<mod_aminoacid_mass position="1" mass="243.1559"/>',
|
364
|
-
'<mod_aminoacid_mass position="7" mass="167.0581"/>',
|
365
|
-
'</modification_info>',
|
366
|
-
'<mod_aminoacid_mass position="9" mass="181.085"/>'
|
367
|
-
].each do |line|
|
368
|
-
beginning.should =~ /#{Regexp.escape(line)}/ # "a modification info for a peptide")
|
369
|
-
end
|
370
|
-
end
|
371
|
-
end
|
372
|
-
end
|
373
|
-
end
|
374
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require File.expand_path( File.dirname(__FILE__) + '/../spec_helper' )
|
2
|
-
require 'spec_id'
|
3
|
-
require 'spec_id/sequest'
|
4
|
-
require 'set'
|
5
|
-
|
6
|
-
class MockPepHit
|
7
|
-
attr_accessor :first_scan, :xcorr, :idd
|
8
|
-
def initialize(*args)
|
9
|
-
(@first_scan, @xcorr, @idd) = args
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe Sequest, ": with small mock set" do
|
14
|
-
before(:each) do
|
15
|
-
index = 0
|
16
|
-
hits = [[0, 5.0, 0], [0, 4.0, 1], [0, 3.0, 2],
|
17
|
-
[1, 5.0, 3], [1, 4.0, 4],
|
18
|
-
[2, 5.5, 5],
|
19
|
-
[3, 5.5, 6], [3, 5.5, 7], [3, 4.0, 8], [3, 2.4, 9], [3, 2.4, 10]
|
20
|
-
].map do |hit|
|
21
|
-
MockPepHit.new(*hit)
|
22
|
-
end
|
23
|
-
@peps = hits.sort_by {rand}
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'returns "other" hits' do
|
27
|
-
included = [2, 8, 9, 10]
|
28
|
-
first_index = 2
|
29
|
-
last_index = 10
|
30
|
-
reply = Sequest.other_hits(@peps, first_index,last_index,:first_scan, [:xcorr, {:down => :xcorr}])
|
31
|
-
reply.map {|hit| hit.idd }.to_set.should == included.to_set
|
32
|
-
|
33
|
-
# same, but optimized
|
34
|
-
reply = Sequest.other_hits_sorted_by_xcorr(@peps, first_index,last_index,:first_scan)
|
35
|
-
reply.map {|hit| hit.idd }.to_set.should == included.to_set
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|