ms-sequest 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History +2 -2
- data/README.rdoc +20 -21
- data/Rakefile +5 -5
- data/VERSION +1 -1
- data/lib/ms/sequest.rb +1 -1
- data/lib/ms/sequest/params.rb +8 -8
- data/lib/ms/sequest/pepxml/modifications.rb +10 -10
- data/lib/ms/sequest/pepxml/params.rb +6 -6
- data/lib/ms/sequest/sqt.rb +36 -38
- data/lib/ms/sequest/srf.rb +46 -134
- data/lib/ms/sequest/srf/pepxml.rb +23 -23
- data/lib/ms/sequest/srf/pepxml/sequest.rb +3 -3
- data/lib/ms/sequest/srf/search.rb +5 -5
- data/lib/ms/sequest/srf/sqt.rb +13 -15
- data/spec/ms/sequest/params_spec.rb +1 -1
- data/spec/ms/sequest/pepxml/modifications_spec.rb +4 -4
- data/spec/ms/sequest/sqt_spec.rb +2 -28
- data/spec/ms/sequest/srf/pepxml_spec.rb +2 -2
- data/spec/ms/sequest/srf/search_spec.rb +5 -5
- data/spec/ms/sequest/srf/sqt_spec.rb +7 -8
- data/spec/ms/sequest/srf_spec.rb +7 -7
- data/spec/spec_helper.rb +1 -1
- metadata +28 -33
- data/lib/ms/sequest/bioworks.rb +0 -498
- data/spec/ms/sequest/bioworks_spec.rb +0 -153
data/History
CHANGED
data/README.rdoc
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
An {mspire}[http://mspire.rubyforge.org] library supporting SEQUEST, Bioworks, SQT and associated formats.
|
4
4
|
|
5
|
-
== {API}[http://
|
5
|
+
== {Current API}[http://rubydoc.info/gems/ms-sequest]
|
6
6
|
|
7
7
|
== Examples
|
8
8
|
|
@@ -11,12 +11,12 @@ Provides two executables for extracting information from an Srf file (run withou
|
|
11
11
|
srf_to_sqt.rb file.srf # => file.sqt
|
12
12
|
srf_to_search.rb file.srf # => file.mgf (also can make .dta files)
|
13
13
|
|
14
|
-
===
|
14
|
+
=== MS::Sequest::Srf
|
15
15
|
|
16
16
|
Can read and convert Bioworks Sequest Results Files (SRF).
|
17
17
|
|
18
18
|
require 'ms/sequest/srf'
|
19
|
-
srf =
|
19
|
+
srf = MS::Sequest::Srf.new("file.srf")
|
20
20
|
|
21
21
|
Conversions (see api for options):
|
22
22
|
|
@@ -28,20 +28,20 @@ Conversions (see api for options):
|
|
28
28
|
srf.to_dta # (outputs a dir) -> file
|
29
29
|
srf.to_dta("file.tgz", :tgz) # on the fly tgz (requires archive-tar-minitar)
|
30
30
|
|
31
|
-
Object access (see
|
31
|
+
Object access (see MS::Sequest::Srf for much more):
|
32
32
|
|
33
|
-
srf.header #
|
34
|
-
srf.params #
|
35
|
-
srf.dta_files #
|
36
|
-
srf.
|
37
|
-
srf.
|
33
|
+
srf.header # MS::Sequest::Srf::Header object
|
34
|
+
srf.params # MS::Sequest::Params object
|
35
|
+
srf.dta_files # MS::Sequest::Srf::Dta objects
|
36
|
+
srf.out_files # MS::Sequest::Srf::Out objects
|
37
|
+
srf.peptide_hits # MS::Sequest::Srf::Out::Peptide objects
|
38
38
|
|
39
|
-
===
|
39
|
+
=== MS::Sequest::Params
|
40
40
|
|
41
41
|
Object or hash access to any parameter in the file. Also provides a unified interface across several versions (3.1 - 3.3)
|
42
42
|
|
43
43
|
require 'ms/sequest/params'
|
44
|
-
params =
|
44
|
+
params = MS::Sequest::Params.new("sequest.params")
|
45
45
|
params.any_existing_param # -> some value or empty string if no value
|
46
46
|
params['any_existing_param'] # -> some value or empty string if no value
|
47
47
|
params.non_existent_param # -> nil
|
@@ -53,25 +53,24 @@ Object or hash access to any parameter in the file. Also provides a unified int
|
|
53
53
|
params.precursor_mass_type # => "average" | "monoisotopic"
|
54
54
|
params.fragment_mass_type # => "average" | "monoisotopic"
|
55
55
|
|
56
|
-
===
|
56
|
+
=== MS::Sequest::Sqt
|
57
57
|
|
58
|
-
sqt =
|
58
|
+
sqt = MS::Sequest::Sqt.new("file.sqt")
|
59
59
|
sqt.header
|
60
|
-
sqt.spectra.each do |spectrum| # an
|
61
|
-
spectrum.matches.each do |match| # an
|
62
|
-
match.loci.each do |locus| # an
|
60
|
+
sqt.spectra.each do |spectrum| # an MS::Sequest::Sqt::Spectrum object
|
61
|
+
spectrum.matches.each do |match| # an MS::Sequest::Sqt::Match object
|
62
|
+
match.loci.each do |locus| # an MS::Sequest::Sqt::Locus object
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
# or more direct access to Match
|
68
|
-
sqt.
|
69
|
-
sqt.prots
|
67
|
+
# or more direct access to Match objects:
|
68
|
+
sqt.peptide_hits
|
70
69
|
|
71
70
|
Also reads Percolator SQT output files intelligently:
|
72
71
|
|
73
|
-
psqt =
|
74
|
-
psqt.
|
72
|
+
psqt = MS::Sequest::Sqt.new("percolator_output.sqt")
|
73
|
+
psqt.peptide_hits.each do |pmatch|
|
75
74
|
pmatch.percolator_score == pmatch.xcorr
|
76
75
|
pmatch.negative_q_value == pmatch.sp
|
77
76
|
pmatch.q_value == -pmatch.negative_q_value
|
data/Rakefile
CHANGED
@@ -11,13 +11,13 @@ Jeweler::Tasks.new do |gem|
|
|
11
11
|
gem.email = "jtprince@gmail.com"
|
12
12
|
gem.authors = ["John T. Prince"]
|
13
13
|
gem.rubyforge_project = 'mspire'
|
14
|
-
gem.add_runtime_dependency "
|
15
|
-
gem.add_runtime_dependency "ms-core", ">= 0.0.
|
14
|
+
gem.add_runtime_dependency "msplat", ">= 0.0.6"
|
15
|
+
#gem.add_runtime_dependency "ms-core", ">= 0.0.17"
|
16
16
|
#gem.add_runtime_dependency "ms-msrun", ">= 0.3.4"
|
17
|
-
gem.add_runtime_dependency "trollop", "~> 1.16
|
17
|
+
gem.add_runtime_dependency "trollop", "~> 1.16"
|
18
18
|
gem.add_development_dependency "jeweler", "~> 1.5.2"
|
19
|
-
gem.add_development_dependency "ms-testdata", ">= 0.
|
20
|
-
gem.add_development_dependency "spec-more", ">= 0
|
19
|
+
gem.add_development_dependency "ms-testdata", ">= 0.2.1"
|
20
|
+
gem.add_development_dependency "spec-more", ">= 0"
|
21
21
|
end
|
22
22
|
Jeweler::RubygemsDotOrgTasks.new
|
23
23
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1
|
1
|
+
0.2.1
|
data/lib/ms/sequest.rb
CHANGED
data/lib/ms/sequest/params.rb
CHANGED
@@ -3,13 +3,13 @@ require 'ms/mass/aa'
|
|
3
3
|
# In the future, this guy should accept any version of bioworks params file
|
4
4
|
# and spit out any param queried.
|
5
5
|
|
6
|
-
module
|
7
|
-
module
|
6
|
+
module MS ; end
|
7
|
+
module MS::Sequest ; end
|
8
8
|
|
9
9
|
# 1) provides a reader and simple parameter lookup for SEQUEST params files
|
10
10
|
# supporting Bioworks 3.1-3.3.1.
|
11
|
-
# params =
|
12
|
-
# params =
|
11
|
+
# params = MS::Sequest::Params.new("sequest.params") # filename by default
|
12
|
+
# params = MS::Sequest::Params.new.parse_io(some_io_object)
|
13
13
|
#
|
14
14
|
# params.some_parameter # => any parameter defined has a method
|
15
15
|
# params.nonexistent_parameter # => nil
|
@@ -29,7 +29,7 @@ module Ms::Sequest ; end
|
|
29
29
|
# params.max_num_internal_cleavages # == max_num_internal_cleavage_sites
|
30
30
|
# params.fragment_ion_tol # => fragment_ion_tolerance
|
31
31
|
#
|
32
|
-
class
|
32
|
+
class MS::Sequest::Params
|
33
33
|
|
34
34
|
Bioworks31_Enzyme_Info_Array = [
|
35
35
|
['No_Enzyme', 0, '-', '-'], # 0
|
@@ -234,7 +234,7 @@ class Ms::Sequest::Params
|
|
234
234
|
@opts["first_database_name"]
|
235
235
|
end
|
236
236
|
|
237
|
-
# returns the appropriate aminoacid mass lookup table from
|
237
|
+
# returns the appropriate aminoacid mass lookup table from MS::Mass::AA
|
238
238
|
# based_on may be :precursor or :fragment
|
239
239
|
def mass_index(based_on=:precursor)
|
240
240
|
reply = case based_on
|
@@ -243,9 +243,9 @@ class Ms::Sequest::Params
|
|
243
243
|
end
|
244
244
|
case reply
|
245
245
|
when 'average'
|
246
|
-
|
246
|
+
MS::Mass::AA::AVG
|
247
247
|
when 'monoisotopic'
|
248
|
-
|
248
|
+
MS::Mass::AA::MONO
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'ms/ident/pepxml/search_hit/modification_info'
|
2
2
|
|
3
|
-
module
|
4
|
-
module
|
5
|
-
class
|
3
|
+
module MS ; end
|
4
|
+
module MS::Sequest ; end
|
5
|
+
class MS::Sequest::Pepxml ; end
|
6
6
|
|
7
|
-
class
|
7
|
+
class MS::Sequest::Pepxml::Modifications
|
8
8
|
# sequest params object
|
9
9
|
attr_accessor :params
|
10
10
|
# array holding AAModifications
|
@@ -100,7 +100,7 @@ class Ms::Sequest::Pepxml::Modifications
|
|
100
100
|
:variable => 'N',
|
101
101
|
:binary => 'Y',
|
102
102
|
}
|
103
|
-
|
103
|
+
MS::Ident::Pepxml::AminoacidModification.new(hash)
|
104
104
|
end
|
105
105
|
|
106
106
|
## Create the static_terminal_mods objects
|
@@ -122,7 +122,7 @@ class Ms::Sequest::Pepxml::Modifications
|
|
122
122
|
:description => mod[0],
|
123
123
|
}
|
124
124
|
hash[:protein_terminus] = protein_terminus if protein_terminus
|
125
|
-
|
125
|
+
MS::Ident::Pepxml::TerminalModification.new(hash)
|
126
126
|
end
|
127
127
|
[static_mods, static_terminal_mods]
|
128
128
|
end
|
@@ -160,7 +160,7 @@ class Ms::Sequest::Pepxml::Modifications
|
|
160
160
|
:binary => 'N',
|
161
161
|
:symbol => @mod_symbols_hash[[aa.to_sym, mod[1]]],
|
162
162
|
}
|
163
|
-
mod_objects <<
|
163
|
+
mod_objects << MS::Ident::Pepxml::AminoacidModification.new(hash)
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
@@ -186,7 +186,7 @@ class Ms::Sequest::Pepxml::Modifications
|
|
186
186
|
:variable => 'Y',
|
187
187
|
:symbol => symb,
|
188
188
|
}
|
189
|
-
|
189
|
+
MS::Ident::Pepxml::TerminalModification.new(hash)
|
190
190
|
end
|
191
191
|
|
192
192
|
#########################
|
@@ -202,7 +202,7 @@ class Ms::Sequest::Pepxml::Modifications
|
|
202
202
|
# if there are no modifications, returns nil
|
203
203
|
def modification_info(mod_peptide)
|
204
204
|
return nil if @aa_mod_to_tot_mass.size == 0
|
205
|
-
mod_info =
|
205
|
+
mod_info = MS::Ident::Pepxml::SearchHit::ModificationInfo.new( mod_peptide.dup )
|
206
206
|
mass_table = @params.mass_index(:precursor)
|
207
207
|
|
208
208
|
# TERMINI:
|
@@ -227,7 +227,7 @@ class Ms::Sequest::Pepxml::Modifications
|
|
227
227
|
if @aa_mod_to_tot_mass.key?( last_normal_aa + mod_peptide[i,1] )
|
228
228
|
# we don't save the result because most amino acids will not be
|
229
229
|
# modified
|
230
|
-
mod_array <<
|
230
|
+
mod_array << MS::Ident::Pepxml::SearchHit::ModificationInfo::ModAminoacidMass.new(bare_cnt, @aa_mod_to_tot_mass[last_normal_aa + mod_peptide[i,1]])
|
231
231
|
else
|
232
232
|
last_normal_aa = mod_peptide[i,1]
|
233
233
|
bare_cnt += 1
|
@@ -1,15 +1,15 @@
|
|
1
1
|
|
2
|
-
module
|
3
|
-
module
|
2
|
+
module MS ; end
|
3
|
+
module MS::Sequest ; end
|
4
4
|
|
5
|
-
class
|
5
|
+
class MS::Sequest::Params
|
6
6
|
|
7
|
-
# returns a
|
7
|
+
# returns a MS::Ident::Pepxml::SampleEnzyme object
|
8
8
|
def sample_enzyme
|
9
|
-
|
9
|
+
MS::Ident::Pepxml::SampleEnzyme.new(sample_enzyme_hash)
|
10
10
|
end
|
11
11
|
|
12
|
-
# returns a hash suitable for setting a
|
12
|
+
# returns a hash suitable for setting a MS::Ident::Pepxml::SampleEnzyme object
|
13
13
|
def sample_enzyme_hash
|
14
14
|
(offset, cleave_at, except_if_after) = enzyme_specificity.map do |v|
|
15
15
|
if v == '' ; nil ; else v end
|
data/lib/ms/sequest/sqt.rb
CHANGED
@@ -8,15 +8,15 @@ require 'digest/md5'
|
|
8
8
|
require 'ms/ident/peptide'
|
9
9
|
require 'ms/ident/search'
|
10
10
|
|
11
|
-
module
|
11
|
+
module MS
|
12
12
|
module Sequest
|
13
13
|
class SqtGroup
|
14
|
-
include
|
14
|
+
include MS::Ident::SearchGroup
|
15
15
|
|
16
16
|
#attr_accessor :sqts, :filenames
|
17
17
|
|
18
18
|
def search_class
|
19
|
-
|
19
|
+
MS::Sequest::Sqt
|
20
20
|
end
|
21
21
|
|
22
22
|
def extension() 'sqg' end
|
@@ -27,7 +27,7 @@ module Ms
|
|
27
27
|
super(arg, opts.merge(indiv_opts)) do
|
28
28
|
unless orig_opts[:link_protein_hits] == false
|
29
29
|
puts "MERGING GROUP!"
|
30
|
-
(@peptides, @proteins) = merge!(@searches.map {|v| v.peptides }, &
|
30
|
+
(@peptides, @proteins) = merge!(@searches.map {|v| v.peptides }, &MS::Sequest::Sqt::NEW_PROT)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
block.call(self) if block_given?
|
@@ -54,7 +54,8 @@ module Ms
|
|
54
54
|
end # SqtGroup
|
55
55
|
|
56
56
|
|
57
|
-
class Sqt
|
57
|
+
class Sqt
|
58
|
+
include MS::Ident::SearchLike
|
58
59
|
PercolatorHeaderMatch = /^Percolator v/
|
59
60
|
Delimiter = "\t"
|
60
61
|
attr_accessor :header
|
@@ -67,7 +68,7 @@ module Ms
|
|
67
68
|
def self.db_seq_length_and_locus_count(dbfile)
|
68
69
|
total_sequence_length = 0
|
69
70
|
fastasize = 0
|
70
|
-
|
71
|
+
MS::Fasta.open(dbfile) do |fasta|
|
71
72
|
fasta.each do |entry|
|
72
73
|
total_sequence_length += entry.sequence.size
|
73
74
|
fastasize += 1
|
@@ -99,22 +100,21 @@ module Ms
|
|
99
100
|
end
|
100
101
|
|
101
102
|
def protein_class
|
102
|
-
|
103
|
+
MS::Sequest::Sqt::Locus
|
103
104
|
end
|
104
105
|
|
105
106
|
# opts =
|
106
107
|
# :percolator_results => false | true (default false)
|
107
108
|
# :link_protein_hits => true | false (default true)
|
108
109
|
def initialize(filename=nil, opts={})
|
109
|
-
|
110
|
-
@proteins = []
|
110
|
+
peptide_hits = []
|
111
111
|
if filename
|
112
112
|
from_file(filename, opts)
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
116
|
NEW_PROT = lambda do |_prot, _peptides|
|
117
|
-
|
117
|
+
MS::Sequest::Sqt::Locus.new(_prot.locus, _prot.description, _peptides)
|
118
118
|
end
|
119
119
|
|
120
120
|
# if the file contains the header key '/$Percolator v/' then the results
|
@@ -125,14 +125,11 @@ module Ms
|
|
125
125
|
@percolator_results = opts[:percolator_results]
|
126
126
|
@base_name = File.basename( filename.gsub('\\','/') ).sub(/\.\w+$/, '')
|
127
127
|
File.open(filename) do |fh|
|
128
|
-
@header =
|
128
|
+
@header = MS::Sequest::Sqt::Header.new.from_handle(fh)
|
129
129
|
if @header.keys.any? {|v| v =~ PercolatorHeaderMatch }
|
130
130
|
@percolator_results = true
|
131
131
|
end
|
132
|
-
(@spectra, @peptides) =
|
133
|
-
end
|
134
|
-
if opts[:link_protein_hits]
|
135
|
-
(@peptides, @proteins) = merge!([@peptides], &NEW_PROT)
|
132
|
+
(@spectra, @peptides) = MS::Sequest::Sqt::Spectrum.spectra_from_handle(fh, @base_name, @percolator_results)
|
136
133
|
end
|
137
134
|
end
|
138
135
|
|
@@ -185,7 +182,7 @@ module Ms
|
|
185
182
|
lines = []
|
186
183
|
loop do
|
187
184
|
line = fh.gets
|
188
|
-
if line && (line[0,1] ==
|
185
|
+
if line && (line[0,1] == MS::Sequest::Sqt::Header::Leader )
|
189
186
|
lines << line
|
190
187
|
else # reset the fh.pos and we're done
|
191
188
|
fh.pos = pos
|
@@ -199,9 +196,9 @@ module Ms
|
|
199
196
|
def from_lines(array_of_header_lines)
|
200
197
|
array_of_header_lines.each do |line|
|
201
198
|
line.chomp!
|
202
|
-
(ky, *rest) = line.split(
|
199
|
+
(ky, *rest) = line.split(MS::Sequest::Sqt::Delimiter)[1..-1]
|
203
200
|
# just in case they have any tabs in their field
|
204
|
-
value = rest.join(
|
201
|
+
value = rest.join(MS::Sequest::Sqt::Delimiter)
|
205
202
|
if Arrayed.include?(ky)
|
206
203
|
self[ky] << value
|
207
204
|
elsif self.key? ky # already exists
|
@@ -227,11 +224,11 @@ end
|
|
227
224
|
|
228
225
|
# all are cast as expected (total_intensity is a float)
|
229
226
|
# mh = observed mh
|
230
|
-
|
227
|
+
MS::Sequest::Sqt::Spectrum = Struct.new(* %w(first_scan last_scan charge time_to_process node mh total_intensity lowest_sp num_matched_peptides matches).map(&:to_sym) )
|
231
228
|
|
232
229
|
# 0=first_scan 1=last_scan 2=charge 3=time_to_process 4=node 5=mh 6=total_intensity 7=lowest_sp 8=num_matched_peptides 9=matches
|
233
230
|
|
234
|
-
class
|
231
|
+
class MS::Sequest::Sqt::Spectrum
|
235
232
|
Leader = 'S'
|
236
233
|
|
237
234
|
# assumes the first line starts with an 'S'
|
@@ -241,16 +238,16 @@ class Ms::Sequest::Sqt::Spectrum
|
|
241
238
|
|
242
239
|
while line = fh.gets
|
243
240
|
case line[0,1]
|
244
|
-
when
|
245
|
-
spectrum =
|
241
|
+
when MS::Sequest::Sqt::Spectrum::Leader
|
242
|
+
spectrum = MS::Sequest::Sqt::Spectrum.new.from_line( line )
|
246
243
|
spectra << spectrum
|
247
244
|
matches = []
|
248
245
|
spectrum.matches = matches
|
249
|
-
when
|
246
|
+
when MS::Sequest::Sqt::Match::Leader
|
250
247
|
match_klass = if percolator_results
|
251
|
-
|
248
|
+
MS::Sequest::Sqt::Match::Percolator
|
252
249
|
else
|
253
|
-
|
250
|
+
MS::Sequest::Sqt::Match
|
254
251
|
end
|
255
252
|
match = match_klass.new.from_line( line )
|
256
253
|
#match[10,3] = spectrum[0,3]
|
@@ -264,10 +261,10 @@ class Ms::Sequest::Sqt::Spectrum
|
|
264
261
|
loci = []
|
265
262
|
match.loci = loci
|
266
263
|
matches << match
|
267
|
-
when
|
264
|
+
when MS::Sequest::Sqt::Locus::Leader
|
268
265
|
line.chomp!
|
269
|
-
key = line.split(
|
270
|
-
locus =
|
266
|
+
key = line.split(MS::Sequest::Sqt::Delimiter)[1]
|
267
|
+
locus = MS::Sequest::Sqt::Locus.from_line( line )
|
271
268
|
loci << locus
|
272
269
|
end
|
273
270
|
end
|
@@ -294,7 +291,7 @@ class Ms::Sequest::Sqt::Spectrum
|
|
294
291
|
# returns an array -> [the next spectra line (or nil if eof), spectrum]
|
295
292
|
def from_line(line)
|
296
293
|
line.chomp!
|
297
|
-
ar = line.split(
|
294
|
+
ar = line.split(MS::Sequest::Sqt::Delimiter)
|
298
295
|
self[0] = ar[1].to_i
|
299
296
|
self[1] = ar[2].to_i
|
300
297
|
self[2] = ar[3].to_i
|
@@ -310,7 +307,7 @@ class Ms::Sequest::Sqt::Spectrum
|
|
310
307
|
end
|
311
308
|
|
312
309
|
# Sqt format uses only indices 0 - 9
|
313
|
-
|
310
|
+
MS::Sequest::Sqt::Match = Struct.new( *%w[rxcorr rsp mh deltacn_orig xcorr sp ions_matched ions_total sequence manual_validation_status first_scan last_scan charge deltacn aaseq base_name loci].map(&:to_sym) )
|
314
311
|
|
315
312
|
# 0=rxcorr 1=rsp 2=mh 3=deltacn_orig 4=xcorr 5=sp 6=ions_matched 7=ions_total 8=sequence 9=manual_validation_status 10=first_scan 11=last_scan 12=charge 13=deltacn 14=aaseq 15=base_name 16=loci
|
316
313
|
|
@@ -320,7 +317,7 @@ Ms::Sequest::Sqt::Match = Struct.new( *%w[rxcorr rsp mh deltacn_orig xcorr sp io
|
|
320
317
|
# deltacn_orig
|
321
318
|
# deltacn is the adjusted deltacn (like Bioworks - shift all scores up and
|
322
319
|
# give the last one 1.1)
|
323
|
-
class
|
320
|
+
class MS::Sequest::Sqt::Match
|
324
321
|
Leader = 'M'
|
325
322
|
|
326
323
|
# same as 'loci'
|
@@ -330,7 +327,7 @@ class Ms::Sequest::Sqt::Match
|
|
330
327
|
|
331
328
|
def from_line(line)
|
332
329
|
line.chomp!
|
333
|
-
ar = line.split(
|
330
|
+
ar = line.split(MS::Sequest::Sqt::Delimiter)
|
334
331
|
self[0] = ar[1].to_i
|
335
332
|
self[1] = ar[2].to_i
|
336
333
|
self[2] = ar[3].to_f
|
@@ -341,13 +338,13 @@ class Ms::Sequest::Sqt::Match
|
|
341
338
|
self[7] = ar[8].to_i
|
342
339
|
self[8] = ar[9]
|
343
340
|
self[9] = ar[10]
|
344
|
-
self[14] =
|
341
|
+
self[14] = MS::Ident::Peptide.sequence_to_aaseq(self[8])
|
345
342
|
self
|
346
343
|
end
|
347
344
|
end
|
348
345
|
|
349
346
|
|
350
|
-
class
|
347
|
+
class MS::Sequest::Sqt::Match::Percolator < MS::Sequest::Sqt::Match
|
351
348
|
# we will keep access to these old terms since we can then access routines
|
352
349
|
# that sort on xcorr...
|
353
350
|
#undef_method :xcorr
|
@@ -376,22 +373,23 @@ class Ms::Sequest::Sqt::Match::Percolator < Ms::Sequest::Sqt::Match
|
|
376
373
|
end
|
377
374
|
end
|
378
375
|
|
379
|
-
|
376
|
+
MS::Sequest::Sqt::Locus = Struct.new( :locus, :description )
|
380
377
|
|
381
|
-
class
|
378
|
+
class MS::Sequest::Sqt::Locus
|
382
379
|
Leader = 'L'
|
383
380
|
|
384
381
|
def first_entry ; self[0] end
|
385
382
|
def reference ; self[0] end
|
383
|
+
def id ; self[0] end
|
386
384
|
|
387
385
|
def initialize(locus=nil, description=nil, peptides=[])
|
388
|
-
super(locus, description
|
386
|
+
super(locus, description)
|
389
387
|
end
|
390
388
|
|
391
389
|
# returns a new Locus object
|
392
390
|
def self.from_line(line)
|
393
391
|
line.chomp!
|
394
|
-
self.new( *line.split(
|
392
|
+
self.new( *line.split(MS::Sequest::Sqt::Delimiter) ) # fills in the first two values
|
395
393
|
end
|
396
394
|
|
397
395
|
end
|