Class: Request::LibraryCreation
- Inherits:
-
CustomerRequest
- Object
- ActiveRecord::Base
- ApplicationRecord
- Request
- CustomerRequest
- Request::LibraryCreation
- Includes:
- CustomerResponsibility
- Defined in:
- app/models/request/library_creation.rb
Direct Known Subclasses
IlluminaB::Requests::StdLibraryRequest, IlluminaC::Requests::LibraryRequest, IlluminaHtp::Requests::StdLibraryRequest, Pulldown::Requests::LibraryCreation
Defined Under Namespace
Classes: Metadata
Constant Summary
Constants included from Metadata
Constants included from Statemachine
Statemachine::ACTIVE, Statemachine::COMPLETED_STATE, Statemachine::INACTIVE, Statemachine::OPENED_STATE, Statemachine::SORT_ORDER
Constants included from StandardNamedScopes
StandardNamedScopes::SORT_FIELDS, StandardNamedScopes::SORT_ORDERS
Class Method Summary collapse
-
.fragment_size_details(minimum = :no_default, maximum = :no_default) ⇒ Object
Convenience helper for ensuring that the fragment size information is properly treated.
Instance Method Summary collapse
-
#aliquot_attributes ⇒ Hash
Passed into cloned aliquots at the beginning of a pipeline to set appropriate options.
-
#on_started ⇒ Object
Override the behaviour of Request so that we do not copy the aliquots from our source asset to the target when we are passed.
-
#update_pool_information(pool_information) ⇒ Object
Add common pool information, like insert size and library type.
Methods included from CustomerResponsibility
Methods inherited from CustomerRequest
#customer_accepts_responsibility!, #generate_create_request_event, #generate_destroy_request_event, #generate_request_event, #update_responsibilities!
Methods inherited from Request
accessioning_required?, #add_comment, #associated_studies, #cancelable?, #copy, #current_request_event, #customer_accepts_responsibility!, delegate_validator, #detect_descriptor, #eventful_studies, for_study, #format_qc_information, get_all_comments, #has_passed, #lab_events_for_batch, #manifest_processed!, #most_recent_event_named, #next_request_type_id, #next_requests, #next_requests_via_asset, #next_requests_via_submission, number_expected_for_submission_id_and_request_type_id, #previous_failed_requests?, #priority, #product_line, #project=, #project_id=, #ready?, #request_type_updatable?, #return_pending_to_inbox!, #run_events, #source_labware, #study=, #study_id=, #submission_plate_count, #submitted_at, #target_purpose, #target_tube, #update_priority, #update_responsibilities!
Methods included from Statistics
#asset_statistics, #progress_statistics, #sample_statistics_new
Methods included from EventfulRecord
#has_many_events, #has_many_lab_events, #has_one_event_with_family
Methods included from Metadata
Methods included from Batch::RequestBehaviour
included, #recycle_from_batch!, #return_for_inbox!, #with_batch_id
Methods included from Statemachine
#cancellable?, #change_decision!, #closed?, #failed_downstream!, #failed_upstream!, #finished?, #on_blocked, #on_cancelled, #on_failed, #on_hold, #on_passed, #open?, #terminated?, #transfer_aliquots
Methods included from StandardNamedScopes
Methods included from Commentable
Methods included from AASM::Extensions
Methods included from Uuid::Uuidable
included, #unsaved_uuid!, #uuid
Methods included from Api::RequestIo::Extensions
Methods included from Aliquot::DeprecatedBehaviours::Request
Methods inherited from ApplicationRecord
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
Class Method Details
.fragment_size_details(minimum = :no_default, maximum = :no_default) ⇒ Object
Convenience helper for ensuring that the fragment size information is properly treated. The columns in the database are strings and we need them to be integers, hence we force that here.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/models/request/library_creation.rb', line 29 def self.fragment_size_details(minimum = :no_default, maximum = :no_default) # rubocop:todo Metrics/MethodLength minimum_details = { required: true, integer: true, minimum: 1 } maximum_details = { required: true, integer: true, minimum: 1 } minimum_details[:default] = minimum unless minimum == :no_default maximum_details[:default] = maximum unless maximum == :no_default class_eval do as: Request do # Redefine the fragment size attributes as they are fixed custom_attribute(:fragment_size_required_from, minimum_details) custom_attribute(:fragment_size_required_to, maximum_details) custom_attribute(:gigabases_expected, positive_float: true) end include Request::LibraryManufacture end const_get(:Metadata).class_eval do def fragment_size_required_from super.try(:to_i) end def fragment_size_required_to super.try(:to_i) end end end |
Instance Method Details
#aliquot_attributes ⇒ Hash
Passed into cloned aliquots at the beginning of a pipeline to set appropriate options
65 66 67 68 69 70 71 72 73 |
# File 'app/models/request/library_creation.rb', line 65 def aliquot_attributes { study_id: initial_study_id, project_id: initial_project_id, library_type: library_type, insert_size: insert_size, request_id: id } end |
#on_started ⇒ Object
Override the behaviour of Request so that we do not copy the aliquots from our source asset to the target when we are passed. This is actually done by the TransferRequest from plate to plate as it goes through being processed.
9 10 11 |
# File 'app/models/request/library_creation.rb', line 9 def on_started # Override the default behaviour to not do the transfer end |
#update_pool_information(pool_information) ⇒ Object
Add common pool information, like insert size and library type
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/request/library_creation.rb', line 14 def update_pool_information(pool_information) pool_information.merge!( insert_size: { from: insert_size.from, to: insert_size.to }, library_type: { name: library_type } ) end |