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
-
annotations V1::Pacbio::Runs::AnnotationResource
Relationship trees:
-
plates.wells.used_aliquots
-
smrt_link_version.smrt_link_option_versions
-
annotations
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.
62 63 64 65 66 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 62 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, :annotations_attributes |
#barcodes_and_concentrations ⇒ String (readonly)
Returns the barcodes and concentrations of the run.
70 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 70 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 43
|
#dna_control_complex_box_barcode ⇒ String
Returns the barcode of the DNA control complex box.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 43
|
#name ⇒ String
Returns the name of the run.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 43
|
#pacbio_smrt_link_version_id ⇒ Integer
Returns the ID of the PacBio SMRT Link version.
62 63 64 65 66 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 62 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, :annotations_attributes |
#plates_attributes ⇒ Array<Hash>
Returns the attributes of the plates.
62 63 64 65 66 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 62 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, :annotations_attributes |
#sequencing_kit_box_barcodes ⇒ Array<String> (readonly)
Returns the barcodes of the sequencing kits.
62 63 64 65 66 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 62 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, :annotations_attributes |
#state ⇒ String
Returns the state of the run.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 43
|
#system_name ⇒ String
Returns the name of the system.
|
# File 'app/resources/v1/pacbio/run_resource.rb', line 43
|
Class Method Details
.creatable_fields(context) ⇒ Object
123 124 125 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 123 def self.creatable_fields(context) super - %i[adaptive_loading sequencing_kit_box_barcodes] end |
.default_sort ⇒ Object
90 91 92 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 90 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
107 108 109 110 111 112 113 114 115 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 107 def self.resource_klass_for(type) if type == 'plates' super('runs/plates') elsif type == 'annotations' super('runs/annotations') else super end end |
.updatable_fields(context) ⇒ Object
127 128 129 |
# File 'app/resources/v1/pacbio/run_resource.rb', line 127 def self.updatable_fields(context) super - %i[adaptive_loading sequencing_kit_box_barcodes] end |