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": "123" }
      },
      "wells": [
        { "data": { "type": "wells", "id": "456" } },
        { "data": { "type": "wells", "id": "789" } }
      ],
    }
  }
}

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.



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

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.



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

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.



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

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.



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

attribute :size, write_once: true

#submission_poolsArray<SubmissionPoolResource> (readonly)

Returns An array of submission pools for this plate.

Returns:



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

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.



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

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.



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

has_many :wells, write_once: true