bioinform 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +17 -17
  3. data/Gemfile +16 -16
  4. data/LICENSE +21 -21
  5. data/README.md +35 -35
  6. data/Rakefile +4 -4
  7. data/TODO.txt +37 -37
  8. data/bin/merge_into_collection +3 -3
  9. data/bin/pcm2pwm +3 -3
  10. data/bin/split_motifs +3 -3
  11. data/bioinform.gemspec +19 -19
  12. data/lib/bioinform/cli/convert_motif.rb +107 -107
  13. data/lib/bioinform/cli/merge_into_collection.rb +79 -79
  14. data/lib/bioinform/cli/pcm2pwm.rb +46 -46
  15. data/lib/bioinform/cli/split_motifs.rb +46 -46
  16. data/lib/bioinform/cli.rb +29 -29
  17. data/lib/bioinform/conversion_algorithms/pcm2ppm_converter.rb +18 -18
  18. data/lib/bioinform/conversion_algorithms/pcm2pwm_converter.rb +19 -19
  19. data/lib/bioinform/data_models/collection.rb +74 -74
  20. data/lib/bioinform/data_models/motif.rb +55 -55
  21. data/lib/bioinform/data_models/pcm.rb +23 -23
  22. data/lib/bioinform/data_models/pm.rb +169 -169
  23. data/lib/bioinform/data_models/ppm.rb +9 -9
  24. data/lib/bioinform/data_models/pwm.rb +55 -55
  25. data/lib/bioinform/data_models.rb +10 -10
  26. data/lib/bioinform/formatters/raw_formatter.rb +40 -40
  27. data/lib/bioinform/formatters/transfac_formatter.rb +38 -38
  28. data/lib/bioinform/formatters.rb +1 -1
  29. data/lib/bioinform/parsers/jaspar_parser.rb +34 -34
  30. data/lib/bioinform/parsers/parser.rb +87 -87
  31. data/lib/bioinform/parsers/splittable_parser.rb +56 -56
  32. data/lib/bioinform/parsers/string_fantom_parser.rb +34 -34
  33. data/lib/bioinform/parsers/string_parser.rb +71 -71
  34. data/lib/bioinform/parsers/trivial_parser.rb +33 -33
  35. data/lib/bioinform/parsers/yaml_parser.rb +34 -34
  36. data/lib/bioinform/parsers.rb +6 -6
  37. data/lib/bioinform/support/array_product.rb +5 -5
  38. data/lib/bioinform/support/array_zip.rb +5 -5
  39. data/lib/bioinform/support/collect_hash.rb +6 -6
  40. data/lib/bioinform/support/deep_dup.rb +4 -4
  41. data/lib/bioinform/support/delete_many.rb +13 -13
  42. data/lib/bioinform/support/inverf.rb +12 -12
  43. data/lib/bioinform/support/multiline_squish.rb +5 -5
  44. data/lib/bioinform/support/parameters.rb +27 -27
  45. data/lib/bioinform/support/partial_sums.rb +15 -15
  46. data/lib/bioinform/support/same_by.rb +12 -12
  47. data/lib/bioinform/support/strip_doc.rb +8 -8
  48. data/lib/bioinform/support/third_part/active_support/hash_with_indifferent_access.rb +3 -0
  49. data/lib/bioinform/support.rb +17 -17
  50. data/lib/bioinform/version.rb +3 -3
  51. data/lib/bioinform.rb +10 -10
  52. data/spec/cli/cli_spec.rb +13 -13
  53. data/spec/cli/convert_motif_spec.rb +106 -106
  54. data/spec/cli/data/merge_into_collection/GABPA_f1.pwm +14 -14
  55. data/spec/cli/data/merge_into_collection/KLF4_f2.pwm +11 -11
  56. data/spec/cli/data/merge_into_collection/SP1_f1.pwm +12 -12
  57. data/spec/cli/data/merge_into_collection/collection.txt.result +40 -40
  58. data/spec/cli/data/merge_into_collection/collection.yaml.result +188 -188
  59. data/spec/cli/data/merge_into_collection/collection_pwm.yaml.result +188 -188
  60. data/spec/cli/data/merge_into_collection/pwm_folder/GABPA_f1.pwm +14 -14
  61. data/spec/cli/data/merge_into_collection/pwm_folder/KLF4_f2.pwm +11 -11
  62. data/spec/cli/data/merge_into_collection/pwm_folder/SP1_f1.pwm +12 -12
  63. data/spec/cli/data/pcm2pwm/KLF4 f2 spaced name.pcm +11 -11
  64. data/spec/cli/data/pcm2pwm/KLF4_f2.pcm +11 -11
  65. data/spec/cli/data/pcm2pwm/KLF4_f2.pwm.result +11 -11
  66. data/spec/cli/data/pcm2pwm/SP1_f1.pcm +12 -12
  67. data/spec/cli/data/pcm2pwm/SP1_f1.pwm.result +12 -12
  68. data/spec/cli/data/split_motifs/GABPA_f1.mat.result +14 -14
  69. data/spec/cli/data/split_motifs/KLF4_f2.mat.result +11 -11
  70. data/spec/cli/data/split_motifs/SP1_f1.mat.result +12 -12
  71. data/spec/cli/data/split_motifs/collection.yaml +188 -188
  72. data/spec/cli/data/split_motifs/plain_collection.txt +38 -38
  73. data/spec/cli/merge_into_collection_spec.rb +99 -99
  74. data/spec/cli/pcm2pwm_spec.rb +79 -79
  75. data/spec/cli/shared_examples/convert_motif/motif_list_empty.rb +17 -17
  76. data/spec/cli/shared_examples/convert_motif/several_motifs_specified.rb +14 -14
  77. data/spec/cli/shared_examples/convert_motif/single_motif_specified.rb +49 -49
  78. data/spec/cli/shared_examples/convert_motif/yield_help_string.rb +4 -4
  79. data/spec/cli/shared_examples/convert_motif/yield_motif_conversion_error.rb +3 -3
  80. data/spec/cli/split_motifs_spec.rb +76 -76
  81. data/spec/data_models/collection_spec.rb +97 -97
  82. data/spec/data_models/motif_spec.rb +223 -223
  83. data/spec/data_models/pcm_spec.rb +55 -55
  84. data/spec/data_models/pm_spec.rb +359 -359
  85. data/spec/data_models/ppm_spec.rb +7 -7
  86. data/spec/data_models/pwm_spec.rb +82 -82
  87. data/spec/fabricators/collection_fabricator.rb +7 -7
  88. data/spec/fabricators/motif_fabricator.rb +32 -32
  89. data/spec/fabricators/motif_formats_fabricator.rb +124 -124
  90. data/spec/fabricators/pcm_fabricator.rb +24 -24
  91. data/spec/fabricators/pm_fabricator.rb +51 -51
  92. data/spec/fabricators/ppm_fabricator.rb +13 -13
  93. data/spec/fabricators/pwm_fabricator.rb +16 -16
  94. data/spec/parsers/parser_spec.rb +152 -152
  95. data/spec/parsers/string_fantom_parser_spec.rb +69 -69
  96. data/spec/parsers/string_parser_spec.rb +76 -76
  97. data/spec/parsers/trivial_parser_spec.rb +63 -63
  98. data/spec/parsers/yaml_parser_spec.rb +50 -50
  99. data/spec/spec_helper.rb +10 -10
  100. data/spec/spec_helper_source.rb +59 -59
  101. data/spec/support/advanced_scan_spec.rb +31 -31
  102. data/spec/support/array_product_spec.rb +14 -14
  103. data/spec/support/array_zip_spec.rb +14 -14
  104. data/spec/support/collect_hash_spec.rb +14 -14
  105. data/spec/support/delete_many_spec.rb +43 -43
  106. data/spec/support/inverf_spec.rb +18 -18
  107. data/spec/support/multiline_squish_spec.rb +24 -24
  108. data/spec/support/partial_sums_spec.rb +30 -30
  109. data/spec/support/same_by_spec.rb +35 -35
  110. metadata +3 -3
@@ -1,8 +1,8 @@
1
- require_relative '../spec_helper'
2
- require_relative '../../lib/bioinform/data_models/pcm'
3
-
4
- module Bioinform
5
- describe PPM do
6
-
7
- end
1
+ require_relative '../spec_helper'
2
+ require_relative '../../lib/bioinform/data_models/pcm'
3
+
4
+ module Bioinform
5
+ describe PPM do
6
+
7
+ end
8
8
  end
@@ -1,83 +1,83 @@
1
- require_relative '../spec_helper'
2
- require_relative '../../lib/bioinform/data_models/pwm'
3
-
4
- module Bioinform
5
- describe PWM do
6
- describe '#score_mean' do
7
- it 'should be equal to a mean score of pwm' do
8
- pwm = PWM.new( [[1,2,1,2],[4,6,8,6],[2,2,2,2]] )
9
- pwm.score_mean.should == 1.5 + 6 + 2
10
- end
11
- it 'should be equal to a mean score of pwm by measure induced from background probability mean' do
12
- pwm = PWM.new( [[1,2,1,2],[4,6,8,6],[2,2,2,2]] ).set_parameters(background: [0.2, 0.3, 0.3, 0.2])
13
- pwm.score_mean.should == ((0.2*1+0.3*2+0.3*1+0.2*2) + (0.2*4+0.3*6+0.3*8+0.2*6) + (0.2*2+0.3*2+0.3*2+0.2*2)) / (0.2+0.3+0.3+0.2)
14
- end
15
- end
16
-
17
- describe '#score_variance' do
18
- end
19
-
20
- describe '#gauss_estimation' do
21
- end
22
-
23
- describe '#score' do
24
- let(:pwm) do
25
- PWM.new( [[10000,20000,30000,40000],[1000,2000,3000,4000],[100,200,300,400],[10,20,30,40],[1,2,3,4]] )
26
- end
27
- it 'should evaluate to score of given word' do
28
- pwm.score('aAAAA').should == 11111
29
- pwm.score('agata').should == 13141
30
- pwm.score('CCGCT').should == 22324
31
- end
32
- it 'should give score average score(considering probabilities) for a position for a N-letter' do
33
- pwm.score('AANAA').should == (11011 + 250)
34
- pwm.set_parameters(background: [0.1,0.4,0.1,0.4]).score('AANAA').should == (11011 + 0.1*100 + 0.4*200 + 0.1*300 + 0.4*400)
35
- end
36
- it 'should raise an ArgumentError if word contain bad letter' do
37
- expect{ pwm.score('AAAAV') }.to raise_error(ArgumentError)
38
- end
39
- it 'should raise an ArgumentError if word has size different than size of matrix' do
40
- expect{ pwm.score('AAA') }.to raise_error(ArgumentError)
41
- end
42
- end
43
-
44
- describe '#best_score' do
45
- it 'should be equal to best score' do
46
- @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]] )
47
- @pwm.best_score.should == 4.9 + 7.13 + (-1.0)
48
- end
49
- end
50
- describe '#worst_score' do
51
- it 'should be equal to worst score' do
52
- @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]] )
53
- @pwm.worst_score.should == 1.3 + 3.25 + (-1.5)
54
- end
55
- end
56
-
57
- describe '#best_suffix' do
58
- it 'should return maximal score of suffices from i-th position inclusively i.e. [i..end]' do
59
- @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]] )
60
- @pwm.best_suffix(0).should == (4.9 + 7.13 - 1.0)
61
- @pwm.best_suffix(1).should == (7.13 - 1.0)
62
- @pwm.best_suffix(2).should == (-1.0)
63
- @pwm.best_suffix(3).should == (0.0)
64
- end
65
- it 'should give right results after left(right)_augment, discrete, reverse_complement etc' do
66
- pwm = PWM.new([[1, 2, 3, 4], [10,10.5,11,11.5]])
67
- pwm.best_suffix(1).should == 11.5
68
- pwm.left_augment!(1)
69
- pwm.best_suffix(1).should == 15.5
70
- end
71
- end
72
- describe '#worst_suffix' do
73
- it 'should return minimal score of suffices from i-th position inclusively i.e. [i..end]' do
74
- @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]] )
75
- @pwm.worst_suffix(0).should == (1.3 + 3.25 - 1.5)
76
- @pwm.worst_suffix(1).should == (3.25 - 1.5)
77
- @pwm.worst_suffix(2).should == (- 1.5)
78
- @pwm.worst_suffix(3).should == (0.0)
79
- end
80
- end
81
-
82
- end
1
+ require_relative '../spec_helper'
2
+ require_relative '../../lib/bioinform/data_models/pwm'
3
+
4
+ module Bioinform
5
+ describe PWM do
6
+ describe '#score_mean' do
7
+ it 'should be equal to a mean score of pwm' do
8
+ pwm = PWM.new( [[1,2,1,2],[4,6,8,6],[2,2,2,2]] )
9
+ pwm.score_mean.should == 1.5 + 6 + 2
10
+ end
11
+ it 'should be equal to a mean score of pwm by measure induced from background probability mean' do
12
+ pwm = PWM.new( [[1,2,1,2],[4,6,8,6],[2,2,2,2]] ).set_parameters(background: [0.2, 0.3, 0.3, 0.2])
13
+ pwm.score_mean.should == ((0.2*1+0.3*2+0.3*1+0.2*2) + (0.2*4+0.3*6+0.3*8+0.2*6) + (0.2*2+0.3*2+0.3*2+0.2*2)) / (0.2+0.3+0.3+0.2)
14
+ end
15
+ end
16
+
17
+ describe '#score_variance' do
18
+ end
19
+
20
+ describe '#gauss_estimation' do
21
+ end
22
+
23
+ describe '#score' do
24
+ let(:pwm) do
25
+ PWM.new( [[10000,20000,30000,40000],[1000,2000,3000,4000],[100,200,300,400],[10,20,30,40],[1,2,3,4]] )
26
+ end
27
+ it 'should evaluate to score of given word' do
28
+ pwm.score('aAAAA').should == 11111
29
+ pwm.score('agata').should == 13141
30
+ pwm.score('CCGCT').should == 22324
31
+ end
32
+ it 'should give score average score(considering probabilities) for a position for a N-letter' do
33
+ pwm.score('AANAA').should == (11011 + 250)
34
+ pwm.set_parameters(background: [0.1,0.4,0.1,0.4]).score('AANAA').should == (11011 + 0.1*100 + 0.4*200 + 0.1*300 + 0.4*400)
35
+ end
36
+ it 'should raise an ArgumentError if word contain bad letter' do
37
+ expect{ pwm.score('AAAAV') }.to raise_error(ArgumentError)
38
+ end
39
+ it 'should raise an ArgumentError if word has size different than size of matrix' do
40
+ expect{ pwm.score('AAA') }.to raise_error(ArgumentError)
41
+ end
42
+ end
43
+
44
+ describe '#best_score' do
45
+ it 'should be equal to best score' do
46
+ @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]] )
47
+ @pwm.best_score.should == 4.9 + 7.13 + (-1.0)
48
+ end
49
+ end
50
+ describe '#worst_score' do
51
+ it 'should be equal to worst score' do
52
+ @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]] )
53
+ @pwm.worst_score.should == 1.3 + 3.25 + (-1.5)
54
+ end
55
+ end
56
+
57
+ describe '#best_suffix' do
58
+ it 'should return maximal score of suffices from i-th position inclusively i.e. [i..end]' do
59
+ @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]] )
60
+ @pwm.best_suffix(0).should == (4.9 + 7.13 - 1.0)
61
+ @pwm.best_suffix(1).should == (7.13 - 1.0)
62
+ @pwm.best_suffix(2).should == (-1.0)
63
+ @pwm.best_suffix(3).should == (0.0)
64
+ end
65
+ it 'should give right results after left(right)_augment, discrete, reverse_complement etc' do
66
+ pwm = PWM.new([[1, 2, 3, 4], [10,10.5,11,11.5]])
67
+ pwm.best_suffix(1).should == 11.5
68
+ pwm.left_augment!(1)
69
+ pwm.best_suffix(1).should == 15.5
70
+ end
71
+ end
72
+ describe '#worst_suffix' do
73
+ it 'should return minimal score of suffices from i-th position inclusively i.e. [i..end]' do
74
+ @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]] )
75
+ @pwm.worst_suffix(0).should == (1.3 + 3.25 - 1.5)
76
+ @pwm.worst_suffix(1).should == (3.25 - 1.5)
77
+ @pwm.worst_suffix(2).should == (- 1.5)
78
+ @pwm.worst_suffix(3).should == (0.0)
79
+ end
80
+ end
81
+
82
+ end
83
83
  end
@@ -1,8 +1,8 @@
1
- Fabricator(:three_elements_collection, class_name: Bioinform::Collection, aliases: [:pm_collection]) do
2
- name 'PM_collection'
3
- after_build{|collection| collection << Fabricate(:pm_1) << Fabricate(:pm_2) << Fabricate(:pm_3) }
4
- end
5
-
6
- Fabricator(:unnamed_pm_collection, from: :pm_collection) do
7
- name nil
1
+ Fabricator(:three_elements_collection, class_name: Bioinform::Collection, aliases: [:pm_collection]) do
2
+ name 'PM_collection'
3
+ after_build{|collection| collection << Fabricate(:pm_1) << Fabricate(:pm_2) << Fabricate(:pm_3) }
4
+ end
5
+
6
+ Fabricator(:unnamed_pm_collection, from: :pm_collection) do
7
+ name nil
8
8
  end
@@ -1,33 +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)
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
33
  end
@@ -1,125 +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
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
125
  end
@@ -1,25 +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'
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
25
  end