bioinform 0.1.8 → 0.1.9
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.
- data/.gitignore +1 -0
- data/Gemfile +12 -0
- data/Guardfile +9 -0
- data/README.md +7 -1
- data/TODO.txt +8 -0
- data/bioinform.gemspec +7 -5
- data/lib/bioinform.rb +1 -0
- data/lib/bioinform/cli.rb +12 -3
- data/lib/bioinform/cli/convert_motif.rb +108 -0
- data/lib/bioinform/cli/merge_into_collection.rb +6 -2
- data/lib/bioinform/cli/pcm2pwm.rb +1 -1
- data/lib/bioinform/cli/split_motifs.rb +1 -1
- data/lib/bioinform/conversion_algorithms/pcm2ppm_converter.rb +19 -0
- data/lib/bioinform/conversion_algorithms/pcm2pwm_converter.rb +20 -0
- data/lib/bioinform/conversion_algorithms/pcm2pwm_mara_converter.rb +0 -0
- data/lib/bioinform/conversion_algorithms/ppm2pcm_converter.rb +0 -0
- data/lib/bioinform/conversion_algorithms/ppm2pwm_converter.rb +0 -0
- data/lib/bioinform/data_models/collection.rb +21 -35
- data/lib/bioinform/data_models/motif.rb +56 -0
- data/lib/bioinform/data_models/pcm.rb +4 -8
- data/lib/bioinform/data_models/pm.rb +19 -48
- data/lib/bioinform/data_models/pwm.rb +16 -0
- data/lib/bioinform/formatters.rb +2 -0
- data/lib/bioinform/formatters/raw_formatter.rb +41 -0
- data/lib/bioinform/formatters/transfac_formatter.rb +39 -0
- data/lib/bioinform/parsers.rb +2 -1
- data/lib/bioinform/parsers/jaspar_parser.rb +35 -0
- data/lib/bioinform/parsers/string_parser.rb +1 -1
- data/lib/bioinform/parsers/trivial_parser.rb +2 -1
- data/lib/bioinform/parsers/yaml_parser.rb +1 -1
- data/lib/bioinform/support.rb +2 -1
- data/lib/bioinform/support/parameters.rb +27 -18
- data/lib/bioinform/support/strip_doc.rb +9 -0
- data/lib/bioinform/version.rb +1 -1
- data/spec/cli/convert_motif_spec.rb +107 -0
- data/spec/cli/data/merge_into_collection/collection.yaml.result +186 -183
- data/spec/cli/data/merge_into_collection/collection_pwm.yaml.result +186 -183
- data/spec/cli/data/split_motifs/collection.yaml +184 -193
- data/spec/cli/shared_examples/convert_motif/motif_list_empty.rb +18 -0
- data/spec/cli/shared_examples/convert_motif/several_motifs_specified.rb +14 -0
- data/spec/cli/shared_examples/convert_motif/single_motif_specified.rb +50 -0
- data/spec/cli/shared_examples/convert_motif/yield_help_string.rb +5 -0
- data/spec/cli/shared_examples/convert_motif/yield_motif_conversion_error.rb +4 -0
- data/spec/data_models/collection_spec.rb +36 -34
- data/spec/data_models/motif_spec.rb +224 -0
- data/spec/data_models/pcm_spec.rb +28 -17
- data/spec/data_models/pm_spec.rb +83 -121
- data/spec/data_models/pwm_spec.rb +38 -0
- data/spec/fabricators/collection_fabricator.rb +2 -2
- data/spec/fabricators/motif_fabricator.rb +33 -0
- data/spec/fabricators/motif_formats_fabricator.rb +125 -0
- data/spec/fabricators/pcm_fabricator.rb +25 -0
- data/spec/fabricators/pm_fabricator.rb +10 -1
- data/spec/fabricators/ppm_fabricator.rb +14 -0
- data/spec/fabricators/pwm_fabricator.rb +16 -0
- data/spec/parsers/trivial_parser_spec.rb +12 -12
- data/spec/parsers/yaml_parser_spec.rb +11 -11
- data/spec/spec_helper.rb +19 -49
- data/spec/spec_helper_source.rb +59 -0
- metadata +78 -7
data/spec/data_models/pm_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative '../../lib/bioinform/data_models/pm'
|
|
3
3
|
|
4
4
|
module Bioinform
|
5
5
|
describe PM do
|
6
|
-
{:
|
6
|
+
{:as_pcm => PCM, :as_pwm => PWM, :as_ppm => PPM}.each do |converter_method, result_klass|
|
7
7
|
describe "##{converter_method}" do
|
8
8
|
before :each do
|
9
9
|
@collection = Collection.new(name: 'Collection 1')
|
@@ -17,97 +17,97 @@ module Bioinform
|
|
17
17
|
it "should return an instance of #{result_klass}" do
|
18
18
|
@conv_motif.should be_kind_of(result_klass)
|
19
19
|
end
|
20
|
-
it 'should return have the same matrix, name
|
20
|
+
it 'should return have the same matrix, name and background' do #, background and tags' do
|
21
21
|
@conv_motif.matrix.should == @matrix
|
22
22
|
@conv_motif.name.should == @name
|
23
23
|
@conv_motif.background.should == @background
|
24
|
-
@conv_motif.tags.should == @tags
|
24
|
+
# @conv_motif.tags.should == @tags
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
describe '#tagged?' do
|
30
|
-
context 'when PM marked with Collection object' do
|
31
|
-
context 'without collection-name' do
|
32
|
-
before :each do
|
33
|
-
@marking_collection = Collection.new
|
34
|
-
@nonmarking_collection = Collection.new
|
35
|
-
@pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
36
|
-
@pm.mark(@marking_collection)
|
37
|
-
end
|
38
|
-
it 'should be true for marking collection' do
|
39
|
-
@pm.should be_tagged(@marking_collection)
|
40
|
-
end
|
41
|
-
it 'should be false for nonmarking collection' do
|
42
|
-
@pm.should_not be_tagged(@nonmarking_collection)
|
43
|
-
end
|
44
|
-
it 'should be false for nil-name' do
|
45
|
-
@pm.should_not be_tagged(nil)
|
46
|
-
end
|
47
|
-
it 'should be false for any string' do
|
48
|
-
@pm.should_not be_tagged('Another name')
|
49
|
-
end
|
50
|
-
end
|
51
|
-
context 'with collection-name' do
|
52
|
-
before :each do
|
53
|
-
@marking_collection = Collection.new(name: 'Collection name')
|
54
|
-
@nonmarking_collection = Collection.new(name: 'Another name')
|
55
|
-
@pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
56
|
-
@pm.mark(@marking_collection)
|
57
|
-
end
|
58
|
-
it 'should be true for marking collection' do
|
59
|
-
@pm.should be_tagged(@marking_collection)
|
60
|
-
end
|
61
|
-
it 'should be false for nonmarking collection' do
|
62
|
-
@pm.should_not be_tagged(@nonmarking_collection)
|
63
|
-
end
|
64
|
-
it 'should be true for name of marking collection' do
|
65
|
-
@pm.should be_tagged('Collection name')
|
66
|
-
end
|
67
|
-
it 'should be false for string that is not name of marking collection' do
|
68
|
-
@pm.should_not be_tagged('Another name')
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
29
|
+
# describe '#tagged?' do
|
30
|
+
# context 'when PM marked with Collection object' do
|
31
|
+
# context 'without collection-name' do
|
32
|
+
# before :each do
|
33
|
+
# @marking_collection = Collection.new
|
34
|
+
# @nonmarking_collection = Collection.new
|
35
|
+
# @pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
36
|
+
# @pm.mark(@marking_collection)
|
37
|
+
# end
|
38
|
+
# it 'should be true for marking collection' do
|
39
|
+
# @pm.should be_tagged(@marking_collection)
|
40
|
+
# end
|
41
|
+
# it 'should be false for nonmarking collection' do
|
42
|
+
# @pm.should_not be_tagged(@nonmarking_collection)
|
43
|
+
# end
|
44
|
+
# it 'should be false for nil-name' do
|
45
|
+
# @pm.should_not be_tagged(nil)
|
46
|
+
# end
|
47
|
+
# it 'should be false for any string' do
|
48
|
+
# @pm.should_not be_tagged('Another name')
|
49
|
+
# end
|
50
|
+
# end
|
51
|
+
# context 'with collection-name' do
|
52
|
+
# before :each do
|
53
|
+
# @marking_collection = Collection.new(name: 'Collection name')
|
54
|
+
# @nonmarking_collection = Collection.new(name: 'Another name')
|
55
|
+
# @pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
56
|
+
# @pm.mark(@marking_collection)
|
57
|
+
# end
|
58
|
+
# it 'should be true for marking collection' do
|
59
|
+
# @pm.should be_tagged(@marking_collection)
|
60
|
+
# end
|
61
|
+
# it 'should be false for nonmarking collection' do
|
62
|
+
# @pm.should_not be_tagged(@nonmarking_collection)
|
63
|
+
# end
|
64
|
+
# it 'should be true for name of marking collection' do
|
65
|
+
# @pm.should be_tagged('Collection name')
|
66
|
+
# end
|
67
|
+
# it 'should be false for string that is not name of marking collection' do
|
68
|
+
# @pm.should_not be_tagged('Another name')
|
69
|
+
# end
|
70
|
+
# end
|
71
|
+
# end
|
72
72
|
|
73
|
-
context 'when PM marked with name' do
|
74
|
-
before :each do
|
75
|
-
@nonmarking_collection = Collection.new(name: 'Another name')
|
76
|
-
@pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
77
|
-
@pm.mark('Mark name')
|
78
|
-
end
|
79
|
-
it 'should be true for marking name' do
|
80
|
-
@pm.should be_tagged('Mark name')
|
81
|
-
end
|
82
|
-
it 'should be false for string that is not marking name' do
|
83
|
-
@pm.should_not be_tagged('Another name')
|
84
|
-
end
|
85
|
-
it 'should be false for nonmarking collection' do
|
86
|
-
@pm.should_not be_tagged(@nonmarking_collection)
|
87
|
-
end
|
88
|
-
end
|
73
|
+
# context 'when PM marked with name' do
|
74
|
+
# before :each do
|
75
|
+
# @nonmarking_collection = Collection.new(name: 'Another name')
|
76
|
+
# @pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
77
|
+
# @pm.mark('Mark name')
|
78
|
+
# end
|
79
|
+
# it 'should be true for marking name' do
|
80
|
+
# @pm.should be_tagged('Mark name')
|
81
|
+
# end
|
82
|
+
# it 'should be false for string that is not marking name' do
|
83
|
+
# @pm.should_not be_tagged('Another name')
|
84
|
+
# end
|
85
|
+
# it 'should be false for nonmarking collection' do
|
86
|
+
# @pm.should_not be_tagged(@nonmarking_collection)
|
87
|
+
# end
|
88
|
+
# end
|
89
89
|
|
90
|
-
context 'when PM marked with several marks' do
|
91
|
-
before :each do
|
92
|
-
@collection_1 = Collection.new(name: 'First name')
|
93
|
-
@collection_2 = Collection.new(name: 'Second name')
|
94
|
-
@collection_3 = Collection.new(name: 'Nonmarking collection')
|
95
|
-
@pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
96
|
-
@pm.mark(@collection_1)
|
97
|
-
@pm.mark(@collection_2)
|
98
|
-
@pm.mark('Stringy-name')
|
99
|
-
end
|
100
|
-
it 'should be true for each mark' do
|
101
|
-
@pm.should be_tagged(@collection_1)
|
102
|
-
@pm.should be_tagged(@collection_2)
|
103
|
-
@pm.should be_tagged('Stringy-name')
|
104
|
-
end
|
105
|
-
it 'should be false for not presented marks' do
|
106
|
-
@pm.should_not be_tagged(@collection_3)
|
107
|
-
@pm.should_not be_tagged('Bad stringy-name')
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
90
|
+
# context 'when PM marked with several marks' do
|
91
|
+
# before :each do
|
92
|
+
# @collection_1 = Collection.new(name: 'First name')
|
93
|
+
# @collection_2 = Collection.new(name: 'Second name')
|
94
|
+
# @collection_3 = Collection.new(name: 'Nonmarking collection')
|
95
|
+
# @pm = PM.new(matrix:[[1,1,1,1]], name:'Motif name')
|
96
|
+
# @pm.mark(@collection_1)
|
97
|
+
# @pm.mark(@collection_2)
|
98
|
+
# @pm.mark('Stringy-name')
|
99
|
+
# end
|
100
|
+
# it 'should be true for each mark' do
|
101
|
+
# @pm.should be_tagged(@collection_1)
|
102
|
+
# @pm.should be_tagged(@collection_2)
|
103
|
+
# @pm.should be_tagged('Stringy-name')
|
104
|
+
# end
|
105
|
+
# it 'should be false for not presented marks' do
|
106
|
+
# @pm.should_not be_tagged(@collection_3)
|
107
|
+
# @pm.should_not be_tagged('Bad stringy-name')
|
108
|
+
# end
|
109
|
+
# end
|
110
|
+
# end
|
111
111
|
|
112
112
|
describe '#==' do
|
113
113
|
it 'should be true iff motifs have the same matrix, background and name' do
|
@@ -327,44 +327,6 @@ module Bioinform
|
|
327
327
|
end
|
328
328
|
end
|
329
329
|
|
330
|
-
describe '#best_score' do
|
331
|
-
it 'should be equal to best score' do
|
332
|
-
@pm = PM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
333
|
-
@pm.best_score.should == 4.9 + 7.13 + (-1.0)
|
334
|
-
end
|
335
|
-
end
|
336
|
-
describe '#worst_score' do
|
337
|
-
it 'should be equal to worst score' do
|
338
|
-
@pm = PM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
339
|
-
@pm.worst_score.should == 1.3 + 3.25 + (-1.5)
|
340
|
-
end
|
341
|
-
end
|
342
|
-
|
343
|
-
describe '#best_suffix' do
|
344
|
-
it 'should return maximal score of suffices from i-th position inclusively i.e. [i..end]' do
|
345
|
-
@pm = PM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
346
|
-
@pm.best_suffix(0).should == (4.9 + 7.13 - 1.0)
|
347
|
-
@pm.best_suffix(1).should == (7.13 - 1.0)
|
348
|
-
@pm.best_suffix(2).should == (-1.0)
|
349
|
-
@pm.best_suffix(3).should == (0.0)
|
350
|
-
end
|
351
|
-
it 'should give right results after left(right)_augment, discrete, reverse_complement etc' do
|
352
|
-
pm = PM.new([[1, 2, 3, 4], [10,10.5,11,11.5]])
|
353
|
-
pm.best_suffix(1).should == 11.5
|
354
|
-
pm.left_augment!(1)
|
355
|
-
pm.best_suffix(1).should == 15.5
|
356
|
-
end
|
357
|
-
end
|
358
|
-
describe '#worst_suffix' do
|
359
|
-
it 'should return minimal score of suffices from i-th position inclusively i.e. [i..end]' do
|
360
|
-
@pm = PM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
361
|
-
@pm.worst_suffix(0).should == (1.3 + 3.25 - 1.5)
|
362
|
-
@pm.worst_suffix(1).should == (3.25 - 1.5)
|
363
|
-
@pm.worst_suffix(2).should == (- 1.5)
|
364
|
-
@pm.worst_suffix(3).should == (0.0)
|
365
|
-
end
|
366
|
-
end
|
367
|
-
|
368
330
|
[:reverse_complement].each do |meth|
|
369
331
|
describe "nonbang method #{meth}" do
|
370
332
|
before :each do
|
@@ -37,5 +37,43 @@ module Bioinform
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe '#best_score' do
|
41
|
+
it 'should be equal to best score' do
|
42
|
+
@pwm = PWM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
43
|
+
@pwm.best_score.should == 4.9 + 7.13 + (-1.0)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
describe '#worst_score' do
|
47
|
+
it 'should be equal to worst score' do
|
48
|
+
@pwm = PWM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
49
|
+
@pwm.worst_score.should == 1.3 + 3.25 + (-1.5)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe '#best_suffix' do
|
54
|
+
it 'should return maximal score of suffices from i-th position inclusively i.e. [i..end]' do
|
55
|
+
@pwm = PWM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
56
|
+
@pwm.best_suffix(0).should == (4.9 + 7.13 - 1.0)
|
57
|
+
@pwm.best_suffix(1).should == (7.13 - 1.0)
|
58
|
+
@pwm.best_suffix(2).should == (-1.0)
|
59
|
+
@pwm.best_suffix(3).should == (0.0)
|
60
|
+
end
|
61
|
+
it 'should give right results after left(right)_augment, discrete, reverse_complement etc' do
|
62
|
+
pwm = PWM.new([[1, 2, 3, 4], [10,10.5,11,11.5]])
|
63
|
+
pwm.best_suffix(1).should == 11.5
|
64
|
+
pwm.left_augment!(1)
|
65
|
+
pwm.best_suffix(1).should == 15.5
|
66
|
+
end
|
67
|
+
end
|
68
|
+
describe '#worst_suffix' do
|
69
|
+
it 'should return minimal score of suffices from i-th position inclusively i.e. [i..end]' do
|
70
|
+
@pwm = PWM.new( [[1.3, 2.0, 4.9, 3.2], [7.13, 6.5, 3.25, 4.633], [-1.0, -1.0, -1.5, -1.0]] )
|
71
|
+
@pwm.worst_suffix(0).should == (1.3 + 3.25 - 1.5)
|
72
|
+
@pwm.worst_suffix(1).should == (3.25 - 1.5)
|
73
|
+
@pwm.worst_suffix(2).should == (- 1.5)
|
74
|
+
@pwm.worst_suffix(3).should == (0.0)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
40
78
|
end
|
41
79
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Fabricator(:
|
1
|
+
Fabricator(:three_elements_collection, class_name: Bioinform::Collection, aliases: [:pm_collection]) do
|
2
2
|
name 'PM_collection'
|
3
|
-
after_build{|collection| collection << Fabricate(:
|
3
|
+
after_build{|collection| collection << Fabricate(:pm_1) << Fabricate(:pm_2) << Fabricate(:pm_3) }
|
4
4
|
end
|
5
5
|
|
6
6
|
Fabricator(:unnamed_pm_collection, from: :pm_collection) do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Fabricator(:motif, class_name: Bioinform::Motif) do
|
2
|
+
end
|
3
|
+
|
4
|
+
Fabricator(:motif_with_name, from: :motif) do
|
5
|
+
name 'Motif name'
|
6
|
+
end
|
7
|
+
|
8
|
+
Fabricator(:motif_pcm, from: :motif) do
|
9
|
+
pcm(fabricator: :pcm)
|
10
|
+
end
|
11
|
+
|
12
|
+
Fabricator(:motif_pwm, from: :motif) do
|
13
|
+
pwm(fabricator: :pwm)
|
14
|
+
end
|
15
|
+
|
16
|
+
Fabricator(:motif_ppm, from: :motif) do
|
17
|
+
ppm(fabricator: :ppm)
|
18
|
+
end
|
19
|
+
|
20
|
+
Fabricator(:motif_pcm_and_ppm, from: :motif) do
|
21
|
+
pcm(fabricator: :pcm)
|
22
|
+
ppm(fabricator: :ppm)
|
23
|
+
end
|
24
|
+
|
25
|
+
Fabricator(:motif_pwm_and_ppm, from: :motif) do
|
26
|
+
pwm(fabricator: :pwm)
|
27
|
+
ppm(fabricator: :ppm)
|
28
|
+
end
|
29
|
+
|
30
|
+
Fabricator(:motif_pcm_and_pwm, from: :motif) do
|
31
|
+
pcm(fabricator: :pcm)
|
32
|
+
pwm(fabricator: :pwm)
|
33
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
require_relative '../../lib/bioinform/support/strip_doc'
|
2
|
+
require 'ostruct'
|
3
|
+
|
4
|
+
Fabricator(:SP1_f1_plain_text, class_name: OpenStruct) do
|
5
|
+
name 'SP1_f1'
|
6
|
+
pcm (<<-EOS).strip_doc
|
7
|
+
SP1_f1
|
8
|
+
682.6436366358055 443.1455214015781 2075.655346294993 287.211468117951
|
9
|
+
299.8883246804867 103.74338315843572 2613.8927022405364 471.1315623708902
|
10
|
+
591.4892493324709 42.631827541794564 2845.1654083148564 9.36948726124641
|
11
|
+
7.071084742361592 45.29093411231232 3432.8847704374107 3.409183158303573
|
12
|
+
91.308984085713 19.1536481364332 3373.656949880137 4.5363903481026
|
13
|
+
809.2082973387932 2246.941954176211 61.30766021687515 371.19806071846244
|
14
|
+
120.56476435866055 42.4349244403591 3242.1560628684038 83.50022078295852
|
15
|
+
13.72524477409959 35.858220519297525 3332.4066864946167 106.66582066236779
|
16
|
+
558.1188080161639 90.0084504200356 2694.854973210736 145.67374080342415
|
17
|
+
264.0088462230318 254.7175868081866 2796.88087480315 173.0486646159857
|
18
|
+
519.46013914282 1874.9349086474765 654.5411208373813 439.7198038226514
|
19
|
+
EOS
|
20
|
+
pwm (<<-EOS).strip_doc
|
21
|
+
SP1_f1
|
22
|
+
-0.24435707885585292 -0.674823404693731 0.8657012535789866 -1.1060188862599287
|
23
|
+
-1.0631255752097797 -2.111925969423868 1.0960627561110403 -0.6138563775211977
|
24
|
+
-0.3872276234760535 -2.9739851913218045 1.1807800242010378 -4.338927525031566
|
25
|
+
-4.563896055436894 -2.9161633002532277 1.3684371349982638 -5.077972423609655
|
26
|
+
-2.2369752892820083 -3.7196436313301846 1.3510439136452734 -4.889930670508233
|
27
|
+
-0.07473964149330865 0.944919654762011 -2.6246857648086044 -0.8510983487822436
|
28
|
+
-1.9643526491643322 -2.978402770880115 1.3113096718240573 -2.324334259499025
|
29
|
+
-4.0155484139655835 -3.1384268078096667 1.3387488589788057 -2.084673903537648
|
30
|
+
-0.44509385828355363 -2.2510053061629702 1.1265431574368685 -1.7780413702431372
|
31
|
+
-1.1896356092245048 -1.2251832285630027 1.1636760063747527 -1.6080243648157353
|
32
|
+
-0.5166047365590571 0.7641033353626657 -0.2862677570028208 -0.68254820978656
|
33
|
+
EOS
|
34
|
+
|
35
|
+
pwm_by_ppm (<<-EOS).strip_doc
|
36
|
+
SP1_f1
|
37
|
+
-0.24500451019749314 -0.6770792648706158 0.8670547406179426 -1.1107587045732945
|
38
|
+
-1.0675673174344313 -2.129057091432141 1.097618374273881 -0.6158400910824666
|
39
|
+
-0.3883339637317867 -3.018376372012639 1.1823990131526274 -4.533519098288315
|
40
|
+
-4.814963574678032 -2.957870589233678 1.3701787559041199 -5.544504752142028
|
41
|
+
-2.256728287148141 -3.818484271031738 1.3527751116079707 -5.258845853421905
|
42
|
+
-0.07492111272663467 0.9463479675413448 -2.6550726738330934 -0.8542416951821531
|
43
|
+
-1.9787903996167093 -3.023005758900076 1.313016367251334 -2.3461281957623594
|
44
|
+
-4.151740650307917 -3.191404627775074 1.340472578885988 -2.1012766959190534
|
45
|
+
-0.44640561441369214 -2.271073912244469 1.1281221968922746 -1.789608002606767
|
46
|
+
-1.1949948607174645 -1.2308220430118417 1.1652826302263302 -1.6174046184238486
|
47
|
+
-0.5181873934002441 0.7653517506909445 -0.2870430604819932 -0.6848397571539165
|
48
|
+
EOS
|
49
|
+
|
50
|
+
ppm (<<-EOS).strip_doc
|
51
|
+
SP1_f1
|
52
|
+
0.1956752520244457 0.12702471235371654 0.5949727811186595 0.08232725450317827
|
53
|
+
0.0859609910087678 0.029737349849824683 0.7492549345313109 0.13504672461010295
|
54
|
+
0.1695464539935781 0.012220129436222756 0.8155477154477051 0.002685701122505801
|
55
|
+
0.0020268793478638923 0.012982344624970667 0.9840135563800679 0.0009772196471150077
|
56
|
+
0.0261731121689194 0.005490265674714912 0.9670362960755289 0.0013003260808535316
|
57
|
+
0.2319541690923538 0.6440709464963454 0.017573432491199324 0.10640145192010551
|
58
|
+
0.03455908674020943 0.012163688473573988 0.9293424426115627 0.02393478217466954
|
59
|
+
0.003934250004152571 0.010278520095551809 0.9552121828034635 0.030575047096847708
|
60
|
+
0.15998103923791546 0.025800322855227358 0.7724622302949381 0.04175640761192835
|
61
|
+
0.07567637746682139 0.07301309983548783 0.8017072754923166 0.04960324720538194
|
62
|
+
0.14889978927270572 0.537437604468227 0.1876198530340185 0.1260427532250494
|
63
|
+
EOS
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
Fabricator(:KLF4_f2_plain_text, class_name: OpenStruct) do
|
68
|
+
name 'KLF4_f2'
|
69
|
+
|
70
|
+
pcm (<<-EOS).strip_doc
|
71
|
+
KLF4_f2
|
72
|
+
1233.46088405354 93.18173277811673 1036.6014857092885 1258.2948629970272
|
73
|
+
263.979242343185 5.314520555872139 3347.5949971525274 4.650205486388122
|
74
|
+
76.7700780003465 6.643150694840173 3529.4896409394937 8.636095903292224
|
75
|
+
57.86097393406657 18.102585643439472 3520.3342027139347 25.24120324653207
|
76
|
+
518.1947904009378 1545.9062946905135 22.396758181071043 1535.0411222654507
|
77
|
+
137.98151691820345 9.300410972776241 3456.320530770924 17.936506876068467
|
78
|
+
115.27647661640499 81.51802997128804 1861.9425868567278 1562.801872093553
|
79
|
+
227.8095486111286 42.84555258785854 3278.6396005325996 72.244263806387
|
80
|
+
108.73384179997886 134.47328134862394 3162.880454846513 215.45138754285665
|
81
|
+
238.49636899561344 2225.9561104691043 402.40727964384774 754.6792064294074
|
82
|
+
EOS
|
83
|
+
|
84
|
+
pwm (<<-EOS).strip_doc
|
85
|
+
KLF4_f2
|
86
|
+
0.30861857265872605 -2.254321000121579 0.13505703522674192 0.3285194224375633
|
87
|
+
-1.227018967707036 -4.814127713368663 1.3059890687390967 -4.908681463544344
|
88
|
+
-2.443469374521196 -4.648238485031404 1.3588686548279805 -4.441801801188402
|
89
|
+
-2.7177827948276123 -3.8073538975356565 1.356272809724262 -3.504104725510225
|
90
|
+
-0.5563232977367343 0.5340697765121405 -3.61417723090579 0.5270259776377405
|
91
|
+
-1.8687622060887386 -4.381483976582316 1.337932245336098 -3.815629658877517
|
92
|
+
-2.045671123823928 -2.384975142213679 0.7198551207724355 0.5449254135616948
|
93
|
+
-1.373157530374372 -3.0063112097748217 1.285188335493552 -2.5026044231773543
|
94
|
+
-2.1030513122772208 -1.8941348100402244 1.249265758393991 -1.4284210948906104
|
95
|
+
-1.3277128628152939 0.8982415633049462 -0.8080773665408135 -0.18161647647456935
|
96
|
+
EOS
|
97
|
+
|
98
|
+
pwm_by_ppm (<<-EOS).strip_doc
|
99
|
+
KLF4_f2
|
100
|
+
0.3092192421596327 -2.2738082797138253 0.13534285704681936 0.32915281813495917
|
101
|
+
-1.2324895093929382 -5.137917180091503 1.307637473739625 -5.271448572716026
|
102
|
+
-2.4675450270943275 -4.914773628777294 1.3605485798774357 -4.652409364309802
|
103
|
+
-2.7503168499566213 -3.9123052006620864 1.3579512260780577 -3.5798822732152016
|
104
|
+
-0.5580087671420197 0.5350056338953667 -3.699443757631887 0.5279524674519223
|
105
|
+
-1.8812402411482916 -4.578301392156081 1.3395998898354127 -3.9215218557670104
|
106
|
+
-2.0610265944380752 -2.4075357595386326 0.7210156412752609 0.5458755791300577
|
107
|
+
-1.3798500151830562 -3.0507581325511492 1.2868238774479581 -2.5283070518025443
|
108
|
+
-2.1194569041801143 -1.906994454335074 1.2508784457678146 -1.435624677710707
|
109
|
+
-1.3340058960845615 0.899581832910703 -0.8108952727718963 -0.18206721514971644
|
110
|
+
EOS
|
111
|
+
|
112
|
+
ppm (<<-EOS).strip_doc
|
113
|
+
KLF4_f2
|
114
|
+
0.3405902561841722 0.025729871655343288 0.28623231603288946 0.34744755612759504
|
115
|
+
0.07289145439416013 0.001467475735162407 0.9243570286024104 0.0012840412682671063
|
116
|
+
0.02119819190981491 0.0018343446689530088 0.9745828153515933 0.002384648069638911
|
117
|
+
0.015976902218825483 0.004998589222896949 0.9720547635170884 0.006969745041189289
|
118
|
+
0.14308690182046985 0.4268644654665126 0.006184320642189763 0.423864312070828
|
119
|
+
0.038100243634326486 0.0025680825365342118 0.9543789432229661 0.004952730606173124
|
120
|
+
0.03183079837421573 0.02250922349503941 0.5141302094426423 0.431529768688103
|
121
|
+
0.06290407221320286 0.011830758413914766 0.9053166710980188 0.019948498274864
|
122
|
+
0.030024208723052264 0.03713152961441303 0.8733525953866614 0.05949166627587335
|
123
|
+
0.06585497802594685 0.6146437002752069 0.11111499378388463 0.20838632791496178
|
124
|
+
EOS
|
125
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Fabricator(:pcm, class_name: Bioinform::PCM) do
|
2
|
+
initialize_with{ Bioinform::PCM.new(matrix: [[1, 2, 3, 1],[4, 0, 1, 2]], name: 'PCM_name') }
|
3
|
+
end
|
4
|
+
|
5
|
+
Fabricator(:pcm_with_floats, from: :pcm) do
|
6
|
+
matrix [[1, 2.3, 3.2, 1],[4.4, 0.1, 0.9, 2.1]]
|
7
|
+
end
|
8
|
+
|
9
|
+
Fabricator(:completely_different_pcm, from: :pcm) do
|
10
|
+
matrix [[101,207,138,248],[85,541,7,61]]
|
11
|
+
name 'PCM_another_name'
|
12
|
+
end
|
13
|
+
|
14
|
+
Fabricator(:pcm_1, from: :pcm) do
|
15
|
+
matrix [[7,10,2,3],[4,5,6,7]]
|
16
|
+
name 'motif_1'
|
17
|
+
end
|
18
|
+
Fabricator(:pcm_2, from: :pcm) do
|
19
|
+
matrix [[5,7,4,6],[11,6,2,3],[10,3,3,6]]
|
20
|
+
name 'motif_2'
|
21
|
+
end
|
22
|
+
Fabricator(:pcm_3, from: :pcm) do
|
23
|
+
matrix [[3,4,1,14],[9,2,9,2]]
|
24
|
+
name 'motif_3'
|
25
|
+
end
|