Class: SequencingRequest

Inherits:
CustomerRequest show all
Extended by:
Request::AccessioningRequired
Includes:
Api::Messages::FlowcellIO::LaneExtensions, Request::CustomerResponsibility
Defined in:
app/models/sequencing_request.rb

Defined Under Namespace

Classes: RequestOptionsValidator

Constant Summary

Constants included from Metadata

Metadata::SECTION_FIELDS

Constants included from Request::Statemachine

Request::Statemachine::ACTIVE, Request::Statemachine::COMPLETED_STATE, Request::Statemachine::INACTIVE, Request::Statemachine::OPENED_STATE, Request::Statemachine::SORT_ORDER

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Request::AccessioningRequired

accessioning_required?

Methods included from Request::CustomerResponsibility

included

Methods inherited from CustomerRequest

#biffable?, #can_be_billed?, #create_billing_events, #customer_accepts_responsibility!, #generate_create_request_event, #generate_destroy_request_event, #generate_request_event, #update_responsibilities!

Methods inherited from Request

accessioning_required?, #add_comment, #aliquot_attributes, #associated_studies, #cancelable?, #copy, #current_request_event, #customer_accepts_responsibility!, #event_with_key_value, #eventful_studies, for_study, #format_qc_information, #get_value, #has_passed, #lab_events_for_batch, #manifest_processed!, #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=, #request_type_updatable?, #return_pending_to_inbox!, #run_events, #source_labware, #study=, #study_id=, #submitted_at, #target_purpose, #target_tube, #update_pool_information, #update_priority, #update_responsibilities!, #value_for

Methods included from Metadata

#has_metadata, required_tags

Methods included from EventfulRecord

#has_many_events, #has_many_lab_events, #has_one_event_with_family

Methods included from Request::Statistics

#asset_statistics, #progress_statistics, #sample_statistics_new

Methods included from Batch::RequestBehaviour

#create_batch_request!, included, #recycle_from_batch!, #return_for_inbox!, #with_batch_id

Methods included from Request::Statemachine

#cancellable?, #change_decision!, #closed?, #failed_downstream!, #failed_upstream!, #finished?, included, #on_blocked, #on_cancelled, #on_failed, #on_hold, #on_passed, #open?, #terminated?, #transfer_aliquots, #transition_to

Methods included from StandardNamedScopes

included

Methods included from Commentable

#after_comment_addition

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods included from Api::RequestIO::Extensions

included, #json_root

Methods included from Aliquot::DeprecatedBehaviours::Request

#sample_name, #tag, #tag_number

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

Class Method Details

.delegate_validatorObject


59
60
61
# File 'app/models/sequencing_request.rb', line 59

def self.delegate_validator
  SequencingRequest::RequestOptionsValidator
end

Instance Method Details

#billing_product_identifierObject


74
75
76
# File 'app/models/sequencing_request.rb', line 74

def billing_product_identifier
  .read_length
end

#concentrationObject


63
64
65
66
67
68
69
70
71
72
# File 'app/models/sequencing_request.rb', line 63

def concentration
  return ' ' if lab_events_for_batch(batch).empty?

  conc = lab_events_for_batch(batch).first.descriptor_value('Concentration')
  return "#{conc}μl" if conc.present?

  dna = lab_events_for_batch(batch).first.descriptor_value('DNA Volume')
  rsb = lab_events_for_batch(batch).first.descriptor_value('RSB Volume')
  "#{dna}μl DNA in #{rsb}μl RSB"
end

#on_startedObject


35
36
37
38
# File 'app/models/sequencing_request.rb', line 35

def on_started
  super
  transfer_aliquots
end

#order=(_) ⇒ Object


40
41
42
# File 'app/models/sequencing_request.rb', line 40

def order=(_)
  # Do nothing
end

#ready?Boolean

Returns true if a request is read for batching

Returns:

  • (Boolean)

45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'app/models/sequencing_request.rb', line 45

def ready?
  # Reject any requests with missing or empty assets.
  # We use most tagged aliquot here, as its already loaded.
  return false if asset.nil? || asset.most_tagged_aliquot.nil?
  # Rejects any assets which haven't been scanned in
  return false if asset.scanned_in_date.blank?

  # It's ready if I don't have any lib creation requests or if all my lib creation requests are closed and
  # at least one of them is in 'passed' status
  upstream_requests.empty? ||
    upstream_requests.all?(&:closed?) &&
      upstream_requests.any?(&:passed?)
end