bio-incanter 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/Gemfile +14 -0
  2. data/Gemfile.lock +35 -0
  3. data/LICENSE.txt +20 -0
  4. data/README.rdoc +26 -0
  5. data/Rakefile +51 -0
  6. data/VERSION +1 -0
  7. data/bio-incanter.gemspec +136 -0
  8. data/doc/AreaChart.html +473 -0
  9. data/doc/BarChart.html +519 -0
  10. data/doc/BlandAltman.html +453 -0
  11. data/doc/BoxPlot.html +474 -0
  12. data/doc/FunctionPlot.html +496 -0
  13. data/doc/HeatMap.html +554 -0
  14. data/doc/Histogram.html +444 -0
  15. data/doc/LICENSE_txt.html +130 -0
  16. data/doc/LineChart.html +479 -0
  17. data/doc/Object.html +278 -0
  18. data/doc/PieChart.html +455 -0
  19. data/doc/README_rdoc.html +152 -0
  20. data/doc/ScatterPlot.html +489 -0
  21. data/doc/TimeChart.html +473 -0
  22. data/doc/TracePlot.html +416 -0
  23. data/doc/XyPlot.html +477 -0
  24. data/doc/created.rid +18 -0
  25. data/doc/images/add.png +0 -0
  26. data/doc/images/brick.png +0 -0
  27. data/doc/images/brick_link.png +0 -0
  28. data/doc/images/bug.png +0 -0
  29. data/doc/images/bullet_black.png +0 -0
  30. data/doc/images/bullet_toggle_minus.png +0 -0
  31. data/doc/images/bullet_toggle_plus.png +0 -0
  32. data/doc/images/date.png +0 -0
  33. data/doc/images/delete.png +0 -0
  34. data/doc/images/find.png +0 -0
  35. data/doc/images/loadingAnimation.gif +0 -0
  36. data/doc/images/macFFBgHack.png +0 -0
  37. data/doc/images/package.png +0 -0
  38. data/doc/images/page_green.png +0 -0
  39. data/doc/images/page_white_text.png +0 -0
  40. data/doc/images/page_white_width.png +0 -0
  41. data/doc/images/plugin.png +0 -0
  42. data/doc/images/ruby.png +0 -0
  43. data/doc/images/tag_blue.png +0 -0
  44. data/doc/images/tag_green.png +0 -0
  45. data/doc/images/transparent.png +0 -0
  46. data/doc/images/wrench.png +0 -0
  47. data/doc/images/wrench_orange.png +0 -0
  48. data/doc/images/zoom.png +0 -0
  49. data/doc/index.html +106 -0
  50. data/doc/js/darkfish.js +153 -0
  51. data/doc/js/jquery.js +18 -0
  52. data/doc/js/navigation.js +142 -0
  53. data/doc/js/search.js +94 -0
  54. data/doc/js/search_index.js +1 -0
  55. data/doc/js/searcher.js +228 -0
  56. data/doc/rdoc.css +543 -0
  57. data/doc/table_of_contents.html +295 -0
  58. data/lib/area_chart/area_chart.rb +106 -0
  59. data/lib/bar_chart/bar_chart.rb +142 -0
  60. data/lib/bio-incanter.rb +108 -0
  61. data/lib/bland_altman/bland_altman.rb +120 -0
  62. data/lib/box_plot/box_plot.rb +136 -0
  63. data/lib/function_plot/function_plot.rb +137 -0
  64. data/lib/histogram/histogram.rb +139 -0
  65. data/lib/java/clocomics-1.0.0-standalone.jar +0 -0
  66. data/lib/line_chart/line_chart.rb +148 -0
  67. data/lib/pie_chart/pie_chart.rb +121 -0
  68. data/lib/qq_plot/qq_plot.rb +105 -0
  69. data/lib/scatter_plot/scatter_plot.rb +162 -0
  70. data/lib/time_chart/time_chart.rb +142 -0
  71. data/lib/trace_plot/trace_plot.rb +108 -0
  72. data/lib/xy_plot/xy_plot.rb +149 -0
  73. data/spec/bar_chart_spec.rb +25 -0
  74. data/spec/bland_altman_spec.rb +26 -0
  75. data/spec/box_plot_spec.rb +25 -0
  76. data/spec/function_plot_spec.rb +27 -0
  77. data/spec/histogram_spec.rb +24 -0
  78. data/spec/line_chart_spec.rb +25 -0
  79. data/spec/pie_chart_spec.rb +25 -0
  80. data/spec/qq_plot_spec.rb +24 -0
  81. data/spec/scatter_plot_spec.rb +26 -0
  82. data/spec/spec_helper.rb +13 -0
  83. data/spec/time_chart_spec.rb +26 -0
  84. data/spec/trace_plot_spec.rb +24 -0
  85. data/spec/xy_plot_spec.rb +25 -0
  86. metadata +196 -0
@@ -0,0 +1,139 @@
1
+ class Histogram
2
+ # ==== Attributes
3
+ #
4
+ # * +value+ - a vector of Float numeric value
5
+ # * +parms+ - an Hash whit parametrs value
6
+ #
7
+ # ==== Parms
8
+ #
9
+ # This Hash contain parmas .
10
+ # List of key permitted .
11
+ #
12
+ #
13
+ #
14
+ # * +:title+ - (default "A sample Graph") Graph main title
15
+ # * +:x_label+ - (default 'Categories') Label of x ass
16
+ # * +:y_label+ - (default 'Value') Label of y ass
17
+ # * +:legend+ - (default false) Prints legend
18
+ # * +:vertical+ - (default true) The orientation of the plot
19
+ # * +:n_bins+ - (default 10) number of bins
20
+ # * +:height+ - (default 1500) Graph height
21
+ # * +:width+ - (default 800) Graph width
22
+ # * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
23
+ #
24
+ # ==== Examples
25
+ #
26
+ # Class Usage:
27
+ #
28
+ # values = [1.0,2.0,3.0]
29
+ # params = {}
30
+ # plot = BarChart.new(values,params)
31
+ # #To view
32
+ # plot.view
33
+ # #to save
34
+ # plot.save
35
+
36
+ def initialize(value,params)
37
+ @value=check_val(value)
38
+ @params=self.check_par(params)
39
+ end
40
+
41
+ def check_par(params)
42
+ hash = Hash.new
43
+ permitted = ["title","x_label","y_label","vertical","n_bins","density","legend","width","height","file_name"]
44
+ keys = params.keys
45
+ keys.each{ |key|
46
+ if permitted.include?(key)==false
47
+ raise "Error : Permitted key are title,x_label,y_label,vertical,n_bins,density,legend,width,height"
48
+ end
49
+ }
50
+
51
+ if params["title"]==nil
52
+ hash["title"]="A sample Graph"
53
+ else
54
+ hash["title"]=params["title"]
55
+ end
56
+
57
+ if params["x_label"]==nil
58
+ hash["x_label"]="Categories"
59
+ else
60
+ hash["x_label"]=params["x_label"]
61
+ end
62
+
63
+ if params["y_label"]==nil
64
+ hash["y_label"]="Values"
65
+ else
66
+ hash["y_label"]=params["y_label"]
67
+ end
68
+
69
+ if params["vertical"]==nil
70
+ hash["vertical"]=true
71
+ else
72
+ hash["vertical"]=params["vertical"]
73
+ end
74
+
75
+ if params["legend"]==nil
76
+ hash["legend"]=false
77
+ else
78
+ hash["legend"]=params["legend"]
79
+ end
80
+
81
+ if params["n_bins"]==nil
82
+ hash["n_bins"]=10
83
+ else
84
+ hash["n_bins"]=params["n_bins"]
85
+ end
86
+
87
+ if params["density"]==nil
88
+ hash["density"]=false
89
+ else
90
+ hash["density"]=params["density"]
91
+ end
92
+
93
+ if params["width"]==nil
94
+ hash["width"]=1500
95
+ else
96
+ hash["width"]=params["width"]
97
+ end
98
+
99
+ if params["height"]==nil
100
+ hash["height"]=800
101
+ else
102
+ hash["height"]=params["height"]
103
+ end
104
+
105
+ if params["file_name"]==nil
106
+ hash["file_name"]="sample.jpg"
107
+ else
108
+ hash["file_name"]=params["file_name"]
109
+ end
110
+
111
+ params_map = HashMap.new(hash)
112
+ return params_map
113
+ end
114
+
115
+ def getValue
116
+ @value
117
+ end
118
+
119
+ def getParams
120
+ @params
121
+ end
122
+
123
+
124
+ def save
125
+ begin
126
+ a = Java::ComDomain::clocomics
127
+ a.save_histo(self.getValue,self.getParams)
128
+ rescue Exception => ex
129
+ end
130
+ end
131
+ def view
132
+ begin
133
+ a = Java::ComDomain::clocomics
134
+ a.view_histo(self.getValue,self.getParams)
135
+ rescue Exception => ex
136
+ end
137
+ end
138
+
139
+ end
@@ -0,0 +1,148 @@
1
+ class LineChart
2
+ # ==== Attributes
3
+ #
4
+ # * +group+ - a vector of String categories
5
+ # * +value+ - a vector of Float numeric value
6
+ # * +parms+ - an Hash whit parametrs value
7
+ #
8
+ # ==== Parms
9
+ #
10
+ # This Hash contain parmas .
11
+ # List of key permitted .
12
+ #
13
+ #
14
+ #
15
+ # * +:title+ - (default "A sample Graph") Graph main title
16
+ # * +:x_label+ - (default 'Categories') Label of x ass
17
+ # * +:y_label+ - (default 'Value') Label of y ass
18
+ # * +:legend+ - (default false) Prints legend
19
+ # * +:vertical+ - (default true) The orientation of the plot
20
+ # * +:group_by+ - (default nil) A vector of values used to group the values into series within each category.
21
+ # * +:gradient + - (default false) Use gradient on bars
22
+ # * +:height+ - (default 1500) Graph height
23
+ # * +:width+ - (default 800) Graph width
24
+ # * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
25
+ #
26
+ # ==== Examples
27
+ #
28
+ # Class Usage:
29
+ #
30
+ # categories = ["uman","elf","dwarfs"]
31
+ # values = [1.0,2.0,3.0]
32
+ # params = {"title" => "Popolation of middle heart","x_label"=>"Popolation","y_label"=>"greed"}
33
+ # plot = LineChart.new(categories,values,params)
34
+ # #To view
35
+ # plot.view
36
+ # #to save
37
+ # plot.save
38
+ def initialize(group,value,params)
39
+ @group=check_grp(group)
40
+ @value=check_val(value)
41
+ @params=self.check_par(params)
42
+ end
43
+
44
+ def check_par(params)
45
+ hash = Hash.new
46
+ permitted = ["title","x_label","y_label","vertical","group_by","gradient","legend","width","height","file_name"]
47
+ keys = params.keys
48
+ keys.each{ |key|
49
+ if permitted.include?(key)==false
50
+ raise "Error : Permitted key are title,x_label,y_label,vertical,group_by,gradient,legend,width,height"
51
+ end
52
+ }
53
+
54
+ if params["title"]==nil
55
+ hash["title"]="A sample Graph"
56
+ else
57
+ hash["title"]=params["title"]
58
+ end
59
+
60
+ if params["x_label"]==nil
61
+ hash["x_label"]="Categories"
62
+ else
63
+ hash["x_label"]=params["x_label"]
64
+ end
65
+
66
+ if params["y_label"]==nil
67
+ hash["y_label"]="Values"
68
+ else
69
+ hash["y_label"]=params["y_label"]
70
+ end
71
+
72
+ if params["vertical"]==nil
73
+ hash["vertical"]=true
74
+ else
75
+ hash["vertical"]=params["vertical"]
76
+ end
77
+
78
+ if params["legend"]==nil
79
+ hash["legend"]=false
80
+ else
81
+ hash["legend"]=params["legend"]
82
+ end
83
+
84
+ if params["gruop_by"]==nil
85
+ hash["group_by"]=nil
86
+ else
87
+ hash["group_by"]=params["group_by"]
88
+ end
89
+
90
+ if params["gradient"]==nil
91
+ hash["gradient"]=false
92
+ else
93
+ hash["gradient"]=params["gradient"]
94
+ end
95
+
96
+ if params["width"]==nil
97
+ hash["width"]=1500
98
+ else
99
+ hash["width"]=params["width"]
100
+ end
101
+
102
+ if params["height"]==nil
103
+ hash["height"]=800
104
+ else
105
+ hash["height"]=params["height"]
106
+ end
107
+
108
+ if params["file_name"]==nil
109
+ hash["file_name"]="sample.jpg"
110
+ else
111
+ hash["file_name"]=params["file_name"]
112
+ end
113
+
114
+ params_map = HashMap.new(hash)
115
+ return params_map
116
+ end
117
+
118
+ def getGroup
119
+ @group
120
+ end
121
+
122
+ def getValue
123
+ @value
124
+ end
125
+
126
+ def getParams
127
+ @params
128
+ end
129
+
130
+
131
+ def save
132
+ begin
133
+ a = Java::ComDomain::clocomics
134
+ a.save_area(self.getGroup,self.getValue,self.getParams)
135
+ rescue Exception => ex
136
+ end
137
+ end
138
+ def view
139
+ begin
140
+ a = Java::ComDomain::clocomics
141
+ a.view_area(self.getGroup,self.getValue,self.getParams)
142
+ rescue Exception => ex
143
+ end
144
+
145
+
146
+ end
147
+
148
+ end
@@ -0,0 +1,121 @@
1
+ class PieChart
2
+ # ==== Attributes
3
+ #
4
+ # * +group+ - a vector of String categories
5
+ # * +value+ - a vector of Float numeric value
6
+ # * +parms+ - an Hash whit parametrs value
7
+ #
8
+ # ==== Parms
9
+ #
10
+ # This Hash contain parmas .
11
+ # List of key permitted .
12
+ #
13
+ #
14
+ #
15
+ # * +:title+ - (default "A sample Graph") Graph main title
16
+ # * +:legend+ - (default false) Prints legend
17
+ # * +:vertical+ - (default true) The orientation of the plot
18
+ # * +:height+ - (default 1500) Graph height
19
+ # * +:width+ - (default 800) Graph width
20
+ # * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
21
+ #
22
+ # ==== Examples
23
+ #
24
+ # Class Usage:
25
+ #
26
+ # categories = ["uman","elf","dwarfs"]
27
+ # values = [1.0,2.0,3.0]
28
+ # params = {"title" => "Popolation of middle heart","x_label"=>"Popolation","y_label"=>"greed"}
29
+ # plot = PieChart.new(categories,values,params)
30
+ # #To view
31
+ # plot.view
32
+ # #to save
33
+ # plot.save
34
+
35
+ def initialize(group,value,params)
36
+ @group=check_grp(group)
37
+ @value=check_val(value)
38
+ @params=self.check_par(params)
39
+ end
40
+
41
+ def check_par(params)
42
+ hash = Hash.new
43
+ permitted = ["title","vertical","legend","width","height","file_name"]
44
+ keys = params.keys
45
+ keys.each{ |key|
46
+ if permitted.include?(key)==false
47
+ raise "Error : Permitted key are title,vertical,legend,width,height"
48
+ end
49
+ }
50
+
51
+ if params["title"]==nil
52
+ hash["title"]="A sample Graph"
53
+ else
54
+ hash["title"]=params["title"]
55
+ end
56
+
57
+ if params["vertical"]==nil
58
+ hash["vertical"]=false
59
+ else
60
+ hash["vertical"]=params["vertical"]
61
+ end
62
+
63
+ if params["legend"]==nil
64
+ hash["legend"]=false
65
+ else
66
+ hash["legend"]=params["legend"]
67
+ end
68
+
69
+ if params["width"]==nil
70
+ hash["width"]=1500
71
+ else
72
+ hash["width"]=params["width"]
73
+ end
74
+
75
+ if params["height"]==nil
76
+ hash["height"]=800
77
+ else
78
+ hash["height"]=params["height"]
79
+ end
80
+
81
+ if params["file_name"]==nil
82
+ hash["file_name"]="sample.jpg"
83
+ else
84
+ hash["file_name"]=params["file_name"]
85
+ end
86
+
87
+ params_map = HashMap.new(hash)
88
+ return params_map
89
+ end
90
+
91
+ def getGroup
92
+ @group
93
+ end
94
+
95
+ def getValue
96
+ @value
97
+ end
98
+
99
+ def getParams
100
+ @params
101
+ end
102
+
103
+
104
+ def save
105
+ begin
106
+ a = Java::ComDomain::clocomics
107
+ a.save_pie(self.getGroup,self.getValue,self.getParams)
108
+ rescue Exception => ex
109
+ end
110
+ end
111
+ def view
112
+ begin
113
+ a = Java::ComDomain::clocomics
114
+ a.view_pie(self.getGroup,self.getValue,self.getParams)
115
+ rescue Exception => ex
116
+ end
117
+
118
+
119
+ end
120
+
121
+ end
@@ -0,0 +1,105 @@
1
+ class QqPlot
2
+ # ==== Attributes
3
+ #
4
+ # * +value+ - a vector of Float numeric value
5
+ # * +parms+ - an Hash whit parametrs value
6
+ #
7
+ # ==== Parms
8
+ #
9
+ # This Hash contain parmas .
10
+ # List of key permitted .
11
+ #
12
+ #
13
+ # * +:title+ - (default "A sample Graph") Graph main title
14
+ # * +:vertical+ - (default true) The orientation of the plot
15
+ # * +:height+ - (default 1500) Graph height
16
+ # * +:width+ - (default 800) Graph width
17
+ # * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
18
+ #
19
+ # ==== Examples
20
+ #
21
+ # Class Usage:
22
+ #
23
+ # values = [1.0,2.0,3.0]
24
+ # params = {"title" => "A QQ Plot"}
25
+ # plot = QqPlot.new(values,params)
26
+ # #To view
27
+ # plot.view
28
+ # #to save
29
+
30
+ def initialize(value,params)
31
+ @value=check_val(value)
32
+ @params=self.check_par(params)
33
+ end
34
+
35
+ def check_par(params)
36
+ hash = Hash.new
37
+ permitted = ["title","vertical","width","height","file_name"]
38
+ keys = params.keys
39
+ keys.each{ |key|
40
+ if permitted.include?(key)==false
41
+ raise "Error : Permitted key are title,vertical,width,height,file-name"
42
+ end
43
+ }
44
+
45
+ if params["title"]==nil
46
+ hash["title"]="A sample Graph"
47
+ else
48
+ hash["title"]=params["title"]
49
+ end
50
+
51
+ if params["vertical"]==nil
52
+ hash["vertical"]=true
53
+ else
54
+ hash["vertical"]=params["vertical"]
55
+ end
56
+
57
+ if params["width"]==nil
58
+ hash["width"]=1500
59
+ else
60
+ hash["width"]=params["width"]
61
+ end
62
+
63
+ if params["height"]==nil
64
+ hash["height"]=800
65
+ else
66
+ hash["height"]=params["height"]
67
+ end
68
+
69
+ if params["file_name"]==nil
70
+ hash["file_name"]="sample.jpg"
71
+ else
72
+ hash["file_name"]=params["file_name"]
73
+ end
74
+
75
+ params_map = HashMap.new(hash)
76
+ return params_map
77
+ end
78
+
79
+ def getValue
80
+ @value
81
+ end
82
+
83
+ def getParams
84
+ @params
85
+ end
86
+
87
+
88
+ def save
89
+ begin
90
+ a = Java::ComDomain::clocomics
91
+ a.save_qq(self.getValue,self.getParams)
92
+ rescue Exception => ex
93
+ end
94
+ end
95
+ def view
96
+ begin
97
+ a = Java::ComDomain::clocomics
98
+ a.view_qq(self.getValue,self.getParams)
99
+ rescue Exception => ex
100
+ end
101
+
102
+
103
+ end
104
+
105
+ end