ms-msrun 0.2.0 → 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/.gitignore +1 -0
- data/README.rdoc +26 -10
- data/VERSION +1 -1
- data/lib/ms/msrun.rb +1 -1
- metadata +1 -1
data/.gitignore
CHANGED
data/README.rdoc
CHANGED
|
@@ -4,11 +4,14 @@ A library for working with LC/MS runs.
|
|
|
4
4
|
|
|
5
5
|
== Examples
|
|
6
6
|
|
|
7
|
-
The following example will work on *mzXML*, *mzData* (
|
|
7
|
+
The following example will work on *mzXML*, *mzData* (and hope to support mzML
|
|
8
|
+
in the future)
|
|
8
9
|
|
|
9
10
|
require "ms/msrun"
|
|
10
11
|
|
|
11
12
|
Ms::Msrun.open("file.mzXML") do |ms|
|
|
13
|
+
|
|
14
|
+
# Run level information:
|
|
12
15
|
ms.start_time # in seconds
|
|
13
16
|
ms.end_time # in seconds
|
|
14
17
|
|
|
@@ -19,7 +22,11 @@ The following example will work on *mzXML*, *mzData* ( and *mzML* files in near
|
|
|
19
22
|
ms.parent_basename_noext # "file" (as recorded _in the xml_)
|
|
20
23
|
ms.filename # "file.mzXML"
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
# Random scan access (very fast)
|
|
26
|
+
ms.scan(22) # a scan object
|
|
27
|
+
|
|
28
|
+
# Complete scan access
|
|
29
|
+
ms.each do |scan|
|
|
23
30
|
scan.num # scan number
|
|
24
31
|
scan.ms_level # ms_level
|
|
25
32
|
scan.time # retention time in seconds
|
|
@@ -41,21 +48,30 @@ The following example will work on *mzXML*, *mzData* ( and *mzML* files in near
|
|
|
41
48
|
puts "#{mz} #{inten}" # print each peak on own line
|
|
42
49
|
end
|
|
43
50
|
end
|
|
51
|
+
|
|
52
|
+
# supports pre-filtering for faster access
|
|
53
|
+
|
|
54
|
+
## get just precursor info:
|
|
55
|
+
ms.each(:ms_level => 2, :spectrum => false) {|scan| scan.precursor }
|
|
56
|
+
|
|
57
|
+
## get just level one spectra:
|
|
58
|
+
ms.each(:ms_level => 1, :precursor => false) {|scan| scan.spectrum }
|
|
44
59
|
end
|
|
45
60
|
|
|
61
|
+
# Quicker way to get at scans:
|
|
62
|
+
Ms::Msrun.foreach("file.mzXML") {|scan| scan <do something> }
|
|
63
|
+
|
|
46
64
|
== Features
|
|
47
65
|
|
|
48
|
-
[
|
|
49
|
-
|
|
50
|
-
[<b>
|
|
51
|
-
[<b>
|
|
66
|
+
[<b>Fast</b>] uses Nokogiri and a dash of regular expressions to achieve very
|
|
67
|
+
fast random access of scans and full access.
|
|
68
|
+
[<b>Unified</b>] one interface for all formats.
|
|
69
|
+
[<b>Lazy evaluation at scan and spectrum level</b>] Scans are only read from IO when requested. Spectra are also decoded only when explicitly accessed.
|
|
52
70
|
|
|
53
71
|
== Installation
|
|
54
72
|
|
|
55
73
|
gem install ms-msrun
|
|
56
74
|
|
|
57
|
-
|
|
58
|
-
supported). After installation of ms-msrun (which should automatically install
|
|
59
|
-
`axml`) issue this command to get instructions on installing xmlparser:
|
|
75
|
+
== Copying
|
|
60
76
|
|
|
61
|
-
|
|
77
|
+
See LICENSE
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.1
|
data/lib/ms/msrun.rb
CHANGED
|
@@ -153,7 +153,7 @@ class Ms::Msrun
|
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
# returns [start_mz, end_mz] or [nil,nil] if unknown
|
|
156
|
+
# returns [start_mz, end_mz] for ms level 1 scans or [nil,nil] if unknown
|
|
157
157
|
def start_and_end_mz
|
|
158
158
|
scan = first(:ms_level => 1, :spectrum => false, :precursor => false)
|
|
159
159
|
[scan.start_mz, scan.end_mz]
|