Class: Api::V2::PlateResource

Inherits:
BaseResource
  • Object
show all
Includes:
SharedBehaviour::Labware
Defined in:
app/resources/api/v2/plate_resource.rb

Overview

Note:

This resource cannot be modified after creation: its endpoint will not accept PATCH requests.

Note:

Access this resource via the /api/v2/plates/ endpoint.

Provides a JSON:API representation of Plate which is plastic labware containing Wells. The plate has a purpose like all labware and this denotes which pipeline it is being used in and what type of samples it holds / how it will be processed. Plates are not typically created directly using this resource, although they can be. Rather they are created via resources such as PlateCreationResource.

}

For more information about JSON:API see the JSON:API Specifications or look at the JSONAPI::Resources package for Sequencescape's implementation of the JSON:API standard.

Examples:

POST request

POST /api/v2/plates/
{
  "data": {
      "type": "plates",
      "attributes": {
          "size": 96
      },
      "relationships": {
          "purpose": {
              "data": { "type": "purposes", "id": 1 }
          },
          "wells": {
              "data": [{ "type": "wells", "id": 4481 }]
          }
      }
  }

GET request for all Plate resources

GET /api/v2/plates/

GET request for a Plate with ID 123

GET /api/v2/plates/123/

Instance Attribute Summary collapse

Method Summary

Methods included from SharedBehaviour::Labware

#labware_barcode

Methods inherited from BaseResource

apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Attribute Details

#number_of_columnsInt (readonly)

Returns The number of columns on the plate. This is determined by the AssetShape assigned to the plate by its purpose.

Returns:

  • (Int)

    The number of columns on the plate. This is determined by the AssetShape assigned to the plate by its purpose.



64
# File 'app/resources/api/v2/plate_resource.rb', line 64

attribute :number_of_columns, readonly: true, delegate: :width

#number_of_rowsInt (readonly)

Returns The number of rows on the plate. This is determined by the AssetShape assigned to the plate by its purpose.

Returns:

  • (Int)

    The number of rows on the plate. This is determined by the AssetShape assigned to the plate by its purpose.



59
# File 'app/resources/api/v2/plate_resource.rb', line 59

attribute :number_of_rows, readonly: true, delegate: :height

#pooling_metadataHash (readonly)

Returns A hash containing submission UUIDs and corresponding pooling metadata.

Examples:

Hash representation

{
  "12345678-1234-1234-1234-1234567890ab": {
    "wells": ["A1", "A2", "A3"],
    "pool_complete": true,
    "insert_size": { "from": 1, "to": 1 },
    "library_type": { "name": "Bioscan" },
    "pcr_cycles": 0,
    "request_type": "limber_bioscan_library_prep",
    "for_multiplexing": false
  },
  "87654321-4321-4321-4321-ba0987654321": {
    "wells": ["B1", "B2", "B3"],
    "pool_complete": true,
    "insert_size": { "from": 1, "to": 1 },
    "library_type": { "name": "Bioscan" },
    "pcr_cycles": 0,
    "request_type": "limber_bioscan_library_prep",
    "for_multiplexing": false
  }
}

Returns:

  • (Hash)

    A hash containing submission UUIDs and corresponding pooling metadata.



95
# File 'app/resources/api/v2/plate_resource.rb', line 95

attribute :pooling_metadata, readonly: true

#sizeInt

Note:

This can only be set once during creation. If it is not set, it will default to 96.

Returns The total number of wells on the plate.

Returns:

  • (Int)

    The total number of wells on the plate.



70
# File 'app/resources/api/v2/plate_resource.rb', line 70

attribute :size, write_once: true

#submission_poolsArray<SubmissionPoolResource> (readonly)

Returns An array of submission pools for this plate.

Returns:



107
# File 'app/resources/api/v2/plate_resource.rb', line 107

has_many :submission_pools, readonly: true

#transfers_as_destinationArray<TransferResource> (readonly)

Returns An array of transfers with this plate as the destination.

Returns:

  • (Array<TransferResource>)

    An array of transfers with this plate as the destination.



111
# File 'app/resources/api/v2/plate_resource.rb', line 111

has_many :transfers_as_destination, readonly: true

#wellsArray<WellResource>

Note:

This can only be set once during creation.

Returns An array of wells on this plate.

Returns:

  • (Array<WellResource>)

    An array of wells on this plate.



116
# File 'app/resources/api/v2/plate_resource.rb', line 116

has_many :wells, write_once: true