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,162 @@
1
+ class ScatterPlot
2
+ # ==== Attributes
3
+ #
4
+ # * +valuex+ - a vector of Float numeric value
5
+ # * +valuey+ - 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
+ # * +: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
+ # * +:group_by+ - (default nil) A vector of values used to group the values into series within each category.
20
+ # * +:density+ - (default false) Chart will represent density instead of frequency
21
+ # * +:nbins+ - (default 10) Number of bins
22
+ # * +:gradient+ - (default false) Use gradient on bars
23
+ # * +:height+ - (default 1500) Chart height
24
+ # * +:width+ - (default 800) Chart width
25
+ # * +:file_name+ - (default sample.jpg) Chart File Name/Path to save plot. You can chose jpg or pdf
26
+ #
27
+ # ==== Examples
28
+ #
29
+ # Class Usage:
30
+ #
31
+ # valuesx = [1.0,2.0,3.0]
32
+ # valuesy = [1.0,2.0,3.0]
33
+ # params = {}
34
+ # plot = ScatterPlot.new(valuesx,valuesy,params)
35
+ # #To view
36
+ # plot.view
37
+ # #to save
38
+ # plot.save
39
+
40
+
41
+ def initialize(valuex,valuey,params)
42
+ @value_x=check_val(valuex)
43
+ @value_y=check_val(valuey)
44
+ @params=self.check_par(params)
45
+ end
46
+
47
+ def check_par(params)
48
+ hash = Hash.new
49
+ permitted = ["title","x_label","y_label","vertical","n_bins","density","gruop_by","gradient","legend","width","height","file_name"]
50
+ keys = params.keys
51
+ keys.each{ |key|
52
+ if permitted.include?(key)==false
53
+ raise "Error : Permitted key are title,x_label,y_label,vertical,n_bins,density,group_by,gardient,legend,width,height"
54
+ end
55
+ }
56
+
57
+ if params["title"]==nil
58
+ hash["title"]="A sample Graph"
59
+ else
60
+ hash["title"]=params["title"]
61
+ end
62
+
63
+ if params["x_label"]==nil
64
+ hash["x_label"]="Categories"
65
+ else
66
+ hash["x_label"]=params["x_label"]
67
+ end
68
+
69
+ if params["y_label"]==nil
70
+ hash["y_label"]="Values"
71
+ else
72
+ hash["y_label"]=params["y_label"]
73
+ end
74
+
75
+ if params["vertical"]==nil
76
+ hash["vertical"]=true
77
+ else
78
+ hash["vertical"]=params["vertical"]
79
+ end
80
+
81
+ if params["legend"]==nil
82
+ hash["legend"]=false
83
+ else
84
+ hash["legend"]=params["legend"]
85
+ end
86
+
87
+ if params["n_bins"]==nil
88
+ hash["n_bins"]=10
89
+ else
90
+ hash["n_bins"]=params["n_bins"]
91
+ end
92
+
93
+ if params["density"]==nil
94
+ hash["density"]=false
95
+ else
96
+ hash["density"]=params["density"]
97
+ end
98
+
99
+ if params["group_by"]==nil
100
+ hash["group_by"]=nil
101
+ else
102
+ hash["group_by"]=params["group_by"]
103
+ end
104
+
105
+ if params["gradient"]==nil
106
+ hash["gradient"]=false
107
+ else
108
+ hash["gradient"]=params["gradient"]
109
+ end
110
+
111
+ if params["width"]==nil
112
+ hash["width"]=1500
113
+ else
114
+ hash["width"]=params["width"]
115
+ end
116
+
117
+ if params["height"]==nil
118
+ hash["height"]=800
119
+ else
120
+ hash["height"]=params["height"]
121
+ end
122
+
123
+ if params["file_name"]==nil
124
+ hash["file_name"]="sample.jpg"
125
+ else
126
+ hash["file_name"]=params["file_name"]
127
+ end
128
+
129
+ params_map = HashMap.new(hash)
130
+ return params_map
131
+ end
132
+
133
+ def getValuex
134
+ @value_x
135
+ end
136
+
137
+ def getValuey
138
+ @value_y
139
+ end
140
+
141
+
142
+ def getParams
143
+ @params
144
+ end
145
+
146
+
147
+ def save
148
+ begin
149
+ a = Java::ComDomain::clocomics
150
+ a.save_scatter(self.getValuex,self.getValuey,self.getParams)
151
+ rescue Exception => ex
152
+ end
153
+ end
154
+ def view
155
+ begin
156
+ a = Java::ComDomain::clocomics
157
+ a.view_scatter(self.getValuex,self.getValuey,self.getParams)
158
+ rescue Exception => ex
159
+ end
160
+ end
161
+
162
+ end
@@ -0,0 +1,142 @@
1
+ class TimeChart
2
+ # ==== Attributes
3
+ #
4
+ # * +x+ - a vector of Int Sequence passed in for the x axis should be number of milliseconds from the epoch (1 Janurary 1970).
5
+ # * +y+ - 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
+ # * +:height+ - (default 1500) Graph height
22
+ # * +:width+ - (default 800) Graph width
23
+ # * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
24
+ #
25
+ # ==== Examples
26
+ #
27
+ # Class Usage:
28
+ #
29
+ # time = [1200,23330]
30
+ # values = [1.0,2.0]
31
+ # params = {"title" => "Time Go On"}
32
+ # plot = TimeChart.new(time,values,params)
33
+ # #To view
34
+ # plot.view
35
+ # #to save
36
+ # plot.save
37
+
38
+ def initialize(x,y,params)
39
+ @y=check_val(y)
40
+ @x=check_val_int(x)
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","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,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["width"]==nil
91
+ hash["width"]=1500
92
+ else
93
+ hash["width"]=params["width"]
94
+ end
95
+
96
+ if params["height"]==nil
97
+ hash["height"]=800
98
+ else
99
+ hash["height"]=params["height"]
100
+ end
101
+
102
+ if params["file_name"]==nil
103
+ hash["file_name"]="sample.jpg"
104
+ else
105
+ hash["file_name"]=params["file_name"]
106
+ end
107
+
108
+ params_map = HashMap.new(hash)
109
+ return params_map
110
+ end
111
+
112
+ def getX
113
+ @x
114
+ end
115
+
116
+ def getY
117
+ @y
118
+ end
119
+
120
+ def getParams
121
+ @params
122
+ end
123
+
124
+
125
+ def save
126
+ begin
127
+ a = Java::ComDomain::clocomics
128
+ a.save_time(self.getX,self.getY,self.getParams)
129
+ rescue Exception => ex
130
+ end
131
+ end
132
+ def view
133
+ begin
134
+ a = Java::ComDomain::clocomics
135
+ a.view_time(self.getX,self.getY,self.getParams)
136
+ rescue Exception => ex
137
+ end
138
+
139
+
140
+ end
141
+
142
+ end
@@ -0,0 +1,108 @@
1
+ class TracePlot
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
+ # * +:vertical+ - (default true) The orientation of the plot
16
+ # * +:height+ - (default 1500) Graph height
17
+ # * +:width+ - (default 800) Graph width
18
+ # * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
19
+ #
20
+ # ==== Examples
21
+ #
22
+ # Class Usage:
23
+ #
24
+ # values = [1.0,2.0,3.0]
25
+ # params = {}
26
+ # plot = TracePlot.new(categories,values,params)
27
+ # #To view
28
+ # plot.view
29
+ # #to save
30
+ # plot.save
31
+
32
+
33
+ def initialize(value,params)
34
+ @value=check_val(value)
35
+ @params=self.check_par(params)
36
+ end
37
+
38
+ def check_par(params)
39
+ hash = Hash.new
40
+ permitted = ["title","vertical","width","height","file_name"]
41
+ keys = params.keys
42
+ keys.each{ |key|
43
+ if permitted.include?(key)==false
44
+ raise "Error : Permitted key are title,vertical,width,height,file-name"
45
+ end
46
+ }
47
+
48
+ if params["title"]==nil
49
+ hash["title"]="A sample Graph"
50
+ else
51
+ hash["title"]=params["title"]
52
+ end
53
+
54
+ if params["vertical"]==nil
55
+ hash["vertical"]=true
56
+ else
57
+ hash["vertical"]=params["vertical"]
58
+ end
59
+
60
+ if params["width"]==nil
61
+ hash["width"]=1500
62
+ else
63
+ hash["width"]=params["width"]
64
+ end
65
+
66
+ if params["height"]==nil
67
+ hash["height"]=800
68
+ else
69
+ hash["height"]=params["height"]
70
+ end
71
+
72
+ if params["file_name"]==nil
73
+ hash["file_name"]="sample.jpg"
74
+ else
75
+ hash["file_name"]=params["file_name"]
76
+ end
77
+
78
+ params_map = HashMap.new(hash)
79
+ return params_map
80
+ end
81
+
82
+ def getValue
83
+ @value
84
+ end
85
+
86
+ def getParams
87
+ @params
88
+ end
89
+
90
+
91
+ def save
92
+ begin
93
+ a = Java::ComDomain::clocomics
94
+ a.save_trace(self.getValue,self.getParams)
95
+ rescue Exception => ex
96
+ end
97
+ end
98
+ def view
99
+ begin
100
+ a = Java::ComDomain::clocomics
101
+ a.view_trace(self.getValue,self.getParams)
102
+ rescue Exception => ex
103
+ end
104
+
105
+
106
+ end
107
+
108
+ end
@@ -0,0 +1,149 @@
1
+ class XyPlot
2
+ # ==== Attributes
3
+ #
4
+ # * +valuex+ - a vector of Float numeric value
5
+ # * +valuey+ - 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
+ # * +:points+ - (default false) includes point-markers
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
+ # x = [1.0,2.0,3.0]
31
+ # y = [1.0,2.0,3.0]
32
+ # params = {"title" => "XY Plot","points"=>"true"}
33
+ # plot = XyPlot.new(x,y,params)
34
+ # #To view
35
+ # plot.view
36
+ # #to save
37
+ # plot.save
38
+
39
+
40
+ def initialize(valuex,valuey,params)
41
+ @value_x=check_val(valuex)
42
+ @value_y=check_val(valuey)
43
+ @params=self.check_par(params)
44
+ end
45
+
46
+ def check_par(params)
47
+ hash = Hash.new
48
+ permitted = ["title","x_label","y_label","vertical","points","gruop_by","legend","width","height","file_name"]
49
+ keys = params.keys
50
+ keys.each{ |key|
51
+ if permitted.include?(key)==false
52
+ raise "Error : Permitted key are title,x_label,y_label,vertical,n_bins,density,group_by,gardient,legend,width,height"
53
+ end
54
+ }
55
+
56
+ if params["title"]==nil
57
+ hash["title"]="A sample Graph"
58
+ else
59
+ hash["title"]=params["title"]
60
+ end
61
+
62
+ if params["x_label"]==nil
63
+ hash["x_label"]="Categories"
64
+ else
65
+ hash["x_label"]=params["x_label"]
66
+ end
67
+
68
+ if params["y_label"]==nil
69
+ hash["y_label"]="Values"
70
+ else
71
+ hash["y_label"]=params["y_label"]
72
+ end
73
+
74
+ if params["vertical"]==nil
75
+ hash["vertical"]=true
76
+ else
77
+ hash["vertical"]=params["vertical"]
78
+ end
79
+
80
+ if params["legend"]==nil
81
+ hash["legend"]=false
82
+ else
83
+ hash["legend"]=params["legend"]
84
+ end
85
+
86
+ if params["points"]==nil
87
+ hash["points"]=false
88
+ else
89
+ hash["points"]=params["points"]
90
+ end
91
+
92
+ if params["group_by"]==nil
93
+ hash["group_by"]=nil
94
+ else
95
+ hash["group_by"]=params["group_by"]
96
+ end
97
+
98
+ if params["width"]==nil
99
+ hash["width"]=1500
100
+ else
101
+ hash["width"]=params["width"]
102
+ end
103
+
104
+ if params["height"]==nil
105
+ hash["height"]=800
106
+ else
107
+ hash["height"]=params["height"]
108
+ end
109
+
110
+ if params["file_name"]==nil
111
+ hash["file_name"]="sample.jpg"
112
+ else
113
+ hash["file_name"]=params["file_name"]
114
+ end
115
+
116
+ params_map = HashMap.new(hash)
117
+ return params_map
118
+ end
119
+
120
+ def getValuex
121
+ @value_x
122
+ end
123
+
124
+ def getValuey
125
+ @value_y
126
+ end
127
+
128
+
129
+ def getParams
130
+ @params
131
+ end
132
+
133
+
134
+ def save
135
+ begin
136
+ a = Java::ComDomain::clocomics
137
+ a.save_xy(self.getValuex,self.getValuey,self.getParams)
138
+ rescue Exception => ex
139
+ end
140
+ end
141
+ def view
142
+ begin
143
+ a = Java::ComDomain::clocomics
144
+ a.view_xy(self.getValuex,self.getValuey,self.getParams)
145
+ rescue Exception => ex
146
+ end
147
+ end
148
+
149
+ end