myexperiment-rest 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/CHANGES +9 -0
  2. data/LICENSE +23 -0
  3. data/README +33 -0
  4. data/Rakefile +45 -0
  5. data/bin/get_workflow_data.rb +31 -0
  6. data/doc/classes/MyExperimentREST.html +113 -0
  7. data/doc/classes/MyExperimentREST/IOData.html +169 -0
  8. data/doc/classes/MyExperimentREST/IOData.src/M000003.html +20 -0
  9. data/doc/classes/MyExperimentREST/ReadWorkflow.html +184 -0
  10. data/doc/classes/MyExperimentREST/ReadWorkflow.src/M000002.html +39 -0
  11. data/doc/classes/MyExperimentREST/ReadWorkflow.src/M000005.html +41 -0
  12. data/doc/classes/MyExperimentREST/TavernaIOData.html +167 -0
  13. data/doc/classes/MyExperimentREST/TavernaIOData.src/M000006.html +20 -0
  14. data/doc/classes/MyExperimentREST/TavernaIOData.src/M000007.html +20 -0
  15. data/doc/classes/MyExperimentREST/TavernaWorkflow.html +209 -0
  16. data/doc/classes/MyExperimentREST/TavernaWorkflow.src/M000005.html +23 -0
  17. data/doc/classes/MyExperimentREST/TavernaWorkflow.src/M000006.html +22 -0
  18. data/doc/classes/MyExperimentREST/Workflow.html +172 -0
  19. data/doc/classes/MyExperimentREST/Workflow.src/M000001.html +21 -0
  20. data/doc/classes/MyExperimentREST/Workflows.html +167 -0
  21. data/doc/classes/MyExperimentREST/Workflows.src/M000004.html +41 -0
  22. data/doc/classes/TestReadWorkflow.html +167 -0
  23. data/doc/classes/TestReadWorkflow.src/M000001.html +18 -0
  24. data/doc/classes/TestReadWorkflow.src/M000002.html +24 -0
  25. data/doc/classes/TestReadWorkflow.src/M000003.html +20 -0
  26. data/doc/classes/TestReadWorkflow.src/M000004.html +20 -0
  27. data/doc/created.rid +1 -0
  28. data/doc/files/bin/get_workflow_data_rb.html +116 -0
  29. data/doc/files/lib/myexperiment-rest/my_experiment_rest_rb.html +110 -0
  30. data/doc/files/lib/myexperiment-rest/myexperiment_rest_rb.html +110 -0
  31. data/doc/files/lib/myexperiment-rest_rb.html +108 -0
  32. data/doc/files/test/test_read_workflow_rb.html +122 -0
  33. data/doc/fr_class_index.html +31 -0
  34. data/doc/fr_file_index.html +29 -0
  35. data/doc/fr_method_index.html +32 -0
  36. data/doc/index.html +24 -0
  37. data/doc/rdoc-style.css +208 -0
  38. data/doc/rdoc/classes/MyExperimentREST.html +117 -0
  39. data/doc/rdoc/classes/MyExperimentREST/TavernaIOData.html +178 -0
  40. data/doc/rdoc/classes/MyExperimentREST/TavernaWorkflow.html +223 -0
  41. data/doc/rdoc/classes/MyExperimentREST/Workflows.html +199 -0
  42. data/doc/rdoc/created.rid +1 -0
  43. data/doc/rdoc/files/CHANGES.html +121 -0
  44. data/doc/rdoc/files/LICENSE.html +133 -0
  45. data/doc/rdoc/files/README.html +148 -0
  46. data/doc/rdoc/files/lib/myexperiment-rest/myexperiment_rest_rb.html +110 -0
  47. data/doc/rdoc/files/lib/myexperiment-rest_rb.html +108 -0
  48. data/doc/rdoc/fr_class_index.html +30 -0
  49. data/doc/rdoc/fr_file_index.html +31 -0
  50. data/doc/rdoc/fr_method_index.html +29 -0
  51. data/doc/rdoc/index.html +24 -0
  52. data/doc/rdoc/rdoc-style.css +208 -0
  53. data/lib/myexperiment-rest.rb +5 -0
  54. data/lib/myexperiment-rest/myexperiment_rest.rb +146 -0
  55. metadata +133 -0
data/CHANGES ADDED
@@ -0,0 +1,9 @@
1
+ = Changes log for the MyExperiment via REST Gem
2
+
3
+ == Version 0.2.6
4
+ * Added dependency in gem specification.
5
+
6
+
7
+ == Version 0.2.5
8
+ * Abstracted the TavernaWorkflow class better so that it can be properly reused.
9
+ * API slightly changed; added input_type ([T2_FLOW | MY_EXPERIMENT])
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ == myexperiment-rest
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2010 - Netherlands Bioinformatics Centre
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,33 @@
1
+ = MyExperiment Interaction via REST
2
+
3
+ Authors:: Konstantinos Karasavvas
4
+ Gem Version:: 0.2.6
5
+ Contact:: mailto:kostas.karasavvas@nbic.nl
6
+ Licence:: MIT (See LICENCE or http://www.opensource.org/licenses/mit-license)
7
+ Copyright:: (c) 2010 Netherlands Bioinformatics Centre, The Netherlands
8
+
9
+
10
+ == Description
11
+
12
+ This is a simple library to access data on myExperiment via its REST API.
13
+
14
+
15
+ == Features/Problems
16
+
17
+ Only a subset of myExperiment workflow data can be currently accessed.
18
+
19
+
20
+ == Usage
21
+
22
+ There is an example script inside the <tt>bin</tt> directory that demonstrates
23
+ how you can use the library.
24
+
25
+
26
+ == Installation
27
+
28
+ [sudo] gem install myexperiment-rest
29
+
30
+
31
+ == References
32
+
33
+ myExperiment:: http://www.myexperiment.org
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ #
2
+ # To change this template, choose Tools | Templates
3
+ # and open the template in the editor.
4
+
5
+
6
+ require 'rubygems'
7
+ require 'rake'
8
+ require 'rake/clean'
9
+ require 'rake/gempackagetask'
10
+ require 'rake/rdoctask'
11
+ require 'rake/testtask'
12
+
13
+ spec = Gem::Specification.new do |s|
14
+ s.name = 'myexperiment-rest'
15
+ s.version = '0.2.6'
16
+ s.extra_rdoc_files = ['README', 'LICENSE', 'CHANGES']
17
+ s.summary = 'This is a simple library to access data on myExperiment via its REST API. Currently supports a subset of the workflow information available.'
18
+ s.description = s.summary
19
+ s.author = 'Konstantinos Karasavvas'
20
+ s.email = 'kostas.karasavvas@nbic.nl'
21
+ s.executables = ['get_workflow_data.rb']
22
+ s.files = %w(LICENSE README CHANGES Rakefile) + Dir.glob("{bin,lib,doc,spec}/**/*")
23
+ s.require_path = "lib"
24
+ s.bindir = "bin"
25
+ s.add_dependency 'rest-client'
26
+ end
27
+
28
+ Rake::GemPackageTask.new(spec) do |p|
29
+ p.gem_spec = spec
30
+ p.need_tar = true
31
+ p.need_zip = true
32
+ end
33
+
34
+ Rake::RDocTask.new do |rdoc|
35
+ files =['README', 'LICENSE', 'CHANGES', 'lib/**/*.rb']
36
+ rdoc.rdoc_files.add(files)
37
+ rdoc.main = "README" # page to start on
38
+ rdoc.title = "myexperiment-rest Docs"
39
+ rdoc.rdoc_dir = 'doc/rdoc' # rdoc output folder
40
+ rdoc.options << '--line-numbers'
41
+ end
42
+
43
+ Rake::TestTask.new do |t|
44
+ t.test_files = FileList['test/**/*.rb']
45
+ end
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+ require "myexperiment-rest"
5
+
6
+ include MyExperimentREST
7
+
8
+ if ARGV[0] == nil
9
+ wkf = Workflows.new.read('http://www.myexperiment.org/workflows/74/download/bioaid_proteindiscovery_221429.xml?version=3')
10
+ else
11
+ wkf = Workflows.new.read(ARGV[0])
12
+ end
13
+
14
+
15
+ puts wkf.input_type
16
+ puts wkf.xml_uri
17
+ puts wkf.title
18
+ puts wkf.description
19
+ puts "--------------------------"
20
+
21
+ wkf.inputs.each do |i|
22
+ puts i.name
23
+ i.descriptions.each do |d|
24
+ puts d
25
+ end
26
+ i.examples.each do |e|
27
+ puts e
28
+ end
29
+ puts "--------------------------"
30
+ end
31
+
@@ -0,0 +1,113 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Module: MyExperimentREST</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Module</strong></td>
53
+ <td class="class-name-in-header">MyExperimentREST</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../files/lib/myexperiment-rest/myexperiment_rest_rb.html">
59
+ lib/myexperiment-rest/myexperiment_rest.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ </table>
66
+ </div>
67
+ <!-- banner header -->
68
+
69
+ <div id="bodyContent">
70
+
71
+
72
+
73
+ <div id="contextContent">
74
+
75
+
76
+
77
+ </div>
78
+
79
+
80
+ </div>
81
+
82
+
83
+ <!-- if includes -->
84
+
85
+ <div id="section">
86
+
87
+ <div id="class-list">
88
+ <h3 class="section-bar">Classes and Modules</h3>
89
+
90
+ Class <a href="MyExperimentREST/TavernaIOData.html" class="link">MyExperimentREST::TavernaIOData</a><br />
91
+ Class <a href="MyExperimentREST/TavernaWorkflow.html" class="link">MyExperimentREST::TavernaWorkflow</a><br />
92
+ Class <a href="MyExperimentREST/Workflows.html" class="link">MyExperimentREST::Workflows</a><br />
93
+
94
+ </div>
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+ <!-- if method_list -->
103
+
104
+
105
+ </div>
106
+
107
+
108
+ <div id="validator-badges">
109
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
110
+ </div>
111
+
112
+ </body>
113
+ </html>
@@ -0,0 +1,169 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>Class: MyExperimentREST::IOData</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="classHeader">
50
+ <table class="header-table">
51
+ <tr class="top-aligned-row">
52
+ <td><strong>Class</strong></td>
53
+ <td class="class-name-in-header">MyExperimentREST::IOData</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/lib/myexperiment-rest/my_experiment_rest_rb.html">
59
+ lib/myexperiment-rest/my_experiment_rest.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ Object
69
+ </td>
70
+ </tr>
71
+ </table>
72
+ </div>
73
+ <!-- banner header -->
74
+
75
+ <div id="bodyContent">
76
+
77
+
78
+
79
+ <div id="contextContent">
80
+
81
+ <div id="description">
82
+ <p>
83
+ Contains all available information about an input or output: name,
84
+ descriptions and examples. The last two are lists. Currently both inputs
85
+ and outputs contain the same information. If that changes we can separate
86
+ them.
87
+ </p>
88
+
89
+ </div>
90
+
91
+
92
+ </div>
93
+
94
+ <div id="method-list">
95
+ <h3 class="section-bar">Methods</h3>
96
+
97
+ <div class="name-list">
98
+ <a href="#M000003">new</a>&nbsp;&nbsp;
99
+ </div>
100
+ </div>
101
+
102
+ </div>
103
+
104
+
105
+ <!-- if includes -->
106
+
107
+ <div id="section">
108
+
109
+
110
+
111
+
112
+
113
+ <div id="attribute-list">
114
+ <h3 class="section-bar">Attributes</h3>
115
+
116
+ <div class="name-list">
117
+ <table>
118
+ <tr class="top-aligned-row context-row">
119
+ <td class="context-item-name">descriptions</td>
120
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
121
+ <td class="context-item-desc"></td>
122
+ </tr>
123
+ <tr class="top-aligned-row context-row">
124
+ <td class="context-item-name">examples</td>
125
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
126
+ <td class="context-item-desc"></td>
127
+ </tr>
128
+ <tr class="top-aligned-row context-row">
129
+ <td class="context-item-name">name</td>
130
+ <td class="context-item-value">&nbsp;[R]&nbsp;</td>
131
+ <td class="context-item-desc"></td>
132
+ </tr>
133
+ </table>
134
+ </div>
135
+ </div>
136
+
137
+
138
+
139
+ <!-- if method_list -->
140
+ <div id="methods">
141
+ <h3 class="section-bar">Public Class methods</h3>
142
+
143
+ <div id="method-M000003" class="method-detail">
144
+ <a name="M000003"></a>
145
+
146
+ <div class="method-heading">
147
+ <a href="IOData.src/M000003.html" target="Code" class="method-signature"
148
+ onclick="popupCode('IOData.src/M000003.html');return false;">
149
+ <span class="method-name">new</span><span class="method-args">(name, descriptions, examples)</span>
150
+ </a>
151
+ </div>
152
+
153
+ <div class="method-description">
154
+ </div>
155
+ </div>
156
+
157
+
158
+ </div>
159
+
160
+
161
+ </div>
162
+
163
+
164
+ <div id="validator-badges">
165
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
166
+ </div>
167
+
168
+ </body>
169
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>new (MyExperimentREST::IOData)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File lib/myexperiment-rest/my_experiment_rest.rb, line 115</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">descriptions</span>, <span class="ruby-identifier">examples</span>)
15
+ <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
16
+ <span class="ruby-ivar">@descriptions</span> = <span class="ruby-identifier">descriptions</span>
17
+ <span class="ruby-ivar">@examples</span> = <span class="ruby-identifier">examples</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>