-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1219 from sanger/pacbio-multiplexing-epic
[EPIC] PacBio multiplexing
- Loading branch information
Showing
55 changed files
with
1,301 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module Pacbio | ||
# Pacbio::WellLibrary | ||
# A well can contain many libraries | ||
# A library can belong in many wells | ||
class WellLibrary < ApplicationRecord | ||
belongs_to :well, class_name: 'Pacbio::Well', foreign_key: :pacbio_well_id, | ||
inverse_of: :well_libraries | ||
belongs_to :library, class_name: 'Pacbio::Library', foreign_key: :pacbio_library_id, | ||
inverse_of: :well_libraries | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module V1 | ||
module Pacbio | ||
# AliquotResource | ||
class AliquotResource < JSONAPI::Resource | ||
model_name '::Aliquot' | ||
|
||
attributes :aliquot_type, :source, :used_by, :state, | ||
:volume, :concentration, :insert_size, :template_prep_kit_box_barcode, :tag_id | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
module V1 | ||
module Pacbio | ||
# A temporary PacBio Library resource that returns all libraries | ||
# This allows for pool libraries to be retrieved from the pools resource | ||
class LibraryPoolResource < JSONAPI::Resource | ||
include Shared::RunSuitability | ||
|
||
model_name 'Pacbio::Library' | ||
|
||
attributes :state, :volume, :concentration, :template_prep_kit_box_barcode, | ||
:insert_size, :created_at, :deactivated_at, :source_identifier, | ||
:pacbio_request_id, :tag_id | ||
|
||
has_one :request, always_include_optional_linkage_data: true | ||
# If we don't specify the relation_name here, jsonapi-resources | ||
# attempts to use_related_resource_records_for_joins | ||
# In this case I can see it using container_associations | ||
# so seems to be linking the wrong tube relationship. | ||
has_one :tag, always_include_optional_linkage_data: true | ||
has_one :pool, always_include_optional_linkage_data: true | ||
has_one :tube, relation_name: :tube, always_include_optional_linkage_data: true | ||
has_one :source_well, relation_name: :source_well, class_name: 'Well' | ||
has_one :source_plate, relation_name: :source_plate, class_name: 'Plate' | ||
|
||
has_one :primary_aliquot, always_include_optional_linkage_data: true, | ||
relation_name: :primary_aliquot, class_name: 'Aliquot' | ||
|
||
def self.records_for_populate(*_args) | ||
super.preload(source_well: :plate, request: :sample, | ||
tag: :tag_set, | ||
container_material: { container: :barcode }) | ||
end | ||
|
||
def created_at | ||
@model.created_at.to_fs(:us) | ||
end | ||
|
||
def deactivated_at | ||
@model&.deactivated_at&.to_fs(:us) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.