ms-msrun 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/.gitignore +1 -0
  2. data/README.rdoc +26 -10
  3. data/VERSION +1 -1
  4. data/lib/ms/msrun.rb +1 -1
  5. metadata +1 -1
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  rdoc
2
2
  *.swp
3
3
  pkg
4
+ *.gemspec
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* ( and *mzML* files in near future)!
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
- ms.scans.each do |scan|
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
- [*Fast*] uses xmlparser under the hood.
49
- [*Unified*] one interface for all formats
50
- [<b>Lazy evaluation of spectra</b>] By default, reads from IO when data is required.
51
- [<b>Minimal Dependencies</b>] xmlparser (available for most distros and windows one-click installer) and axml. Very nearly have supoort for LibXML.
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
- The library currently relies on xmlparser (though LibXML is close to being
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
- ruby -rubygems -e 'require "axml"; puts AXML::Autoload.install_instructions(:xmlparser)'
77
+ See LICENSE
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ms-msrun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John T. Prince