Class: Sequencescape::Api::V2::Aliquot

Inherits:
Base
  • Object
show all
Defined in:
app/sequencescape/sequencescape/api/v2/aliquot.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#equivalent_attributesObject

This is our best attempt at mimicking the equivalent aliquot behaviour over in Sequencescape Aliquot::equivalent_attributes We use a smaller subset of attributes here, to avoid sending everything over the api. In future we could consider:

  1. Sending over all attributes

  2. Hashing the attributes sequencescape side and sending that over.

But for the moment this will suffice, as in practice existing process should ensure that these values are sufficient. In the event these assumptions are violated, Sequencescape will still prevent the transfer, it just wont be as user-friendly.



25
26
27
# File 'app/sequencescape/sequencescape/api/v2/aliquot.rb', line 25

def equivalent_attributes
  [request_id || request.id, suboptimal]
end

#order_groupObject



34
35
36
# File 'app/sequencescape/sequencescape/api/v2/aliquot.rb', line 34

def order_group
  [relationships.study.dig(:data, :id), relationships.project.dig(:data, :id)]
end

#tag_pairObject

Returns the combination of tag and tag2 oligos for the aliquot



30
31
32
# File 'app/sequencescape/sequencescape/api/v2/aliquot.rb', line 30

def tag_pair
  [tag_oligo, tag2_oligo]
end

#tagged?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/sequencescape/sequencescape/api/v2/aliquot.rb', line 11

def tagged?
  tag_oligo.present? || tag2_oligo.present?
end