mzml 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/Rakefile +15 -39
- data/bin/{mzML2mgf.rb → mzml2mgf} +1 -17
- data/lib/mzml/chromatogram.rb +80 -0
- data/lib/mzml/doc.rb +185 -0
- data/lib/mzml/spectrum.rb +107 -0
- data/lib/mzml/version.rb +4 -0
- data/lib/mzml.rb +4 -244
- data/mzml.gemspec +15 -59
- data/spec/mzml_spec.rb +16 -0
- data/spec/sample.unindexed.mzML +221 -0
- data/test/fixtures/sample.compressed.mzML +2699 -0
- data/test/fixtures/sample.mgf +25548 -0
- data/test/fixtures/sample.mzML +2688 -0
- data/test/test_mzml-helper.rb +15 -0
- data/test/test_mzml.rb +94 -0
- metadata +83 -76
- data/.document +0 -5
- data/.yardoc +0 -0
- data/VERSION +0 -1
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'mzml'
|
3
|
+
|
4
|
+
class TestMzMLHelper < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
# set the input file name
|
7
|
+
@file = File.join(File.dirname(__FILE__), "sample.mzML")
|
8
|
+
@compressed = File.join(File.dirname(__FILE__), "sample.compressed.mzML")
|
9
|
+
@mgf = File.join(File.dirname(__FILE__), "sample.mgf")
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_canary
|
13
|
+
pass
|
14
|
+
end
|
15
|
+
end
|
data/test/test_mzml.rb
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'mzml'
|
3
|
+
|
4
|
+
class TestMzML < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
# set the input file name
|
8
|
+
@file = File.join(File.dirname(__FILE__), "fixtures", "sample.mzML")
|
9
|
+
@compressed = File.join(File.dirname(__FILE__), "fixtures", "sample.compressed.mzML")
|
10
|
+
@mgf = File.join(File.dirname(__FILE__), "fixtures", "sample.mgf")
|
11
|
+
@mzml = MzML::Doc.open(@file)
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_canary
|
15
|
+
pass
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_mzml_file_open
|
19
|
+
assert_instance_of(MzML::Doc, @mzml)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_index_created
|
23
|
+
assert_not_nil(@mzml.index)
|
24
|
+
assert(@mzml.index.keys.length > 0, "Index not parsed correctly, zero index keys")
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_spectrum_fetch
|
28
|
+
spectrum = @mzml.spectrum(@mzml.spectrum_list.first)
|
29
|
+
assert_instance_of(MzML::Spectrum, spectrum)
|
30
|
+
assert(spectrum.id == "controllerType=0 controllerNumber=1 scan=1")
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_chromatogram_fetch
|
34
|
+
# STDERR.puts @mzml.chromatogram_list.first
|
35
|
+
chromatogram = @mzml.chromatogram(@mzml.chromatogram_list.first)
|
36
|
+
assert_instance_of(MzML::Chromatogram, chromatogram)
|
37
|
+
assert(chromatogram.id == "TIC")
|
38
|
+
end
|
39
|
+
|
40
|
+
# test the spectrum object.
|
41
|
+
# attr_reader :id, :default_array_length, :type,
|
42
|
+
# :charge, :precursor, :base_peak_mz, :base_peak_intensity, :ms_level,
|
43
|
+
# :high_mz, :low_mz, :title, :tic, :polarity, :representation, :mz_node, :intensity_node,
|
44
|
+
# :mz, :intensity, :precursor_list, :scan_list, :retention_time, :precursor_mass,
|
45
|
+
# :precursor_intensity, :node, :params
|
46
|
+
|
47
|
+
def test_spectrum_object
|
48
|
+
spectrum = @mzml.spectrum(@mzml.spectrum_list[2])
|
49
|
+
assert_instance_of(MzML::Spectrum, spectrum)
|
50
|
+
assert_equal("controllerType=0 controllerNumber=1 scan=3",spectrum.id)
|
51
|
+
assert_equal(2, spectrum.ms_level)
|
52
|
+
assert_equal(231.38883972167969, spectrum.low_mz)
|
53
|
+
assert_equal(1560.7198486328125, spectrum.high_mz)
|
54
|
+
assert_equal(586279, spectrum.tic)
|
55
|
+
assert_equal(161140.859375, spectrum.base_peak_intensity)
|
56
|
+
assert_equal(736.6370849609375, spectrum.base_peak_mz)
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_spectrum_decode
|
60
|
+
spectrum = @mzml.spectrum(@mzml.spectrum_list[2])
|
61
|
+
assert_instance_of(MzML::Spectrum, spectrum)
|
62
|
+
assert_equal(spectrum.mz[3], 240.3084716796875)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_compressed_spectrum_decode
|
66
|
+
mzml = MzML::Doc.open(@compressed)
|
67
|
+
spectrum = mzml.spectrum(@mzml.spectrum_list[2])
|
68
|
+
assert_instance_of(MzML::Spectrum, spectrum)
|
69
|
+
assert_equal(spectrum.mz[3], 240.3084716796875)
|
70
|
+
end
|
71
|
+
|
72
|
+
# test the chromatogram object.
|
73
|
+
|
74
|
+
def test_chromatogram_object
|
75
|
+
chromatogram = @mzml.chromatogram(@mzml.chromatogram_list[0])
|
76
|
+
assert_instance_of(MzML::Chromatogram,chromatogram)
|
77
|
+
assert_equal("TIC", chromatogram.id)
|
78
|
+
assert_equal(0, chromatogram.index)
|
79
|
+
assert_equal(0, chromatogram.index_position)
|
80
|
+
assert_equal("minute", chromatogram.time_unit)
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_chromatogram_decode
|
84
|
+
chromatogram = @mzml.chromatogram(@mzml.chromatogram_list[0])
|
85
|
+
assert_equal(0.022838333333333332,chromatogram.timepoint[3])
|
86
|
+
assert_equal(441570.15625,chromatogram.intensity[3])
|
87
|
+
end
|
88
|
+
def test_compressed_chromatogram_decode
|
89
|
+
mzml = MzML::Doc.open(@compressed)
|
90
|
+
chromatogram = mzml.chromatogram(mzml.chromatogram_list[0])
|
91
|
+
assert_equal(0.022838333333333332,chromatogram.timepoint[3])
|
92
|
+
assert_equal(441570.15625,chromatogram.intensity[3])
|
93
|
+
end
|
94
|
+
end
|
metadata
CHANGED
@@ -1,115 +1,122 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mzml
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 2
|
10
|
-
version: 0.2.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Angel Pizarro
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: &70120743498360 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.5'
|
22
|
+
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
version_requirements: *70120743498360
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &70120743497840 !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 3
|
33
|
-
- 0
|
34
|
-
version: 1.3.0
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
35
33
|
type: :development
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: nokogiri
|
39
34
|
prerelease: false
|
40
|
-
|
35
|
+
version_requirements: *70120743497840
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: yard
|
38
|
+
requirement: &70120743497360 !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
email: angel@delagoya.com
|
55
|
-
executables:
|
56
|
-
- mzML2mgf.rb
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70120743497360
|
47
|
+
description: A non-validating mzML parser. MzML is a standard data format for representing
|
48
|
+
mass spectrometry data.
|
49
|
+
email:
|
50
|
+
- angel@upenn.edu
|
51
|
+
executables: []
|
57
52
|
extensions: []
|
58
|
-
|
59
|
-
|
60
|
-
- LICENSE
|
61
|
-
- README.rdoc
|
62
|
-
files:
|
63
|
-
- .document
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
64
55
|
- .gitignore
|
65
|
-
-
|
56
|
+
- Gemfile
|
66
57
|
- LICENSE
|
67
58
|
- README.rdoc
|
68
59
|
- Rakefile
|
69
|
-
-
|
70
|
-
- bin/mzML2mgf.rb
|
60
|
+
- bin/mzml2mgf
|
71
61
|
- lib/mzml.rb
|
62
|
+
- lib/mzml/chromatogram.rb
|
63
|
+
- lib/mzml/doc.rb
|
64
|
+
- lib/mzml/spectrum.rb
|
65
|
+
- lib/mzml/version.rb
|
72
66
|
- mzml.gemspec
|
73
67
|
- spec/mzml_spec.rb
|
74
68
|
- spec/sample.compressed.mzML
|
75
69
|
- spec/sample.mgf
|
76
70
|
- spec/sample.mzML
|
71
|
+
- spec/sample.unindexed.mzML
|
77
72
|
- spec/spec.opts
|
78
73
|
- spec/spec_helper.rb
|
79
|
-
|
74
|
+
- test/fixtures/sample.compressed.mzML
|
75
|
+
- test/fixtures/sample.mgf
|
76
|
+
- test/fixtures/sample.mzML
|
77
|
+
- test/test_mzml-helper.rb
|
78
|
+
- test/test_mzml.rb
|
80
79
|
homepage: http://github.com/delagoya/mzml
|
81
80
|
licenses: []
|
82
|
-
|
83
81
|
post_install_message:
|
84
|
-
rdoc_options:
|
85
|
-
|
86
|
-
require_paths:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
87
84
|
- lib
|
88
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
86
|
none: false
|
90
|
-
requirements:
|
91
|
-
- -
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
segments:
|
87
|
+
requirements:
|
88
|
+
- - ! '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
segments:
|
95
92
|
- 0
|
96
|
-
|
97
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
hash: 483551756782191696
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
95
|
none: false
|
99
|
-
requirements:
|
100
|
-
- -
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
|
103
|
-
segments:
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
segments:
|
104
101
|
- 0
|
105
|
-
|
102
|
+
hash: 483551756782191696
|
106
103
|
requirements: []
|
107
|
-
|
108
104
|
rubyforge_project:
|
109
|
-
rubygems_version: 1.
|
105
|
+
rubygems_version: 1.8.11
|
110
106
|
signing_key:
|
111
107
|
specification_version: 3
|
112
108
|
summary: A non-validating mzML parser
|
113
|
-
test_files:
|
109
|
+
test_files:
|
114
110
|
- spec/mzml_spec.rb
|
111
|
+
- spec/sample.compressed.mzML
|
112
|
+
- spec/sample.mgf
|
113
|
+
- spec/sample.mzML
|
114
|
+
- spec/sample.unindexed.mzML
|
115
|
+
- spec/spec.opts
|
115
116
|
- spec/spec_helper.rb
|
117
|
+
- test/fixtures/sample.compressed.mzML
|
118
|
+
- test/fixtures/sample.mgf
|
119
|
+
- test/fixtures/sample.mzML
|
120
|
+
- test/test_mzml-helper.rb
|
121
|
+
- test/test_mzml.rb
|
122
|
+
has_rdoc:
|
data/.document
DELETED
data/.yardoc
DELETED
Binary file
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.2.2
|