flex-station-data 0.3.0 → 1.0.2
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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +33 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +106 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +23 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +51 -28
- data/README.md +16 -29
- data/Rakefile +5 -1
- data/bin/flex-station +33 -11
- data/bin/flex-station-linear-regression +19 -37
- data/flex-station-data.gemspec +7 -4
- data/lib/flex_station_data.rb +2 -0
- data/lib/flex_station_data/concerns/callable.rb +33 -0
- data/lib/flex_station_data/concerns/presenter.rb +4 -18
- data/lib/flex_station_data/concerns/service.rb +4 -18
- data/lib/flex_station_data/default_sample_map.rb +33 -0
- data/lib/flex_station_data/linear_regression.rb +2 -0
- data/lib/flex_station_data/plate.rb +14 -3
- data/lib/flex_station_data/presenters/plate_hash.rb +26 -0
- data/lib/flex_station_data/presenters/plates_hash.rb +26 -0
- data/lib/flex_station_data/presenters/sample_hash.rb +47 -0
- data/lib/flex_station_data/presenters/sample_regression_hash.rb +44 -0
- data/lib/flex_station_data/sample.rb +20 -5
- data/lib/flex_station_data/services/compute_mean.rb +2 -0
- data/lib/flex_station_data/services/load_plates.rb +12 -1
- data/lib/flex_station_data/services/parse_plate.rb +6 -4
- data/lib/flex_station_data/services/parse_plate_readings.rb +43 -36
- data/lib/flex_station_data/services/parse_sample_map.rb +47 -0
- data/lib/flex_station_data/services/sample_quality.rb +6 -5
- data/lib/flex_station_data/services/value_quality.rb +5 -1
- data/lib/flex_station_data/version.rb +3 -1
- data/lib/flex_station_data/wells.rb +16 -15
- metadata +31 -19
- data/bin/flex-station-sample-data +0 -54
- data/lib/flex_station_data/presenters/linear_regression/plate_hash.rb +0 -27
- data/lib/flex_station_data/presenters/linear_regression/plates_hash.rb +0 -28
- data/lib/flex_station_data/presenters/linear_regression/sample_hash.rb +0 -47
- data/lib/flex_station_data/presenters/linear_regression/sample_regression_hash.rb +0 -43
- data/lib/flex_station_data/presenters/linear_regression/verbose_sample_csv.rb +0 -28
- data/lib/flex_station_data/presenters/plate_csv.rb +0 -29
- data/lib/flex_station_data/presenters/plates_csv.rb +0 -28
- data/lib/flex_station_data/presenters/sample_csv.rb +0 -56
- data/lib/flex_station_data/readings.rb +0 -16
- data/lib/flex_station_data/services/parse_plate_samples.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ec58282e79f9a538c3ac94892a08381067b37c3a3c598cb96e5208cc9ce4480
|
4
|
+
data.tar.gz: 7080bda00a6d6b767829ab87459173d3b8544947d13e1c3cb287be0b85dfab92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9373eb37df249a26f1d4b85232a82dd9ca5bea02082e59eab93a6522fd59d1d325fea5bdbd0d426036c435665b92f0d96b5cdd81bc068420a410e556b4c8943
|
7
|
+
data.tar.gz: cecae699c459a5c8b9709e4db78594e27d7e32c94e3763e939412b4505c780be217f6c8889af34f450641c6f00893370b781f2a2d792f78d1ed014f27ce654ca
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
25
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
28
|
+
with:
|
29
|
+
ruby-version: 2.7
|
30
|
+
- name: Install dependencies
|
31
|
+
run: bundle install
|
32
|
+
- name: Run tests
|
33
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
2
|
+
Enabled: true
|
3
|
+
|
4
|
+
Layout/ExtraSpacing:
|
5
|
+
Exclude:
|
6
|
+
- spec/**/*_spec.rb
|
7
|
+
|
8
|
+
Layout/HashAlignment:
|
9
|
+
EnforcedHashRocketStyle: table
|
10
|
+
EnforcedColonStyle: table
|
11
|
+
|
12
|
+
Layout/LineLength:
|
13
|
+
Exclude:
|
14
|
+
- spec/**/*_spec.rb
|
15
|
+
|
16
|
+
Layout/MultilineMethodCallIndentation:
|
17
|
+
EnforcedStyle: indented
|
18
|
+
|
19
|
+
Layout/SpaceAroundMethodCallOperator:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Lint/DeprecatedOpenSSLConstant:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
Lint/MixedRegexpCaptureTypes:
|
32
|
+
Enabled: true
|
33
|
+
|
34
|
+
Lint/RaiseException:
|
35
|
+
Enabled: true
|
36
|
+
|
37
|
+
Lint/StructNewOverride:
|
38
|
+
Enabled: true
|
39
|
+
|
40
|
+
Metrics/BlockLength:
|
41
|
+
Exclude:
|
42
|
+
- spec/**/*_spec.rb
|
43
|
+
|
44
|
+
Metrics/MethodLength:
|
45
|
+
Max: 12
|
46
|
+
|
47
|
+
Naming/MethodParameterName:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Naming/VariableNumber:
|
51
|
+
EnforcedStyle: snake_case
|
52
|
+
|
53
|
+
Style/AccessorGrouping:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Style/BisectedAttrAccessor:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Style/Documentation:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Style/ExponentialNotation:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
Style/HashEachMethods:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Style/HashTransformKeys:
|
69
|
+
Enabled: true
|
70
|
+
|
71
|
+
Style/HashTransformValues:
|
72
|
+
Enabled: true
|
73
|
+
|
74
|
+
Style/PercentLiteralDelimiters:
|
75
|
+
Exclude:
|
76
|
+
- flex-station-data.gemspec
|
77
|
+
|
78
|
+
Style/RedundantAssignment:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Style/RedundantFetchBlock:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
Style/RedundantPercentQ:
|
85
|
+
Exclude:
|
86
|
+
- flex-station-data.gemspec
|
87
|
+
|
88
|
+
Style/RedundantRegexpCharacterClass:
|
89
|
+
Enabled: true
|
90
|
+
|
91
|
+
Style/RedundantRegexpEscape:
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
Style/SlicingWithRange:
|
95
|
+
Enabled: true
|
96
|
+
|
97
|
+
Style/StringLiterals:
|
98
|
+
EnforcedStyle: double_quotes
|
99
|
+
|
100
|
+
Style/SymbolArray:
|
101
|
+
Exclude:
|
102
|
+
- spec/**/*_spec.rb
|
103
|
+
|
104
|
+
Style/WordArray:
|
105
|
+
Exclude:
|
106
|
+
- spec/**/*_spec.rb
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,29 @@
|
|
1
|
+
# 1.0.2
|
2
|
+
|
3
|
+
* Update to Ruby 2.7.1
|
4
|
+
* Introduce Rubocop
|
5
|
+
* Added "Ruby" GitHub workflow
|
6
|
+
|
7
|
+
# 1.0.1
|
8
|
+
|
9
|
+
* Miscellaneous refactoring.
|
10
|
+
|
11
|
+
# 1.0.0
|
12
|
+
|
13
|
+
* Removed option for sample data report and verbose linear regression report.
|
14
|
+
|
15
|
+
# 0.3.2
|
16
|
+
|
17
|
+
* Internal refactoring
|
18
|
+
|
19
|
+
# 0.3.1
|
20
|
+
|
21
|
+
* Fixed bug
|
22
|
+
|
1
23
|
# 0.3.0
|
2
24
|
|
3
25
|
* The linear regression analysis report now produces a summary report of the
|
4
|
-
regression for each sample. The sample data can by added by
|
26
|
+
regression for each sample. The sample data can by added by specifying the
|
5
27
|
`--verbose` option.
|
6
28
|
|
7
29
|
# 0.2.0
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,48 +1,70 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
flex-station-data (0.
|
4
|
+
flex-station-data (1.0.2)
|
5
5
|
activesupport
|
6
6
|
linefit
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (6.0.
|
11
|
+
activesupport (6.0.3.2)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 0.7, < 2)
|
14
14
|
minitest (~> 5.1)
|
15
15
|
tzinfo (~> 1.1)
|
16
|
-
zeitwerk (~> 2.
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
17
|
+
ast (2.4.1)
|
18
|
+
coderay (1.1.3)
|
19
|
+
concurrent-ruby (1.1.6)
|
20
|
+
diff-lcs (1.4.4)
|
21
|
+
i18n (1.8.3)
|
21
22
|
concurrent-ruby (~> 1.0)
|
22
23
|
linefit (0.3.4)
|
23
|
-
method_source (0.
|
24
|
-
minitest (5.
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
rspec
|
24
|
+
method_source (1.0.0)
|
25
|
+
minitest (5.14.1)
|
26
|
+
parallel (1.19.2)
|
27
|
+
parser (2.7.1.4)
|
28
|
+
ast (~> 2.4.1)
|
29
|
+
pry (0.13.1)
|
30
|
+
coderay (~> 1.1)
|
31
|
+
method_source (~> 1.0)
|
32
|
+
rainbow (3.0.0)
|
33
|
+
rake (13.0.1)
|
34
|
+
regexp_parser (1.7.1)
|
35
|
+
rexml (3.2.4)
|
36
|
+
rspec (3.9.0)
|
37
|
+
rspec-core (~> 3.9.0)
|
38
|
+
rspec-expectations (~> 3.9.0)
|
39
|
+
rspec-mocks (~> 3.9.0)
|
40
|
+
rspec-core (3.9.2)
|
41
|
+
rspec-support (~> 3.9.3)
|
42
|
+
rspec-expectations (3.9.2)
|
36
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-mocks (3.
|
44
|
+
rspec-support (~> 3.9.0)
|
45
|
+
rspec-mocks (3.9.1)
|
39
46
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-support (3.
|
47
|
+
rspec-support (~> 3.9.0)
|
48
|
+
rspec-support (3.9.3)
|
49
|
+
rubocop (0.87.1)
|
50
|
+
parallel (~> 1.10)
|
51
|
+
parser (>= 2.7.1.1)
|
52
|
+
rainbow (>= 2.2.2, < 4.0)
|
53
|
+
regexp_parser (>= 1.7)
|
54
|
+
rexml
|
55
|
+
rubocop-ast (>= 0.1.0, < 1.0)
|
56
|
+
ruby-progressbar (~> 1.7)
|
57
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
58
|
+
rubocop-ast (0.1.0)
|
59
|
+
parser (>= 2.7.0.1)
|
60
|
+
rubocop-rspec (1.42.0)
|
61
|
+
rubocop (>= 0.87.0)
|
62
|
+
ruby-progressbar (1.10.1)
|
42
63
|
thread_safe (0.3.6)
|
43
|
-
tzinfo (1.2.
|
64
|
+
tzinfo (1.2.7)
|
44
65
|
thread_safe (~> 0.1)
|
45
|
-
|
66
|
+
unicode-display_width (1.7.0)
|
67
|
+
zeitwerk (2.3.1)
|
46
68
|
|
47
69
|
PLATFORMS
|
48
70
|
ruby
|
@@ -51,8 +73,9 @@ DEPENDENCIES
|
|
51
73
|
bundler (~> 2.0)
|
52
74
|
flex-station-data!
|
53
75
|
pry
|
54
|
-
rake (~>
|
76
|
+
rake (~> 13.0)
|
55
77
|
rspec (~> 3.8)
|
78
|
+
rubocop-rspec
|
56
79
|
|
57
80
|
BUNDLED WITH
|
58
|
-
2.
|
81
|
+
2.1.4
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
Tools for reading and analyzing data from the FlexStation microplate reader.
|
4
4
|
|
5
|
-
Currently this is somewhere between alpha and beta.
|
6
|
-
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
@@ -28,51 +26,40 @@ To update your installation, use:
|
|
28
26
|
|
29
27
|
## Usage
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
To view the sample results from a set of plate readings, use the following
|
29
|
+
To perform a linear regression analysis on the sample data, use the following
|
34
30
|
command:
|
35
31
|
|
36
|
-
$ flex-station
|
32
|
+
$ flex-station linear-regression <source file> [--threshold=<threshold>] [--min-r-squared=<minimum R²>]
|
37
33
|
|
38
34
|
Where `source file` is the file that you got from the reader. You can specify
|
39
35
|
multiple source files. The `threshold` setting is optional. If provided,
|
40
36
|
samples with values that are below the `threshold` value will be skipped.
|
41
37
|
`threshold` must be a number.
|
42
38
|
|
39
|
+
If a `--min-r-squared` value is given, samples with a R² value that falls
|
40
|
+
below the threshold will be flagged as "poor fits." If no `--min-r-squared` is
|
41
|
+
specified, a default of 0.75 will be used.
|
42
|
+
|
43
43
|
The output is in CSV format. You'll probably want to save it to a file. You
|
44
44
|
can do that by piping the output to a file:
|
45
45
|
|
46
|
-
$ flex-station sample-data source-data.csv --threshold=300 > sample-data.csv
|
47
|
-
|
48
|
-
### Performing linear regression analysis on the sample data
|
49
|
-
|
50
|
-
To perform a linear regression analysis on the sample data, use the following
|
51
|
-
command:
|
52
|
-
|
53
|
-
$ flex-station-data liinear-regression <source file> [--threshold=<threshold>] [--verbose] [--min-r-squared=<mininmum R²>]
|
54
|
-
|
55
|
-
Note that the `source file` and `threshold` options are the same as for the
|
56
|
-
`sample-data` command above. If a `--min-r-squared` value is given, samples
|
57
|
-
with a R² value that falls below the threshold will be flagged as "poor fits."
|
58
|
-
If no `--min-r-squared` is specified, a default of 0.75 will be used.
|
59
|
-
|
60
|
-
By default the linear regression tool will produce a summary report giving the
|
61
|
-
slope, intercept, and R² values for each sample. However if `--verbose` is
|
62
|
-
specified, it will also include the sample data and regressions for each well.
|
63
|
-
|
64
|
-
As with the sample data tool, you will probably want to pipe the output to a file:
|
65
|
-
|
66
46
|
$ flex-station linear-regression source-data.csv --threshold=300 > linear-regression.csv
|
67
47
|
|
68
48
|
## Contributing
|
69
49
|
|
70
|
-
Bug reports and pull requests are welcome on GitHub at
|
50
|
+
Bug reports and pull requests are welcome on GitHub at
|
51
|
+
https://github.com/johncarney/flex-station-data. This project is intended to
|
52
|
+
be a safe, welcoming space for collaboration, and contributors are expected to
|
53
|
+
adhere to the [Contributor Covenant](http://contributor-covenant.org) code of
|
54
|
+
conduct.
|
71
55
|
|
72
56
|
## License
|
73
57
|
|
74
|
-
The gem is available as open source under the terms of the
|
58
|
+
The gem is available as open source under the terms of the
|
59
|
+
[MIT License](https://opensource.org/licenses/MIT).
|
75
60
|
|
76
61
|
## Code of Conduct
|
77
62
|
|
78
|
-
Everyone interacting in the FlexStationData project’s codebases, issue
|
63
|
+
Everyone interacting in the FlexStationData project’s codebases, issue
|
64
|
+
trackers, chat rooms and mailing lists is expected to follow the
|
65
|
+
[code of conduct](https://github.com/johncarney/flex-station-data/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
CHANGED
data/bin/flex-station
CHANGED
@@ -1,16 +1,38 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require "pathname"
|
5
|
+
require "flex_station_data/concerns/callable"
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
class App
|
8
|
+
include FlexStationData::Concerns::Callable[:run]
|
9
|
+
|
10
|
+
attr_reader :command, :args
|
11
|
+
|
12
|
+
def initialize(command = "help", *args)
|
13
|
+
@command = command
|
14
|
+
@args = args
|
15
|
+
end
|
16
|
+
|
17
|
+
def dir_path
|
18
|
+
Pathname(__dir__)
|
19
|
+
end
|
20
|
+
|
21
|
+
def linear_regression_path
|
22
|
+
dir_path.join("flex-station-linear-regression")
|
23
|
+
end
|
24
|
+
|
25
|
+
def run
|
26
|
+
case command
|
27
|
+
when "linear-regression"
|
28
|
+
exec(linear_regression_path.to_path, *args)
|
29
|
+
when "help", "--help"
|
30
|
+
puts "USAGE: flex-station <command>"
|
31
|
+
else
|
32
|
+
warn "Unrecognised command: #{command}"
|
33
|
+
exit(1)
|
34
|
+
end
|
35
|
+
end
|
16
36
|
end
|
37
|
+
|
38
|
+
App.run(*ARGV)
|