mzml 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ require 'rubygems'
4
+ require 'mzml'
5
+ require 'spec'
6
+ require 'spec/autorun'
7
+
8
+ class Mgf < Struct.new(:title, :mz, :intensity); end
9
+
10
+ def parse_mgf(fname)
11
+ mgf = Mgf.new(nil,[],[])
12
+ File.open(fname).each do |l|
13
+ l.chomp!
14
+ case l
15
+ when /^TITLE=(.+)/
16
+ mgf.title = $1
17
+ when /^\d/
18
+ m,i = l.split().map{|e| (e.to_f * 1000).to_i() / 1000.0 }
19
+ mgf.mz << m
20
+ mgf.intensity << i
21
+ end
22
+ end
23
+ return mgf
24
+ end
25
+
26
+ Spec::Runner.configure do |config|
27
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mzml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Angel Pizarro
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-06 00:00:00 +00:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rspec
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.9
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: nokogiri
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.3
34
+ version:
35
+ description: A non-validating mzML parser. MzML is a standard data format for representing mass spectrometry data.
36
+ email: angel@delagoya.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.rdoc
44
+ files:
45
+ - .document
46
+ - .gitignore
47
+ - .yardoc
48
+ - LICENSE
49
+ - README.rdoc
50
+ - Rakefile
51
+ - VERSION
52
+ - lib/mzml.rb
53
+ - mzml.gemspec
54
+ - spec/mzml_spec.rb
55
+ - spec/small.compressed.mzML
56
+ - spec/small.mgf
57
+ - spec/small.mzML
58
+ - spec/spec.opts
59
+ - spec/spec_helper.rb
60
+ has_rdoc: true
61
+ homepage: http://github.com/delagoya/mzml
62
+ licenses: []
63
+
64
+ post_install_message:
65
+ rdoc_options:
66
+ - --charset=UTF-8
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ requirements: []
82
+
83
+ rubyforge_project:
84
+ rubygems_version: 1.3.5
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: A non-validating mzML parser
88
+ test_files:
89
+ - spec/mzml_spec.rb
90
+ - spec/spec_helper.rb