Class: V1::Pacbio::LibraryResource
- Inherits:
-
JSONAPI::Resource
- Object
- JSONAPI::Resource
- V1::Pacbio::LibraryResource
- Defined in:
- app/resources/v1/pacbio/library_resource.rb
Overview
Provides a JSON:API representation of Pacbio::Library.
For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for the service implementation of the JSON:API standard. This resource represents a Pacbio Library and can return all libraries, a single library or multiple libraries along with their relationships.
Filters:
-
sample_name
-
barcode
-
source_identifier
Primary relationships:
-
request RequestResource
-
tube TubeResource
-
pool PoolResource
Relationship trees:
-
request.sample
-
tube.requests
-
pool.libraries
Direct Known Subclasses
Instance Attribute Summary collapse
-
#available_volume ⇒ Float
The available volume of the library.
-
#barcode ⇒ String
readonly
The barcode of the library (via tube).
-
#concentration ⇒ Float
The concentration of the library.
-
#created_at ⇒ String
The creation time of the library.
-
#deactivated_at ⇒ DateTime?
The deactivation time of the library, or nil if not deactivated.
-
#insert_size ⇒ Integer
The insert size of the library.
-
#pacbio_request_id ⇒ Integer
The ID of the associated PacBio request.
-
#primary_aliquot_attributes ⇒ Hash
The attributes of the primary aliquot.
-
#source_identifier ⇒ String
The source identifier of the library.
-
#state ⇒ String
The state of the library.
-
#tag_id ⇒ Integer
The ID of the associated tag.
-
#template_prep_kit_box_barcode ⇒ String
The barcode of the template prep kit box.
-
#used_volume ⇒ Float
The used volume of the library.
-
#volume ⇒ Float
The volume of the library.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Shared::RunSuitability
Instance Attribute Details
#available_volume ⇒ Float
Returns the available volume of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#barcode ⇒ String (readonly)
Returns the barcode of the library (via tube).
82 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 82 attribute :barcode, readonly: true |
#concentration ⇒ Float
Returns the concentration of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#created_at ⇒ String
Returns the creation time of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#deactivated_at ⇒ DateTime?
Returns the deactivation time of the library, or nil if not deactivated.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#insert_size ⇒ Integer
Returns the insert size of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#pacbio_request_id ⇒ Integer
Returns the ID of the associated PacBio request.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#primary_aliquot_attributes ⇒ Hash
Returns the attributes of the primary aliquot.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#source_identifier ⇒ String
Returns the source identifier of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#state ⇒ String
Returns the state of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#tag_id ⇒ Integer
Returns the ID of the associated tag.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#template_prep_kit_box_barcode ⇒ String
Returns the barcode of the template prep kit box.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#used_volume ⇒ Float
Returns the used volume of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
#volume ⇒ Float
Returns the volume of the library.
75 76 77 78 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 75 attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, :insert_size, :created_at, :deactivated_at, :source_identifier, :pacbio_request_id, :tag_id, :primary_aliquot_attributes, :used_volume, :available_volume |
Class Method Details
.default_sort ⇒ Object
101 102 103 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 101 def self.default_sort [{ field: 'created_at', direction: :desc }] end |
.records_for_populate(*_args) ⇒ Object
129 130 131 132 133 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 129 def self.records_for_populate(*_args) super.preload(source_well: :plate, request: :sample, tag: :tag_set, container_material: { container: :barcode }) end |
Instance Method Details
#fetchable_fields ⇒ Object
142 143 144 |
# File 'app/resources/v1/pacbio/library_resource.rb', line 142 def fetchable_fields super - [:primary_aliquot_attributes] end |