ms-mascot 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +9 -0
- data/lib/ms/mascot/dat.rb +16 -0
- data/lib/ms/mascot/dat/archive.rb +198 -0
- data/lib/ms/mascot/dat/header.rb +4 -0
- data/lib/ms/mascot/dat/index.rb +23 -0
- data/lib/ms/mascot/dat/masses.rb +4 -0
- data/lib/ms/mascot/dat/parameters.rb +4 -0
- data/lib/ms/mascot/dat/peptides.rb +4 -0
- data/lib/ms/mascot/dat/proteins.rb +4 -0
- data/lib/ms/mascot/dat/query.rb +12 -0
- data/lib/ms/mascot/dat/section.rb +86 -0
- data/lib/ms/mascot/dat/summary.rb +8 -0
- data/lib/ms/mascot/dat/summary/id.rb +54 -0
- data/lib/ms/mascot/export.rb +75 -10
- data/lib/ms/mascot/format_mgf.rb +54 -0
- data/lib/ms/mascot/fragment.rb +29 -25
- data/lib/ms/mascot/mgf.rb +35 -2
- data/lib/ms/mascot/mgf/entry.rb +23 -5
- data/lib/ms/mascot/spectrum.rb +18 -3
- data/lib/ms/mascot/submit.rb +120 -29
- data/tap.yml +0 -0
- metadata +29 -31
- data/cmd/generate_mgf.rb +0 -123
- data/cmd/generate_prospector_mgf.rb +0 -123
- data/cmd/reformat_mgf.rb +0 -90
- data/lib/ms/mascot/predict.rb +0 -94
data/lib/ms/mascot/predict.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'ms/in_silico/digest'
|
2
|
-
require 'ms/mascot/fragment'
|
3
|
-
require 'ms/mascot/mgf/archive'
|
4
|
-
|
5
|
-
module Ms
|
6
|
-
module Mascot
|
7
|
-
|
8
|
-
# Ms::Mascot::Predict::manifest predicts the spectra for a protein sequence
|
9
|
-
#
|
10
|
-
# Fragments a protein sequence and calculates the fragment spectra for
|
11
|
-
# each peptide. The peptide spectra are formatted as mgf and dumped to
|
12
|
-
# the target.
|
13
|
-
#
|
14
|
-
# % rap predict MAEELVLERCDLELETNGRDHHTADLCREKLVVRRGQPFWLTLHFEGRNYEASVDSLTFS
|
15
|
-
# I[16:30:19] digest MAEELVLERCD... to 15 peptides
|
16
|
-
# I[16:30:19] fragment MAEELVLER
|
17
|
-
# I[16:30:19] fragment MAEELVLERCDLELETNGR
|
18
|
-
# I[16:30:19] fragment CDLELETNGR
|
19
|
-
# I[16:30:19] fragment CDLELETNGRDHHTADLCR
|
20
|
-
# I[16:30:19] fragment DHHTADLCR
|
21
|
-
# I[16:30:19] fragment DHHTADLCREK
|
22
|
-
# I[16:30:19] fragment EKLVVR
|
23
|
-
# I[16:30:19] fragment LVVR
|
24
|
-
# I[16:30:19] fragment LVVRR
|
25
|
-
# I[16:30:19] fragment RGQPFWLTLHFEGR
|
26
|
-
# I[16:30:19] fragment GQPFWLTLHFEGR
|
27
|
-
# I[16:30:19] fragment GQPFWLTLHFEGRNYEASVDSLTFS
|
28
|
-
# I[16:30:19] fragment NYEASVDSLTFS
|
29
|
-
#
|
30
|
-
class Predict < Tap::FileTask
|
31
|
-
define :digest, InSilico::Digest, {:max_misses => 1}
|
32
|
-
define :fragment, Mascot::Fragment, {:intensity => 1, :unmask => true, :sort => true}
|
33
|
-
|
34
|
-
config :headers, nil, &c.hash_or_nil # a hash of headers to include
|
35
|
-
config :min_length, 3, &c.integer_or_nil # the minimum peptide length
|
36
|
-
config :mz_precision, 6, &c.integer # the precision of mzs
|
37
|
-
config :intensity_precision, 0, &c.integer # the precision of intensities
|
38
|
-
config :pepmass_precision, 6, &c.integer # the precision of peptide mass
|
39
|
-
|
40
|
-
# Sequences digest and fragment. When fragment completes, it will add
|
41
|
-
# a new mgf entry to the internal entries collection.
|
42
|
-
def workflow
|
43
|
-
digest.on_complete do |_results|
|
44
|
-
_results._iterate.each do |_result|
|
45
|
-
next if min_length && _result._current.length < min_length
|
46
|
-
fragment._execute(_result)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
fragment.on_complete do |_result|
|
51
|
-
parent_ion_mass, data = _result._current
|
52
|
-
next if data.empty?
|
53
|
-
|
54
|
-
peptide = _result._values[-2]
|
55
|
-
headers = {
|
56
|
-
'TITLE' => "#{peptide} (#{fragment.series.join(', ')})",
|
57
|
-
'CHARGE' => fragment.charge,
|
58
|
-
'PEPMASS' => parent_ion_mass}
|
59
|
-
|
60
|
-
@entries << Mgf::Entry.new(headers, data)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# Infers a default path for the output mgf file from the sequence; the
|
65
|
-
# path is the sequence if the sequence is less than 10 characters,
|
66
|
-
# otherwise it's like: "<first five>_<last five>.mgf"
|
67
|
-
#
|
68
|
-
def default_path(sequence)
|
69
|
-
sequence = "#{sequence[0,5]}_#{sequence[-5,5]}" if sequence.length > 10
|
70
|
-
"#{sequence}.mgf"
|
71
|
-
end
|
72
|
-
|
73
|
-
def process(sequence, target=nil)
|
74
|
-
sequence = sequence.gsub(/\s/, "")
|
75
|
-
|
76
|
-
@entries = []
|
77
|
-
digest.execute(sequence)
|
78
|
-
|
79
|
-
# prepare and dump the predicted spectra
|
80
|
-
# to the target path.
|
81
|
-
target = default_path(sequence) if target == nil
|
82
|
-
prepare(target)
|
83
|
-
File.open(target, "wb") do |file|
|
84
|
-
@entries.each do |entry|
|
85
|
-
entry.dump(file, config)
|
86
|
-
file.puts
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
target
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|