Class: V1::Pacbio::RunResource
- Inherits:
-
JSONAPI::Resource
- Object
- JSONAPI::Resource
- V1::Pacbio::RunResource
- Defined in:
- app/resources/v1/pacbio/run_resource.rb
Overview
Provides a JSON:API representation of Pacbio::Run.
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 Run and can return all runs, a single run or multiple runs along with their relationships. It can also create and update runs and their nested relationships via the plates_attributes parameter. These actions also publish run messages to the warehouse.
Filters:
-
name
-
state
Primary relationships:
-
plates PlateResource
-
smrt_link_version SmrtLinkVersionResource
Relationship trees:
-
plates.wells.used_aliquots
-
smrt_link_version.smrt_link_option_versions
Constant Summary collapse
- PERMITTED_WELL_PARAMETERS =
Well parameters that are permitted for the plates_attributes
%i[ id row column comment ].concat(Rails.configuration.pacbio_smrt_link_versions..keys).freeze
Instance Attribute Summary collapse
-
#adaptive_loading ⇒ Boolean
readonly
Whether adaptive loading is used.
-
#barcodes_and_concentrations ⇒ String
readonly
The barcodes and concentrations of the run.
-
#created_at ⇒ String
The creation time of the run.
-
#dna_control_complex_box_barcode ⇒ String
The barcode of the DNA control complex box.
-
#name ⇒ String
The name of the run.
-
#pacbio_smrt_link_version_id ⇒ Integer
The ID of the PacBio SMRT Link version.
-
#plates_attributes ⇒ Array<Hash>
readonly
The attributes of the plates.
-
#sequencing_kit_box_barcodes ⇒ Array<String>
readonly
The barcodes of the sequencing kits.
-
#state ⇒ String
The state of the run.
-
#system_name ⇒ String
The name of the system.
Class Method Summary collapse
- .creatable_fields(context) ⇒ Object
- .default_sort ⇒ Object
-
.resource_klass_for(type) ⇒ Object
JSON API Resources builds up a representation of the relationships on a give resource.
- .updatable_fields(context) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#adaptive_loading ⇒ Boolean (readonly)
Returns whether adaptive loading is used.
60 61 62 63 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 60 attributes :name, :dna_control_complex_box_barcode, :system_name, :created_at, :state, :pacbio_smrt_link_version_id, :plates_attributes, :adaptive_loading, :sequencing_kit_box_barcodes |
#barcodes_and_concentrations ⇒ String (readonly)
Returns the barcodes and concentrations of the run.
67 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 67 attribute :barcodes_and_concentrations, readonly: true |
#created_at ⇒ String
Returns the creation time of the run.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 41
|
#dna_control_complex_box_barcode ⇒ String
Returns the barcode of the DNA control complex box.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 41
|
#name ⇒ String
Returns the name of the run.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 41
|
#pacbio_smrt_link_version_id ⇒ Integer
Returns the ID of the PacBio SMRT Link version.
60 61 62 63 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 60 attributes :name, :dna_control_complex_box_barcode, :system_name, :created_at, :state, :pacbio_smrt_link_version_id, :plates_attributes, :adaptive_loading, :sequencing_kit_box_barcodes |
#plates_attributes ⇒ Array<Hash>
Returns the attributes of the plates.
60 61 62 63 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 60 attributes :name, :dna_control_complex_box_barcode, :system_name, :created_at, :state, :pacbio_smrt_link_version_id, :plates_attributes, :adaptive_loading, :sequencing_kit_box_barcodes |
#sequencing_kit_box_barcodes ⇒ Array<String> (readonly)
Returns the barcodes of the sequencing kits.
60 61 62 63 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 60 attributes :name, :dna_control_complex_box_barcode, :system_name, :created_at, :state, :pacbio_smrt_link_version_id, :plates_attributes, :adaptive_loading, :sequencing_kit_box_barcodes |
#state ⇒ String
Returns the state of the run.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 41
|
#system_name ⇒ String
Returns the name of the system.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 41
|
Class Method Details
.creatable_fields(context) ⇒ Object
116 117 118 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 116 def self.creatable_fields(context) super - %i[adaptive_loading sequencing_kit_box_barcodes] end |
.default_sort ⇒ Object
85 86 87 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 85 def self.default_sort [{ field: 'created_at', direction: :desc }] end |
.resource_klass_for(type) ⇒ Object
JSON API Resources builds up a representation of the relationships on a give resource. Whilst doing to it asks the associated resource for its type, before using this method on the parent resource to attempt to look up the model. Unfortunately this results in V1::Pacbio::PlateResource by default. We should probably consider renaming Runs::Plate to something like Runs::PacBioPlate thereby updating the type. However this will also need updates to routes, and the front end. i.e. this is needed for GET /v1/pacbio/runs?include=plate
102 103 104 105 106 107 108 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 102 def self.resource_klass_for(type) if type == 'plates' super('runs/plates') else super end end |
.updatable_fields(context) ⇒ Object
120 121 122 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 120 def self.updatable_fields(context) super - %i[adaptive_loading sequencing_kit_box_barcodes] end |