sequencescape-client-api 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +7 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +52 -0
  5. data/.yardoc/checksums +96 -0
  6. data/.yardoc/complete +0 -0
  7. data/.yardoc/object_types +0 -0
  8. data/.yardoc/objects/root.dat +0 -0
  9. data/.yardoc/proxy_types +0 -0
  10. data/Gemfile +4 -0
  11. data/README.markdown +4 -0
  12. data/Rakefile +2 -0
  13. data/doc/Array.html +192 -0
  14. data/doc/BaitLibrary.html +139 -0
  15. data/doc/Hash.html +242 -0
  16. data/doc/NilClass.html +214 -0
  17. data/doc/Sequencescape/Api/Actions/ClassActionHelpers.html +213 -0
  18. data/doc/Sequencescape/Api/Actions/InstanceActionHelpers.html +282 -0
  19. data/doc/Sequencescape/Api/Actions.html +197 -0
  20. data/doc/Sequencescape/Api/Associations/Base/InstanceMethods.html +352 -0
  21. data/doc/Sequencescape/Api/Associations/Base.html +237 -0
  22. data/doc/Sequencescape/Api/Associations/BelongsTo/AssociationProxy.html +332 -0
  23. data/doc/Sequencescape/Api/Associations/BelongsTo/CommonBehaviour/LoadHandler.html +279 -0
  24. data/doc/Sequencescape/Api/Associations/BelongsTo/CommonBehaviour.html +432 -0
  25. data/doc/Sequencescape/Api/Associations/BelongsTo/InlineAssociationProxy.html +173 -0
  26. data/doc/Sequencescape/Api/Associations/BelongsTo.html +212 -0
  27. data/doc/Sequencescape/Api/Associations/HasMany/AssociationProxy.html +366 -0
  28. data/doc/Sequencescape/Api/Associations/HasMany/InlineAssociationProxy.html +529 -0
  29. data/doc/Sequencescape/Api/Associations/HasMany/Json.html +250 -0
  30. data/doc/Sequencescape/Api/Associations/HasMany/Validation/CompositeErrors.html +493 -0
  31. data/doc/Sequencescape/Api/Associations/HasMany/Validation.html +245 -0
  32. data/doc/Sequencescape/Api/Associations/HasMany.html +212 -0
  33. data/doc/Sequencescape/Api/Associations/InstanceMethods/CompositeErrors.html +379 -0
  34. data/doc/Sequencescape/Api/Associations/InstanceMethods.html +496 -0
  35. data/doc/Sequencescape/Api/Associations.html +201 -0
  36. data/doc/Sequencescape/Api/BasicErrorHandling.html +371 -0
  37. data/doc/Sequencescape/Api/Composition/Target.html +262 -0
  38. data/doc/Sequencescape/Api/Composition.html +215 -0
  39. data/doc/Sequencescape/Api/ConnectionFactory/Actions.html +611 -0
  40. data/doc/Sequencescape/Api/ConnectionFactory/Helpers.html +233 -0
  41. data/doc/Sequencescape/Api/ConnectionFactory.html +321 -0
  42. data/doc/Sequencescape/Api/ErrorHandling/TurnOffValidationOfUuidOnlyRecords.html +189 -0
  43. data/doc/Sequencescape/Api/ErrorHandling.html +201 -0
  44. data/doc/Sequencescape/Api/FinderMethods/AllHandler.html +279 -0
  45. data/doc/Sequencescape/Api/FinderMethods/Caching.html +183 -0
  46. data/doc/Sequencescape/Api/FinderMethods/Delegation.html +189 -0
  47. data/doc/Sequencescape/Api/FinderMethods/FindByUuidHandler.html +279 -0
  48. data/doc/Sequencescape/Api/FinderMethods.html +364 -0
  49. data/doc/Sequencescape/Api/GeneralError.html +176 -0
  50. data/doc/Sequencescape/Api/JsonError.html +205 -0
  51. data/doc/Sequencescape/Api/ModifyingHandler.html +359 -0
  52. data/doc/Sequencescape/Api/PageOfResults/UpdateHandler.html +279 -0
  53. data/doc/Sequencescape/Api/PageOfResults.html +611 -0
  54. data/doc/Sequencescape/Api/Rails/ApplicationController.html +207 -0
  55. data/doc/Sequencescape/Api/Rails/Resourced.html +269 -0
  56. data/doc/Sequencescape/Api/Rails.html +117 -0
  57. data/doc/Sequencescape/Api/Resource/ActiveModel.html +287 -0
  58. data/doc/Sequencescape/Api/Resource/Attributes/InstanceMethods.html +272 -0
  59. data/doc/Sequencescape/Api/Resource/Attributes.html +199 -0
  60. data/doc/Sequencescape/Api/Resource/Groups/InstanceMethods.html +378 -0
  61. data/doc/Sequencescape/Api/Resource/Groups/Json.html +112 -0
  62. data/doc/Sequencescape/Api/Resource/Groups/Proxy/InstanceMethods.html +256 -0
  63. data/doc/Sequencescape/Api/Resource/Groups/Proxy.html +177 -0
  64. data/doc/Sequencescape/Api/Resource/Groups.html +270 -0
  65. data/doc/Sequencescape/Api/Resource/InstanceMethods.html +344 -0
  66. data/doc/Sequencescape/Api/Resource/Json/ClassMethods.html +243 -0
  67. data/doc/Sequencescape/Api/Resource/Json/CoercionHandler.html +279 -0
  68. data/doc/Sequencescape/Api/Resource/Json.html +405 -0
  69. data/doc/Sequencescape/Api/Resource/Modifications.html +295 -0
  70. data/doc/Sequencescape/Api/Resource.html +436 -0
  71. data/doc/Sequencescape/Api/ResourceInvalid.html +289 -0
  72. data/doc/Sequencescape/Api/ResourceModelProxy.html +444 -0
  73. data/doc/Sequencescape/Api/Version1.html +218 -0
  74. data/doc/Sequencescape/Api/Version2.html +222 -0
  75. data/doc/Sequencescape/Api.html +704 -0
  76. data/doc/Sequencescape/Asset.html +262 -0
  77. data/doc/Sequencescape/AssetAudit.html +258 -0
  78. data/doc/Sequencescape/AssetGroup.html +258 -0
  79. data/doc/Sequencescape/BaitLibraryLayout.html +258 -0
  80. data/doc/Sequencescape/BarcodePrinter.html +258 -0
  81. data/doc/Sequencescape/BarcodedAsset.html +293 -0
  82. data/doc/Sequencescape/Batch.html +327 -0
  83. data/doc/Sequencescape/Behaviour/Barcoded.html +195 -0
  84. data/doc/Sequencescape/Behaviour/Labeled.html +189 -0
  85. data/doc/Sequencescape/Behaviour/Qced/QcFile.html +244 -0
  86. data/doc/Sequencescape/Behaviour/Qced.html +199 -0
  87. data/doc/Sequencescape/Behaviour/Receptacle/Aliquot.html +258 -0
  88. data/doc/Sequencescape/Behaviour/Receptacle.html +195 -0
  89. data/doc/Sequencescape/Behaviour/StateDriven.html +205 -0
  90. data/doc/Sequencescape/Behaviour.html +130 -0
  91. data/doc/Sequencescape/BulkTransfer.html +258 -0
  92. data/doc/Sequencescape/Comment.html +258 -0
  93. data/doc/Sequencescape/Lane.html +282 -0
  94. data/doc/Sequencescape/LibraryEvent.html +258 -0
  95. data/doc/Sequencescape/LibraryTube.html +322 -0
  96. data/doc/Sequencescape/Lot.html +258 -0
  97. data/doc/Sequencescape/LotType/LotCreator.html +182 -0
  98. data/doc/Sequencescape/LotType.html +268 -0
  99. data/doc/Sequencescape/MultiplexedLibraryTube.html +326 -0
  100. data/doc/Sequencescape/Order.html +338 -0
  101. data/doc/Sequencescape/OrderTemplate/OrderCreator.html +182 -0
  102. data/doc/Sequencescape/OrderTemplate.html +268 -0
  103. data/doc/Sequencescape/Pipeline.html +258 -0
  104. data/doc/Sequencescape/Plate/CommentsCreation.html +184 -0
  105. data/doc/Sequencescape/Plate/CurrentVolumeSubstraction.html +236 -0
  106. data/doc/Sequencescape/Plate/Pooling.html +249 -0
  107. data/doc/Sequencescape/Plate/WellStructure.html +313 -0
  108. data/doc/Sequencescape/Plate.html +446 -0
  109. data/doc/Sequencescape/PlateConversion.html +258 -0
  110. data/doc/Sequencescape/PlateCreation.html +258 -0
  111. data/doc/Sequencescape/PlatePurpose/PlateCreation.html +186 -0
  112. data/doc/Sequencescape/PlatePurpose.html +268 -0
  113. data/doc/Sequencescape/PlateTemplate.html +282 -0
  114. data/doc/Sequencescape/PooledPlateCreation.html +258 -0
  115. data/doc/Sequencescape/Project.html +258 -0
  116. data/doc/Sequencescape/QcDecision.html +258 -0
  117. data/doc/Sequencescape/QcFile.html +327 -0
  118. data/doc/Sequencescape/Qcable.html +258 -0
  119. data/doc/Sequencescape/QcableCreator.html +258 -0
  120. data/doc/Sequencescape/Request.html +258 -0
  121. data/doc/Sequencescape/Robot.html +258 -0
  122. data/doc/Sequencescape/Sample.html +258 -0
  123. data/doc/Sequencescape/SampleTube.html +318 -0
  124. data/doc/Sequencescape/Search/BaseHandler.html +234 -0
  125. data/doc/Sequencescape/Search/MultipleResultHandler.html +276 -0
  126. data/doc/Sequencescape/Search/SingleResultHandler.html +303 -0
  127. data/doc/Sequencescape/Search.html +431 -0
  128. data/doc/Sequencescape/SpecificTubeCreation.html +258 -0
  129. data/doc/Sequencescape/Stamp.html +258 -0
  130. data/doc/Sequencescape/StateChange.html +258 -0
  131. data/doc/Sequencescape/Study.html +258 -0
  132. data/doc/Sequencescape/Submission.html +258 -0
  133. data/doc/Sequencescape/SubmissionPool.html +258 -0
  134. data/doc/Sequencescape/Tag/Group.html +219 -0
  135. data/doc/Sequencescape/Tag.html +149 -0
  136. data/doc/Sequencescape/Tag2Layout.html +258 -0
  137. data/doc/Sequencescape/Tag2LayoutTemplate.html +258 -0
  138. data/doc/Sequencescape/TagGroup.html +258 -0
  139. data/doc/Sequencescape/TagLayout.html +258 -0
  140. data/doc/Sequencescape/TagLayoutTemplate.html +258 -0
  141. data/doc/Sequencescape/Template.html +258 -0
  142. data/doc/Sequencescape/Transfer.html +258 -0
  143. data/doc/Sequencescape/TransferTemplate.html +258 -0
  144. data/doc/Sequencescape/Tube.html +319 -0
  145. data/doc/Sequencescape/TubeCreation.html +258 -0
  146. data/doc/Sequencescape/TubeFromTubeCreation.html +258 -0
  147. data/doc/Sequencescape/TubePurpose/TubeCreation.html +186 -0
  148. data/doc/Sequencescape/TubePurpose.html +268 -0
  149. data/doc/Sequencescape/User.html +258 -0
  150. data/doc/Sequencescape/VolumeUpdate.html +258 -0
  151. data/doc/Sequencescape/Well.html +362 -0
  152. data/doc/Sequencescape.html +121 -0
  153. data/doc/_index.html +1248 -0
  154. data/doc/class_list.html +51 -0
  155. data/doc/css/common.css +1 -0
  156. data/doc/css/full_list.css +58 -0
  157. data/doc/css/style.css +481 -0
  158. data/doc/file.README.html +76 -0
  159. data/doc/file_list.html +56 -0
  160. data/doc/frames.html +17 -0
  161. data/doc/index.html +76 -0
  162. data/doc/js/app.js +243 -0
  163. data/doc/js/full_list.js +216 -0
  164. data/doc/js/jquery.js +4 -0
  165. data/doc/method_list.html +1411 -0
  166. data/doc/top-level-namespace.html +114 -0
  167. data/lib/sequencescape/asset.rb +10 -0
  168. data/lib/sequencescape/asset_audit.rb +7 -0
  169. data/lib/sequencescape/asset_group.rb +9 -0
  170. data/lib/sequencescape/bait_library.rb +14 -0
  171. data/lib/sequencescape/bait_library_layout.rb +9 -0
  172. data/lib/sequencescape/barcode_printer.rb +13 -0
  173. data/lib/sequencescape/barcoded_asset.rb +12 -0
  174. data/lib/sequencescape/batch.rb +24 -0
  175. data/lib/sequencescape/behaviour/barcoded.rb +15 -0
  176. data/lib/sequencescape/behaviour/labeled.rb +14 -0
  177. data/lib/sequencescape/behaviour/qced.rb +31 -0
  178. data/lib/sequencescape/behaviour/receptacle.rb +21 -0
  179. data/lib/sequencescape/behaviour/state_driven.rb +19 -0
  180. data/lib/sequencescape/bulk_transfer.rb +8 -0
  181. data/lib/sequencescape/comment.rb +7 -0
  182. data/lib/sequencescape/custom_metadatum_collection.rb +8 -0
  183. data/lib/sequencescape/lane.rb +8 -0
  184. data/lib/sequencescape/library_event.rb +5 -0
  185. data/lib/sequencescape/library_tube.rb +7 -0
  186. data/lib/sequencescape/locale/en.yml +190 -0
  187. data/lib/sequencescape/lot.rb +11 -0
  188. data/lib/sequencescape/lot_type.rb +20 -0
  189. data/lib/sequencescape/multiplexed_library_tube.rb +6 -0
  190. data/lib/sequencescape/order.rb +13 -0
  191. data/lib/sequencescape/order_template.rb +19 -0
  192. data/lib/sequencescape/pipeline.rb +10 -0
  193. data/lib/sequencescape/plate/pooling.rb +23 -0
  194. data/lib/sequencescape/plate/well_structure.rb +27 -0
  195. data/lib/sequencescape/plate.rb +71 -0
  196. data/lib/sequencescape/plate_conversion.rb +8 -0
  197. data/lib/sequencescape/plate_creation.rb +8 -0
  198. data/lib/sequencescape/plate_purpose.rb +24 -0
  199. data/lib/sequencescape/plate_template.rb +13 -0
  200. data/lib/sequencescape/pooled_plate_creation.rb +8 -0
  201. data/lib/sequencescape/project.rb +11 -0
  202. data/lib/sequencescape/qc_decision.rb +9 -0
  203. data/lib/sequencescape/qc_file.rb +14 -0
  204. data/lib/sequencescape/qcable.rb +17 -0
  205. data/lib/sequencescape/qcable_creator.rb +13 -0
  206. data/lib/sequencescape/request.rb +16 -0
  207. data/lib/sequencescape/robot.rb +5 -0
  208. data/lib/sequencescape/sample.rb +51 -0
  209. data/lib/sequencescape/sample_tube.rb +7 -0
  210. data/lib/sequencescape/search.rb +80 -0
  211. data/lib/sequencescape/specific_tube_creation.rb +8 -0
  212. data/lib/sequencescape/stamp.rb +9 -0
  213. data/lib/sequencescape/state_change.rb +11 -0
  214. data/lib/sequencescape/study.rb +14 -0
  215. data/lib/sequencescape/submission.rb +16 -0
  216. data/lib/sequencescape/submission_pool.rb +7 -0
  217. data/lib/sequencescape/tag.rb +14 -0
  218. data/lib/sequencescape/tag2_layout.rb +10 -0
  219. data/lib/sequencescape/tag2_layout_template.rb +9 -0
  220. data/lib/sequencescape/tag_group.rb +4 -0
  221. data/lib/sequencescape/tag_layout.rb +10 -0
  222. data/lib/sequencescape/tag_layout_template.rb +15 -0
  223. data/lib/sequencescape/template.rb +6 -0
  224. data/lib/sequencescape/transfer.rb +9 -0
  225. data/lib/sequencescape/transfer_request.rb +12 -0
  226. data/lib/sequencescape/transfer_request_collection.rb +8 -0
  227. data/lib/sequencescape/transfer_template.rb +9 -0
  228. data/lib/sequencescape/tube.rb +26 -0
  229. data/lib/sequencescape/tube_creation.rb +8 -0
  230. data/lib/sequencescape/tube_from_tube_creation.rb +8 -0
  231. data/lib/sequencescape/tube_purpose.rb +24 -0
  232. data/lib/sequencescape/user.rb +13 -0
  233. data/lib/sequencescape/volume_update.rb +6 -0
  234. data/lib/sequencescape/well.rb +19 -0
  235. data/lib/sequencescape/work_completion.rb +10 -0
  236. data/lib/sequencescape-api/actions.rb +69 -0
  237. data/lib/sequencescape-api/associations/base/instance_methods.rb +57 -0
  238. data/lib/sequencescape-api/associations/base.rb +15 -0
  239. data/lib/sequencescape-api/associations/belongs_to.rb +127 -0
  240. data/lib/sequencescape-api/associations/has_many/json.rb +10 -0
  241. data/lib/sequencescape-api/associations/has_many/validation.rb +37 -0
  242. data/lib/sequencescape-api/associations/has_many.rb +123 -0
  243. data/lib/sequencescape-api/associations.rb +112 -0
  244. data/lib/sequencescape-api/capabilities.rb +11 -0
  245. data/lib/sequencescape-api/composition.rb +37 -0
  246. data/lib/sequencescape-api/connection_factory/actions.rb +154 -0
  247. data/lib/sequencescape-api/connection_factory/helpers.rb +9 -0
  248. data/lib/sequencescape-api/connection_factory.rb +40 -0
  249. data/lib/sequencescape-api/core.rb +63 -0
  250. data/lib/sequencescape-api/core_ext/array.rb +7 -0
  251. data/lib/sequencescape-api/core_ext/hash.rb +18 -0
  252. data/lib/sequencescape-api/core_ext.rb +2 -0
  253. data/lib/sequencescape-api/error_handling.rb +42 -0
  254. data/lib/sequencescape-api/errors.rb +38 -0
  255. data/lib/sequencescape-api/finder_methods.rb +184 -0
  256. data/lib/sequencescape-api/locale/en.yml +7 -0
  257. data/lib/sequencescape-api/rails.rb +88 -0
  258. data/lib/sequencescape-api/resource/active_model.rb +17 -0
  259. data/lib/sequencescape-api/resource/attribute_groups.rb +94 -0
  260. data/lib/sequencescape-api/resource/attributes.rb +87 -0
  261. data/lib/sequencescape-api/resource/instance_methods.rb +24 -0
  262. data/lib/sequencescape-api/resource/json.rb +114 -0
  263. data/lib/sequencescape-api/resource/modifications.rb +111 -0
  264. data/lib/sequencescape-api/resource.rb +47 -0
  265. data/lib/sequencescape-api/resource_model_proxy.rb +44 -0
  266. data/lib/sequencescape-api/version.rb +5 -0
  267. data/lib/sequencescape-api.rb +16 -0
  268. data/lib/sequencescape.rb +81 -0
  269. data/sequencescape-api.gemspec +32 -0
  270. data/spec/sequencescape-api/associations_spec.rb +95 -0
  271. data/spec/sequencescape-api/contracts/belongs-to-association.txt +14 -0
  272. data/spec/sequencescape-api/contracts/client-fails-authentication.txt +6 -0
  273. data/spec/sequencescape-api/contracts/create-invalid-resource.txt +10 -0
  274. data/spec/sequencescape-api/contracts/create-model-c-has-many-inline-nested.txt +10 -0
  275. data/spec/sequencescape-api/contracts/create-model-c-has-many-inline.txt +10 -0
  276. data/spec/sequencescape-api/contracts/create-model-c-has-many.txt +10 -0
  277. data/spec/sequencescape-api/contracts/create-model-c.txt +11 -0
  278. data/spec/sequencescape-api/contracts/create-via-has-many.txt +9 -0
  279. data/spec/sequencescape-api/contracts/model-a-instance.txt +21 -0
  280. data/spec/sequencescape-api/contracts/model-b-instance.txt +38 -0
  281. data/spec/sequencescape-api/contracts/model-c-instance-created.txt +17 -0
  282. data/spec/sequencescape-api/contracts/model-c-instance-updated.txt +17 -0
  283. data/spec/sequencescape-api/contracts/model-c-instance.txt +28 -0
  284. data/spec/sequencescape-api/contracts/model-c-invalid-attribute.txt +8 -0
  285. data/spec/sequencescape-api/contracts/resource-not-found.txt +6 -0
  286. data/spec/sequencescape-api/contracts/results-page-1.txt +17 -0
  287. data/spec/sequencescape-api/contracts/results-page-2.txt +18 -0
  288. data/spec/sequencescape-api/contracts/results-page-3.txt +17 -0
  289. data/spec/sequencescape-api/contracts/retrieve-belongs-to-association.txt +3 -0
  290. data/spec/sequencescape-api/contracts/retrieve-model.txt +4 -0
  291. data/spec/sequencescape-api/contracts/retrieve-results-page-1.txt +3 -0
  292. data/spec/sequencescape-api/contracts/retrieve-results-page-2.txt +3 -0
  293. data/spec/sequencescape-api/contracts/retrieve-results-page-3.txt +3 -0
  294. data/spec/sequencescape-api/contracts/retrieve-root-with-an-authorised-client.txt +5 -0
  295. data/spec/sequencescape-api/contracts/retrieve-root-with-an-unauthorised-client.txt +4 -0
  296. data/spec/sequencescape-api/contracts/retrieve-unauthorised-model-a-list.txt +4 -0
  297. data/spec/sequencescape-api/contracts/retrieve-unauthorised-model-b-list.txt +4 -0
  298. data/spec/sequencescape-api/contracts/retrieve-unauthorised-model-c-list.txt +4 -0
  299. data/spec/sequencescape-api/contracts/root-response-for-authorised-client.txt +20 -0
  300. data/spec/sequencescape-api/contracts/root-response-for-unauthorised-client.txt +28 -0
  301. data/spec/sequencescape-api/contracts/unauthorised-model-a-list.txt +15 -0
  302. data/spec/sequencescape-api/contracts/unauthorised-model-b-list.txt +14 -0
  303. data/spec/sequencescape-api/contracts/unauthorised-model-c-list.txt +15 -0
  304. data/spec/sequencescape-api/contracts/update-invalid-resource.txt +10 -0
  305. data/spec/sequencescape-api/contracts/update-model-c.txt +11 -0
  306. data/spec/sequencescape-api/finding_methods_spec.rb +34 -0
  307. data/spec/sequencescape-api/modifications_spec.rb +169 -0
  308. data/spec/sequencescape-api/root_spec.rb +58 -0
  309. data/spec/spec_helper.rb +13 -0
  310. data/spec/support/contract_helper.rb +112 -0
  311. data/spec/support/namespaces.rb +67 -0
  312. data/spec/support/shared_examples.rb +12 -0
  313. metadata +540 -0
@@ -0,0 +1,11 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Lot < ::Sequencescape::Api::Resource
4
+
5
+ belongs_to :user
6
+ belongs_to :lot_type
7
+ belongs_to :template
8
+ has_many :qcables
9
+
10
+ attribute_accessor :lot_number, :received_at, :template_name, :lot_type_name
11
+ end
@@ -0,0 +1,20 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::LotType < ::Sequencescape::Api::Resource
4
+
5
+ module LotCreator
6
+ def create!(attributes=nil)
7
+ attributes ||= {}
8
+ new({}, false).tap do |lot|
9
+ api.create(actions.create, { 'lot' => attributes }, Sequencescape::Api::ModifyingHandler.new(lot))
10
+ end
11
+ end
12
+ end
13
+
14
+ has_many :lots do
15
+ # has_create_action
16
+ include Sequencescape::LotType::LotCreator
17
+ end
18
+
19
+ attribute_accessor :name, :template_class, :printer_type, :qcable_name
20
+ end
@@ -0,0 +1,6 @@
1
+ require 'sequencescape/library_tube'
2
+
3
+ class Sequencescape::MultiplexedLibraryTube < Sequencescape::LibraryTube
4
+ attribute_reader :state
5
+ belongs_to :custom_metadatum_collection
6
+ end
@@ -0,0 +1,13 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Order < ::Sequencescape::Api::Resource
4
+ has_many :assets
5
+ belongs_to :user
6
+ belongs_to :study
7
+ belongs_to :project
8
+
9
+ # It does, but we don't care for now.
10
+ # has_many :request_types
11
+
12
+ attr_accessor :request_options
13
+ end
@@ -0,0 +1,19 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::OrderTemplate < ::Sequencescape::Api::Resource
4
+
5
+ module OrderCreator
6
+ def create!(attributes=nil)
7
+ attributes ||= {}
8
+ new({}, false).tap do |order|
9
+ api.create(actions.create, { 'order' => attributes }, Sequencescape::Api::ModifyingHandler.new(order))
10
+ end
11
+ end
12
+ end
13
+
14
+ has_many :orders do
15
+ include Sequencescape::OrderTemplate::OrderCreator
16
+ end
17
+
18
+ attribute_accessor :name
19
+ end
@@ -0,0 +1,10 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Pipeline < ::Sequencescape::Api::Resource
4
+ attribute_accessor :name
5
+
6
+ has_many :requests
7
+ has_many :batches do
8
+ has_create_action
9
+ end
10
+ end
@@ -0,0 +1,23 @@
1
+ module Sequencescape::Plate::Pooling
2
+ def populate_wells_with_pool
3
+ wells.each do |well|
4
+ pool_id, pool = pools.detect { |_, pool| pool['wells'].include?(well.location) }
5
+ next if pool.nil?
6
+ well.pool = pool
7
+ end
8
+ end
9
+
10
+ def populate_wells_with_pre_cap_group
11
+ wells.each do |well|
12
+ pre_cap_group_id, pre_cap_group = pre_cap_groups.detect { |_, pre_cap_group| pre_cap_group['wells'].include?(well.location) }
13
+ next if pre_cap_group.nil?
14
+ well.pre_cap_group = pre_cap_group
15
+ end
16
+ end
17
+
18
+ def after_load
19
+ pools.each { |pool_id, pool| pool['id'] = pool_id } unless pools.nil?
20
+ pre_cap_groups.each { |pre_cap_group_id, pre_cap_group| pre_cap_group['id'] = pre_cap_group_id } unless pre_cap_groups.nil?
21
+ end
22
+ private :after_load
23
+ end
@@ -0,0 +1,27 @@
1
+ module Sequencescape::Plate::WellStructure
2
+ def rows
3
+ case self.size
4
+ when 96 then ('A'..'H')
5
+ when 384 then ('A'..'P')
6
+ else raise RuntimeError, "Unknown plate size #{self.size}"
7
+ end
8
+ end
9
+
10
+ def columns
11
+ case self.size
12
+ when 96 then (1..12)
13
+ when 384 then (1..24)
14
+ else raise RuntimeError, "Unknown plate size #{self.size}"
15
+ end
16
+ end
17
+
18
+ def locations_in_rows
19
+ [].tap do |locations|
20
+ self.rows.each do |row|
21
+ self.columns.each do |column|
22
+ locations << "#{row}#{column}"
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,71 @@
1
+ require 'sequencescape/asset'
2
+
3
+ class Sequencescape::Plate < ::Sequencescape::Asset
4
+ require 'sequencescape/behaviour/barcoded'
5
+ require 'sequencescape/behaviour/state_driven'
6
+ require 'sequencescape/plate/well_structure'
7
+ require 'sequencescape/plate/pooling'
8
+ require 'sequencescape/behaviour/labeled'
9
+ require 'sequencescape/behaviour/qced'
10
+
11
+ include Sequencescape::Behaviour::Barcoded
12
+ include Sequencescape::Behaviour::StateDriven
13
+ include Sequencescape::Plate::WellStructure
14
+ include Sequencescape::Plate::Pooling
15
+ include Sequencescape::Behaviour::Labeled
16
+ include Sequencescape::Behaviour::Qced
17
+
18
+ has_many :wells
19
+ has_many :submission_pools
20
+ has_many :transfer_request_collections
21
+
22
+ belongs_to :plate_purpose
23
+ belongs_to :custom_metadatum_collection
24
+ composed_of :stock_plate, :class_name => 'Plate'
25
+
26
+ module CommentsCreation
27
+ def create!(attributes = nil)
28
+ attributes ||= {}
29
+
30
+ new({}, false).tap do |comment|
31
+ api.create(actions.create, { 'comment' => attributes }, Sequencescape::Api::ModifyingHandler.new(comment))
32
+ end
33
+ end
34
+
35
+ end
36
+
37
+ module CurrentVolumeSubstraction
38
+ def create!(attributes = nil)
39
+ attributes ||= {}
40
+
41
+ new({}, false).tap do |volume_update|
42
+ api.create(actions.create, { 'volume_update' => attributes }, Sequencescape::Api::ModifyingHandler.new(volume_update))
43
+ end
44
+ end
45
+
46
+ def substract_volume!(volume_change)
47
+ create!({ :volume_change => volume_change})
48
+ end
49
+ end
50
+ has_many :volume_updates do
51
+ include Sequencescape::Plate::CurrentVolumeSubstraction
52
+ end
53
+
54
+ has_many :comments do
55
+ include Sequencescape::Plate::CommentsCreation
56
+ end
57
+
58
+ has_many :source_transfers, :class_name => 'Transfer'
59
+ has_many :transfers_to_tubes, :class_name => 'Transfer'
60
+ has_many :creation_transfers, :class_name => 'Transfer'
61
+
62
+ attribute_accessor :size, :iteration, :pools, :pre_cap_groups, :location, :priority
63
+
64
+ # Provides backwards compatability
65
+ def creation_transfer
66
+ Rails.logger.warn "Creation transfer is deprecated, use creation_transfers instead"
67
+ return creation_transfers.first if creation_transfers.count == 1
68
+ raise Sequencescape::Api::Error, "Unexpected number of transfers found: #{creation_transfers.count} found, 1 expected."
69
+ end
70
+
71
+ end
@@ -0,0 +1,8 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::PlateConversion < ::Sequencescape::Api::Resource
4
+ belongs_to :user
5
+ belongs_to :target, :class_name => 'Plate'
6
+ belongs_to :parent, :class_name => 'Plate'
7
+ belongs_to :purpose, :class_name => 'PlatePurpose'
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::PlateCreation < ::Sequencescape::Api::Resource
4
+ belongs_to :user
5
+ belongs_to :parent, :class_name => 'Plate'
6
+ belongs_to :child_purpose, :class_name => 'PlatePurpose'
7
+ belongs_to :child, :class_name => 'Plate'
8
+ end
@@ -0,0 +1,24 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::PlatePurpose < ::Sequencescape::Api::Resource
4
+ module PlateCreation
5
+ def create!(attributes = nil)
6
+ attributes ||= {}
7
+ attributes[:wells].delete_if { |_,v| v.blank? } if attributes.key?(:wells)
8
+
9
+ new({}, false).tap do |plate|
10
+ api.create(actions.create, { 'plate' => attributes }, Sequencescape::Api::ModifyingHandler.new(plate))
11
+ end
12
+ end
13
+ end
14
+
15
+ has_many :children, :class_name => 'PlatePurpose'
16
+ has_many :parents, :class_name => 'PlatePurpose'
17
+
18
+ has_many :plates do
19
+ include Sequencescape::PlatePurpose::PlateCreation
20
+ end
21
+
22
+ attribute_accessor :name, :lifespan, :cherrypickable_target, :stock_plate, :size
23
+ attribute_writer :input_plate
24
+ end
@@ -0,0 +1,13 @@
1
+ require 'sequencescape/asset'
2
+
3
+ class Sequencescape::PlateTemplate < ::Sequencescape::Asset
4
+
5
+ require 'sequencescape/plate/well_structure'
6
+
7
+ include Sequencescape::Plate::WellStructure
8
+
9
+ has_many :wells
10
+
11
+ attribute_accessor :size, :name
12
+
13
+ end
@@ -0,0 +1,8 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::PooledPlateCreation < ::Sequencescape::Api::Resource
4
+ belongs_to :user
5
+ has_many :parents, :class_name => 'Plate', :disposition => :inline
6
+ belongs_to :child_purpose, :class_name => 'PlatePurpose'
7
+ belongs_to :child, :class_name => 'Plate'
8
+ end
@@ -0,0 +1,11 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Project < ::Sequencescape::Api::Resource
4
+ has_many :submissions
5
+
6
+ attribute_accessor :name
7
+ attribute_accessor :approved, :state
8
+ attribute_accessor :project_manager, :cost_code, :funding_comments, :external_funding_source, :budget_division, :budget_cost_centre, :funding_model
9
+ attribute_accessor :collaborators
10
+ attribute_accessor :roles
11
+ end
@@ -0,0 +1,9 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::QcDecision < ::Sequencescape::Api::Resource
4
+
5
+ belongs_to :user
6
+ belongs_to :lot
7
+
8
+ attribute_accessor :decisions
9
+ end
@@ -0,0 +1,14 @@
1
+
2
+ require 'sequencescape-api/resource'
3
+
4
+ class Sequencescape::QcFile < ::Sequencescape::Api::Resource
5
+
6
+ belongs_to :asset
7
+
8
+ attribute_accessor :filename, :size
9
+
10
+ def retrieve
11
+ api.retrieve(actions.read, Sequencescape::Api::ModifyingHandler.new(self), 'sequencescape/qc_file')
12
+ end
13
+
14
+ end
@@ -0,0 +1,17 @@
1
+
2
+ require 'sequencescape-api/resource'
3
+
4
+ class Sequencescape::Qcable < ::Sequencescape::Api::Resource
5
+
6
+ belongs_to :lot
7
+ belongs_to :qcable_creator
8
+ belongs_to :asset
9
+
10
+ attribute_accessor :state, :stamp_bed, :stamp_index
11
+
12
+ attribute_group :barcode do
13
+ attribute_accessor :prefix, :number # The pieces that make up a barcode
14
+ attribute_accessor :ean13 # The EAN13 barcode number
15
+ end
16
+
17
+ end
@@ -0,0 +1,13 @@
1
+
2
+ require 'sequencescape-api/resource'
3
+
4
+ class Sequencescape::QcableCreator < ::Sequencescape::Api::Resource
5
+
6
+ belongs_to :user
7
+ belongs_to :lot
8
+
9
+ has_many :qcables
10
+
11
+ attribute_accessor :count
12
+
13
+ end
@@ -0,0 +1,16 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Request < ::Sequencescape::Api::Resource
4
+ belongs_to :project
5
+ belongs_to :study
6
+ belongs_to :sample
7
+ belongs_to :submission
8
+
9
+ belongs_to :source_asset, :class_name => 'Asset'
10
+ belongs_to :target_asset, :class_name => 'Asset'
11
+
12
+ attribute_accessor :type, :state
13
+ validates_inclusion_of :state, :in => %w{pending started failed passed cancelled blocked hold}
14
+
15
+ attribute_accessor :read_length, :library_type, :fragment_size
16
+ end
@@ -0,0 +1,5 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Robot < ::Sequencescape::Api::Resource
4
+ attribute_accessor :name, :robot_properties
5
+ end
@@ -0,0 +1,51 @@
1
+ require 'sequencescape-api/resource'
2
+
3
+ class Sequencescape::Sample < ::Sequencescape::Api::Resource
4
+ has_many :sample_tubes
5
+
6
+ attribute_group :sanger do
7
+ attribute_accessor :name, :sample_id, :resubmitted, :description
8
+ end
9
+ attribute_group :supplier do
10
+ attribute_accessor :sample_name, :storage_conditions
11
+
12
+ attribute_group :collection do
13
+ attribute_accessor :date
14
+ end
15
+ attribute_group :extraction do
16
+ attribute_accessor :date, :method
17
+ end
18
+ attribute_group :purification do
19
+ attribute_accessor :purified, :method
20
+ end
21
+ attribute_group :measurements do
22
+ attribute_accessor :volume, :concentration, :concentration_determined_by
23
+ attribute_accessor :gc_content, :gender
24
+ end
25
+ end
26
+ attribute_group :source do
27
+ attribute_accessor :dna_source, :cohort, :country, :region, :ethnicity, :control
28
+ end
29
+ attribute_group :family do
30
+ attribute_accessor :mother, :father, :replicate, :sibling
31
+ end
32
+ attribute_group :taxonomy do
33
+ attribute_accessor :id, :strain, :common_name, :organism
34
+ end
35
+ attribute_group :reference do
36
+ attribute_accessor :genome
37
+ end
38
+ attribute_group :data_release do
39
+ attribute_accessor :sample_type, :accession_number, :visibility, :public_name, :description
40
+
41
+ attribute_group :metagenomics do
42
+ attribute_accessor :genotype, :phenotype
43
+ attribute_accessor :age, :developmental_stage, :cell_type, :disease_state
44
+ attribute_accessor :compound, :dose, :immunoprecipitate, :growth_condition
45
+ attribute_accessor :rnai, :organism_part, :time_point, :treatment, :subject, :disease
46
+ end
47
+ attribute_group :managed do
48
+ attribute_accessor :treatment, :subject, :disease
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,7 @@
1
+ require 'sequencescape/tube'
2
+
3
+ class Sequencescape::SampleTube < ::Sequencescape::Tube
4
+ has_many :requests
5
+ has_many :library_tubes
6
+ belongs_to :custom_metadatum_collection
7
+ end