Class: V1::Pacbio::PoolResource
- Inherits:
-
JSONAPI::Resource
- Object
- JSONAPI::Resource
- V1::Pacbio::PoolResource
- Includes:
- Shared::RunSuitability
- Defined in:
- app/resources/v1/pacbio/pool_resource.rb
Overview
Access this resource via the /v1/pacbio/pools/ endpoint.
Provides a JSON:API representation of Pacbio::Pool.
Filters:
-
sample_name
-
barcode
Primary relationships:
-
tube TubeResource
-
used_aliquots AliquotResource
-
primary_aliquot AliquotResource
-
requests RequestResource
-
libraries LibraryResource
Relationship trees:
-
used_aliquots.tag.tag_set
-
requests.tube,tube
-
libraries.tube
-
libraries.request
-
requests.plate.wells.requests
curl -X POST “localhost:3100/v1/pacbio/pools” \ -H “accept: application/vnd.api+json” \ -H “Content-Type: application/vnd.api+json” \ -d ‘{ “data”: { “type”: “pools”, “attributes”: { “used_aliquots_attributes”: [ { “template_prep_kit_box_barcode”: “LK1234567”, “volume”: 1.11, “concentration”: 2.22, “insert_size”: 100, “source_id”: 1, “source_type”: “Pacbio::Request”, “tag_id”: 999 }, { “template_prep_kit_box_barcode”: “LK1234567”, “volume”: 1.11, “concentration”: 2.22, “insert_size”: 100, “source_id”: 2, “source_type”: “Pacbio::Request”, “tag_id”: 9999 } ], “primary_aliquot_attributes”: { “volume”: “200”, “concentration”: “22”, “template_prep_kit_box_barcode”: “100”, “insert_size”: “11” } } } }’
curl -X PATCH “localhost:3100/v1/pacbio/pools/1” \ -H “accept: application/vnd.api+json” \ -H “Content-Type: application/vnd.api+json” \ -d ‘{ data: { type: ’pools’, id: 1, attributes: { used_aliquots_attributes: [ { id: 10, source_id: 333, source_type: ‘Pacbio::Library’, template_prep_kit_box_barcode: ‘LK12345’, tag_id: 9999, volume: 1, concentration: 1, insert_size: 100 }, { source_id: 444, source_type: ‘Pacbio::Request’, template_prep_kit_box_barcode: ‘LK12345’, tag_id: 9998, volume: 1, concentration: 1, insert_size: 100 } ], primary_aliquot_attributes: { volume: ‘200’, concentration: ‘22’, template_prep_kit_box_barcode: ‘100’, insert_size: ‘11’ }, volume: ‘200’, concentration: ‘22’, template_prep_kit_box_barcode: ‘100’, insert_size: ‘11’, created_at: ‘2021-08-04T14:35:47.208Z’, updated_at: ‘2021-08-04T14:35:47.208Z’ } } }‘
Direct Known Subclasses
Constant Summary collapse
- ALIQUOT_ATTRIBUTES =
%w[id volume concentration template_prep_kit_box_barcode insert_size tag_id source_id source_type].freeze
Instance Attribute Summary collapse
-
#available_volume ⇒ Float
The available volume of the pool.
-
#barcode ⇒ String
readonly
The barcode of the pool (via tube).
-
#concentration ⇒ Float
The concentration of the pool.
-
#created_at ⇒ String
The creation time of the pool.
-
#insert_size ⇒ Integer
The insert size of the pool.
-
#library_attributes ⇒ Hash
The attributes of the library.
-
#primary_aliquot_attributes ⇒ Hash
The attributes of the primary aliquot.
-
#source_identifier ⇒ String
readonly
The source identifier of the pool.
-
#template_prep_kit_box_barcode ⇒ String
The barcode of the template prep kit box.
-
#updated_at ⇒ String
The last update time of the pool.
-
#used_aliquots_attributes ⇒ Array<Hash>
The attributes of the used aliquots.
-
#used_volume ⇒ Float
The used volume of the pool.
-
#volume ⇒ Float
The volume of the pool.
Class Method Summary collapse
Instance Method Summary collapse
- #fetchable_fields ⇒ Object
- #publish_messages_on_creation ⇒ Object
- #publish_messages_on_update ⇒ Object
Methods included from Shared::RunSuitability
Instance Attribute Details
#available_volume ⇒ Float
Returns the available volume of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#barcode ⇒ String (readonly)
Returns the barcode of the pool (via tube).
170 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 170 attribute :barcode, readonly: true |
#concentration ⇒ Float
Returns the concentration of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#created_at ⇒ String
Returns the creation time of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#insert_size ⇒ Integer
Returns the insert size of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#library_attributes ⇒ Hash
Returns the attributes of the library.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#primary_aliquot_attributes ⇒ Hash
Returns the attributes of the primary aliquot.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#source_identifier ⇒ String (readonly)
Returns the source identifier of the pool.
166 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 166 attribute :source_identifier, readonly: true |
#template_prep_kit_box_barcode ⇒ String
Returns the barcode of the template prep kit box.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#updated_at ⇒ String
Returns the last update time of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#used_aliquots_attributes ⇒ Array<Hash>
Returns the attributes of the used aliquots.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#used_volume ⇒ Float
Returns the used volume of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
#volume ⇒ Float
Returns the volume of the pool.
159 160 161 162 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 159 attributes :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :updated_at, :library_attributes, :used_aliquots_attributes, :primary_aliquot_attributes, :used_volume, :available_volume |
Class Method Details
.default_sort ⇒ Object
177 178 179 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 177 def self.default_sort [{ field: 'created_at', direction: :desc }] end |
.records_for_populate(*_args) ⇒ Object
213 214 215 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 213 def self.records_for_populate(*_args) super.preload(source_wells: :plate) end |
Instance Method Details
#fetchable_fields ⇒ Object
209 210 211 |
# File 'app/resources/v1/pacbio/pool_resource.rb', line 209 def fetchable_fields super - %i[library_attributes used_aliquots_attributes primary_aliquot_attributes] end |