Class: Api::V2::RequestMetadataResource

Inherits:
BaseResource
  • Object
show all
Defined in:
app/resources/api/v2/request_metadata_resource.rb

Overview

Note:

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

Provides a JSON:API representation of Metadata::Metadata. which is a class derived from app/models/metadata.rb

The RequestMetadataResource provides metadata information for requests, specifically including details like number_of_pools and cells_per_chip_well, which are critical for the scRNA Core pipeline. It is associated with a request.

For more details on JSON:API, see the JSON:API Specifications or check out the JSONAPI::Resources package for Sequencescape's implementation.

Examples:

GET request to retrieve all request metadata

GET /api/v2/request_metadata/

POST request to create new request metadata

POST /api/v2/request_metadata/
{
  "data": {
      "id": 1,
    "type": "request_metadata",
    "attributes": {
      // "number_of_pools": 5,
      // "cells_per_chip_well": 200
    },
    "relationships": {
      "request": {
        "data": {
          "type": "requests",
          "id": 1265
        }
      }
    }
  }
}

PATCH request to update existing request metadata

PATCH /api/v2/request_metadata/1
{
  "data": {
    "id": "1",
    "type": "request_metadata",
    "attributes": {
    }
  }
}

Instance Attribute Summary collapse

Method Summary

Methods inherited from BaseResource

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

Instance Attribute Details

#allowance_bandString (readonly)

Returns the allowance_band requested in the Submission. As used in the scRNA Core pipeline, it is specified at the Study-Project level: it will have the same value for all Requests that share the same Study and Project.

Returns:

  • (String)

    the allowance_band requested in the Submission. As used in the scRNA Core pipeline, it is specified at the Study-Project level: it will have the same value for all Requests that share the same Study and Project.



86
# File 'app/resources/api/v2/request_metadata_resource.rb', line 86

attribute :allowance_band, read_only: true

#cells_per_chip_wellInt

Returns the cells_per_chip_well requested in the Submission. As used in the scRNA Core pipeline, it is specified at the Study-Project level: it will have the same value for all Requests that share the same Study and Project. It is used for volume calculations for pooling.

Returns:

  • (Int)

    the cells_per_chip_well requested in the Submission. As used in the scRNA Core pipeline, it is specified at the Study-Project level: it will have the same value for all Requests that share the same Study and Project. It is used for volume calculations for pooling.



79
# File 'app/resources/api/v2/request_metadata_resource.rb', line 79

attribute :cells_per_chip_well, write_once: true

#number_of_poolsInt

Returns the number_of_pools requested in the Submission. As used in the scRNA Core pipeline, it is specified at the Study-Project level: it will have the same value for all Requests that share the same Study and Project. It is used in the pooling algorithm.

Returns:

  • (Int)

    the number_of_pools requested in the Submission. As used in the scRNA Core pipeline, it is specified at the Study-Project level: it will have the same value for all Requests that share the same Study and Project. It is used in the pooling algorithm.



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

attribute :number_of_pools, write_once: true