bio-plates 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ Plate,Well,Row,Column,Drug,Conc,Junk,siRNA
2
+ 1,A01,,,si1,,si1,si1
3
+ 1,A02,,,,si1,si1,si1
@@ -0,0 +1 @@
1
+ Plate,Badnamel,Badname,Column,Drug,Conc
@@ -0,0 +1,66 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'fakefs/spec_helpers'
3
+
4
+ describe BioPlates::Plate do
5
+
6
+
7
+ context "accessing wells by row and column" do
8
+ before(:all) do
9
+ p96 = BioPlates.read(File.join(File.dirname(__FILE__),"fixtures","4x96.csv"))
10
+ @plate = p96["Plate1"]
11
+ end
12
+
13
+ it "returns a hash of arrays of well object, by column" do
14
+ expect(@plate.columns.class).to be Hash
15
+ expect(@plate.columns.first[1][0].class).to be BioPlates::Plate::Well
16
+ end
17
+
18
+ it "returns an array of rows" do
19
+ expect(@plate.rows.class).to be Hash
20
+ expect(@plate.rows.first[1][0].class).to be BioPlates::Plate::Well
21
+ end
22
+ end
23
+
24
+ context "adding leading zeroes to wells" do
25
+ before(:all) do
26
+ p96 = BioPlates.read("spec/fixtures/4x96.csv")
27
+ @plate = p96["Plate1"]
28
+ end
29
+
30
+ it "adds a zero if the column has only one digit" do
31
+ @plate.wells[1].column = 1
32
+ @plate.add_leading_zeroes!
33
+ expect(@plate.wells[1].column).to eq "01"
34
+ end
35
+
36
+ it "doesn't add a zero to two digit numbers" do
37
+ @plate.wells[10].column = 10
38
+ @plate.add_leading_zeroes!
39
+ expect(@plate.wells[10].column).to eq "10"
40
+ end
41
+ end
42
+
43
+ context "output" do
44
+ before(:all) do
45
+ p96 = BioPlates.read("spec/fixtures/4x96.csv")
46
+ @plate = p96["Plate1"]
47
+ end
48
+
49
+ it "outputs a CSV file" do
50
+ expect(CSV).to receive(:open)
51
+ @plate.dump
52
+ end
53
+
54
+ it "is of the correct length" do
55
+ expect_any_instance_of(CSV).to receive(:<<).exactly(97).times
56
+ @plate.dump
57
+ end
58
+
59
+ it "includes arbitrary well annotations" do
60
+ include FakeFS::SpecHelpers
61
+ @plate.dump("spec/tmp/output.txt")
62
+ output = File.open("spec/tmp/output.txt", &:readline)
63
+ expect(output.chomp).to eq "Plate,Row,Column,drug,conc"
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,32 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
17
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
18
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
19
+
20
+ require 'rspec'
21
+ require 'bio-plates'
22
+
23
+ # Requires supporting files with custom matchers and macros, etc,
24
+ # in ./support/ and its subdirectories.
25
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
26
+
27
+ RSpec.configure do |config|
28
+ config.before(:suite) do
29
+ fixtures_dir = File.join(File.dirname(__FILE__),'fixtures')
30
+ end
31
+ end
32
+
@@ -0,0 +1,97 @@
1
+ Plate,Row,Column,drug,conc
2
+ Plate1,A,01,si1,5
3
+ Plate1,A,02,si2,5
4
+ Plate1,A,03,si3,5
5
+ Plate1,A,04,si4,5
6
+ Plate1,A,05,si5,5
7
+ Plate1,A,06,si6,5
8
+ Plate1,A,07,si7,5
9
+ Plate1,A,08,si8,5
10
+ Plate1,A,09,si9,5
11
+ Plate1,A,10,si10,5
12
+ Plate1,A,11,si11,5
13
+ Plate1,A,12,si12,5
14
+ Plate1,B,01,si1,5
15
+ Plate1,B,02,si2,5
16
+ Plate1,B,03,si3,5
17
+ Plate1,B,04,si4,5
18
+ Plate1,B,05,si5,5
19
+ Plate1,B,06,si6,5
20
+ Plate1,B,07,si7,5
21
+ Plate1,B,08,si8,5
22
+ Plate1,B,09,si9,5
23
+ Plate1,B,10,si10,5
24
+ Plate1,B,11,si11,5
25
+ Plate1,B,12,si12,5
26
+ Plate1,C,01,si1,5
27
+ Plate1,C,02,si2,5
28
+ Plate1,C,03,si3,5
29
+ Plate1,C,04,si4,5
30
+ Plate1,C,05,si5,5
31
+ Plate1,C,06,si6,5
32
+ Plate1,C,07,si7,5
33
+ Plate1,C,08,si8,5
34
+ Plate1,C,09,si9,5
35
+ Plate1,C,10,si10,5
36
+ Plate1,C,11,si11,5
37
+ Plate1,C,12,si12,5
38
+ Plate1,D,01,si1,5
39
+ Plate1,D,02,si2,5
40
+ Plate1,D,03,si3,5
41
+ Plate1,D,04,si4,5
42
+ Plate1,D,05,si5,5
43
+ Plate1,D,06,si6,5
44
+ Plate1,D,07,si7,5
45
+ Plate1,D,08,si8,5
46
+ Plate1,D,09,si9,5
47
+ Plate1,D,10,si10,5
48
+ Plate1,D,11,si11,5
49
+ Plate1,D,12,si12,5
50
+ Plate1,E,01,si1,5
51
+ Plate1,E,02,si2,5
52
+ Plate1,E,03,si3,5
53
+ Plate1,E,04,si4,5
54
+ Plate1,E,05,si5,5
55
+ Plate1,E,06,si6,5
56
+ Plate1,E,07,si7,5
57
+ Plate1,E,08,si8,5
58
+ Plate1,E,09,si9,5
59
+ Plate1,E,10,si10,5
60
+ Plate1,E,11,si11,5
61
+ Plate1,E,12,si12,5
62
+ Plate1,F,01,si1,5
63
+ Plate1,F,02,si2,5
64
+ Plate1,F,03,si3,5
65
+ Plate1,F,04,si4,5
66
+ Plate1,F,05,si5,5
67
+ Plate1,F,06,si6,5
68
+ Plate1,F,07,si7,5
69
+ Plate1,F,08,si8,5
70
+ Plate1,F,09,si9,5
71
+ Plate1,F,10,si10,5
72
+ Plate1,F,11,si11,5
73
+ Plate1,F,12,si12,5
74
+ Plate1,G,01,si1,5
75
+ Plate1,G,02,si2,5
76
+ Plate1,G,03,si3,5
77
+ Plate1,G,04,si4,5
78
+ Plate1,G,05,si5,5
79
+ Plate1,G,06,si6,5
80
+ Plate1,G,07,si7,5
81
+ Plate1,G,08,si8,5
82
+ Plate1,G,09,si9,5
83
+ Plate1,G,10,si10,5
84
+ Plate1,G,11,si11,5
85
+ Plate1,G,12,si12,5
86
+ Plate1,H,01,si1,5
87
+ Plate1,H,02,si2,5
88
+ Plate1,H,03,si3,5
89
+ Plate1,H,04,si4,5
90
+ Plate1,H,05,si5,5
91
+ Plate1,H,06,si6,5
92
+ Plate1,H,07,si7,5
93
+ Plate1,H,08,si8,5
94
+ Plate1,H,09,si9,5
95
+ Plate1,H,10,si10,5
96
+ Plate1,H,11,si11,5
97
+ Plate1,H,12,si12,5
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bio-plates
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Steve Pettitt
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bio
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jeweler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rdoc
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.12'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.12'
97
+ - !ruby/object:Gem::Dependency
98
+ name: fakefs
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.6'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.6'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.10'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.10'
125
+ description: Methods for handling multiwell plate annotations, includes ranges and
126
+ quadrants
127
+ email: spettitt@gmail.com
128
+ executables:
129
+ - bioplates
130
+ extensions: []
131
+ extra_rdoc_files:
132
+ - LICENSE.txt
133
+ - README.md
134
+ - README.rdoc
135
+ files:
136
+ - ".document"
137
+ - ".rspec"
138
+ - ".travis.yml"
139
+ - Gemfile
140
+ - LICENSE.txt
141
+ - README.md
142
+ - README.rdoc
143
+ - Rakefile
144
+ - bin/bioplates
145
+ - lib/bio-plates.rb
146
+ - lib/bio-plates/plates.rb
147
+ - spec/bio-plates_spec.rb
148
+ - spec/fixtures/384.csv
149
+ - spec/fixtures/4x96.csv
150
+ - spec/fixtures/anno96.csv
151
+ - spec/fixtures/emptyrowcol.csv
152
+ - spec/fixtures/rowname-error.csv
153
+ - spec/plate_spec.rb
154
+ - spec/spec_helper.rb
155
+ - spec/tmp/output.txt
156
+ homepage: http://github.com/stveep/bioruby-plates
157
+ licenses:
158
+ - MIT
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: 2.1.0
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubyforge_project:
176
+ rubygems_version: 2.4.5
177
+ signing_key:
178
+ specification_version: 4
179
+ summary: Methods for handling multiwell plate annotations
180
+ test_files: []