Class: Api::V2::AliquotResource

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

Overview

Note:

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

Provides a JSON:API representation of Aliquot, which represents a specific portion of material within a liquid. This material could be the DNA of a sample, or it might be a library (a combination of the DNA sample and a tag).

}

For more information about JSON:API, see the JSON:API Specifications or the JSONAPI::Resources package, which implements JSON:API for Sequencescape.

Examples:

POST request to create an aliquot with associated relationships

POST /api/v2/aliquots/
{
  "data": {
    "type": "aliquots",
    "attributes": {
      "suboptimal": false,
      "library_type": "RNA",
      "insert_size_to": 400
    },
    "relationships": {
      "study": { "data": { "type": "studies", "id": "123" } },
      "project": { "data": { "type": "projects", "id": "456" } },
      "sample": { "data": { "type": "samples", "id": "789" } },
      "request": { "data": { "type": "requests", "id": "321" } },
      "receptacle": { "data": { "type": "receptacles", "id": "654" } },
      "tag": { "data": { "type": "tags", "id": "987" } },
      "tag2": { "data": { "type": "tags", "id": "876" } },
      "library": { "data": { "type": "receptacles", "id": "555" } }
    }
  }

GET request for all Aliquot resources

GET /api/v2/aliquots/

GET request for a specific Aliquot by ID

GET /api/v2/aliquots/123/

Filtering by project ID

GET /api/v2/aliquots/?filter[project]=456

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

#insert_size_toInteger?

Returns The upper bound of the insert size range for sequencing.

Returns:

  • (Integer, nil)

    The upper bound of the insert size range for sequencing.



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

attribute :insert_size_to, write_once: true

#libraryLibraryResource

Returns The library associated with this aliquot.

Returns:

  • (LibraryResource)

    The library associated with this aliquot.



122
# File 'app/resources/api/v2/aliquot_resource.rb', line 122

has_one :library

#library_typeString

Returns The type of library associated with this aliquot.

Returns:

  • (String)

    The type of library associated with this aliquot.



82
# File 'app/resources/api/v2/aliquot_resource.rb', line 82

attribute :library_type, write_once: true

#projectProjectResource

Returns The project this aliquot belongs to.

Returns:



98
# File 'app/resources/api/v2/aliquot_resource.rb', line 98

has_one :project

#receptacleReceptacleResource

Returns The receptacle (well or tube) containing this aliquot.

Returns:



110
# File 'app/resources/api/v2/aliquot_resource.rb', line 110

has_one :receptacle

#requestRequestResource

Returns The request associated with this aliquot.

Returns:



106
# File 'app/resources/api/v2/aliquot_resource.rb', line 106

has_one :request

#sampleSampleResource

Returns The sample that this aliquot represents.

Returns:



102
# File 'app/resources/api/v2/aliquot_resource.rb', line 102

has_one :sample

#studyStudyResource

Returns The study associated with this aliquot.

Returns:



94
# File 'app/resources/api/v2/aliquot_resource.rb', line 94

has_one :study

#suboptimalBoolean

Returns Indicates whether this aliquot is considered suboptimal.

Returns:

  • (Boolean)

    Indicates whether this aliquot is considered suboptimal.



78
# File 'app/resources/api/v2/aliquot_resource.rb', line 78

attribute :suboptimal, write_once: true

#tagTagResource

Returns The primary tag associated with this aliquot.

Returns:

  • (TagResource)

    The primary tag associated with this aliquot.



114
# File 'app/resources/api/v2/aliquot_resource.rb', line 114

has_one :tag

#tag2TagResource

Returns The secondary tag associated with this aliquot.

Returns:

  • (TagResource)

    The secondary tag associated with this aliquot.



118
# File 'app/resources/api/v2/aliquot_resource.rb', line 118

has_one :tag2

#tag2_indexInteger?

Deprecated.

Use #tag2 instead.

Note:

This attribute is read-only; the write_once functionality is unimplemented.

Retrieves the index of the secondary tag.

Returns:

  • (Integer, nil)

    The index of the secondary tag, if available.



74
# File 'app/resources/api/v2/aliquot_resource.rb', line 74

attribute :tag2_index, write_once: true

#tag2_oligoString?

Deprecated.

Use #tag2 instead.

Note:

This attribute is read-only; the write_once functionality is unimplemented.

Retrieves the oligo sequence of the secondary tag.

Returns:

  • (String, nil)

    The oligo sequence of the secondary tag, if available.



68
# File 'app/resources/api/v2/aliquot_resource.rb', line 68

attribute :tag2_oligo, write_once: true

#tag_indexInteger?

Deprecated.

Use #tag instead.

Note:

This attribute is read-only; the write_once functionality is unimplemented.

Retrieves the index of the primary tag.

Returns:

  • (Integer, nil)

    The index of the primary tag, if available.



62
# File 'app/resources/api/v2/aliquot_resource.rb', line 62

attribute :tag_index, write_once: true

#tag_oligoString?

Deprecated.

Use #tag instead.

Note:

This attribute is read-only; the write_once functionality is unimplemented.

Retrieves the oligo sequence of the primary tag.

Returns:

  • (String, nil)

    The oligo sequence of the primary tag, if available.



56
# File 'app/resources/api/v2/aliquot_resource.rb', line 56

attribute :tag_oligo, write_once: true