Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y24-245 Allow submission from Stock Plate_for the 10x - CITEseq and Emseq pipelines #4322

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
6 changes: 5 additions & 1 deletion app/models/plate_purpose.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def pool_wells(wells) # rubocop:todo Metrics/MethodLength
has_many :plates

def self.stock_plate_purpose
PlatePurpose.create_with(stock_plate: true, cherrypickable_target: true).find_or_create_by!(name: 'Stock Plate')
PlatePurpose.create_with(
stock_plate: true,
cherrypickable_target: true,
type: 'PlatePurpose::Input'
).find_or_create_by!(name: 'Stock Plate')
end

def size
Expand Down
3 changes: 1 addition & 2 deletions app/models/tag_layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ class TagLayout < ApplicationRecord

# The plate we'll be laying out the tags into
belongs_to :plate, optional: false

validates :direction, inclusion: { in: DIRECTION_ALGORITHMS.keys }
validates :walking_by, inclusion: { in: WALKING_ALGORITHMS.keys }

validates :direction_algorithm, presence: true
validates :walking_algorithm, presence: true

# After creating the instance we can layout the tags into the wells.
after_create :layout_tags_into_wells, if: :valid?

after_create :layout_tags_into_wells, if: :valid?
set_target_for_owner(:plate)

delegate :direction, to: :direction_algorithm_module
Expand Down
2 changes: 2 additions & 0 deletions config/default_records/plate_purposes/005_limber_purposes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ LTN Cherrypick: *limber_input_96
LHR RT: *limber_input_96
LTHR RT: *limber_input_96
LTHR Cherrypick: *limber_input_96
Stock Plate: *limber_input_96

PF Cherrypicked:
<<: *limber_input_96
default_state: passed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ limber_pcr_bespoke:
acceptable_purposes:
- LBB Cherrypick
- LBC Cherrypick
- Stock Plate
library_types:
- ChIP-Seq Auto
- Chromium single cell HTO
Expand Down
3 changes: 0 additions & 3 deletions db/seeds/0001_snp_plate_purposes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
cherrypickable_target: true
stock_plate: false
prefix: WD
- name: Stock Plate
stock_plate: true
cherrypickable_target: true
- name: 40ng
- name: Whole Genome Amplification
cherrypickable_target: true
Expand Down
81 changes: 0 additions & 81 deletions features/api/tag_layouts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -55,46 +55,6 @@ Feature: Access tag layouts through the API
}
"""

@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools
Given the Baracoda barcode service returns "SQPD-1000001"
Given the Baracoda barcode service returns "SQPD-1000002"
Given the tag group "Example Tag Group" exists
And the UUID for the tag group "Example Tag Group" is "00000000-1111-2222-3333-444444444444"
And the tag group "Example Tag Group" has 20 tags

Given a "Stock plate" plate called "Testing the API" exists
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 12, 8, 20, 12, 8, 20, 16

When I make an authorised POST with the following JSON to the API path "/tag_layouts":
"""
{
"tag_layout": {
"plate": "11111111-2222-3333-4444-000000000001",
"user": "99999999-8888-7777-6666-555555555555",
"tag_group": "00000000-1111-2222-3333-444444444444",
"direction": "column",
"walking_by": "manual by pool",
"initial_tag": 0
}
}
"""
Then the HTTP response should be "201 Created"

Then the tag layout on the plate "Testing the tagging" should be:
| TAG1 | TAG9 | TAG5 | TAG5 | TAG13 | TAG1 | TAG9 | TAG5 | TAG5 | TAG13 | TAG1 | TAG9 |
| TAG2 | TAG10 | TAG6 | TAG6 | TAG14 | TAG2 | TAG10 | TAG6 | TAG6 | TAG14 | TAG2 | TAG10 |
| TAG3 | TAG11 | TAG7 | TAG7 | TAG15 | TAG3 | TAG11 | TAG7 | TAG7 | TAG15 | TAG3 | TAG11 |
| TAG4 | TAG12 | TAG8 | TAG8 | TAG16 | TAG4 | TAG12 | TAG8 | TAG8 | TAG16 | TAG4 | TAG12 |
| TAG5 | TAG1 | TAG1 | TAG9 | TAG17 | TAG5 | TAG1 | TAG1 | TAG9 | TAG17 | TAG5 | TAG13 |
| TAG6 | TAG2 | TAG2 | TAG10 | TAG18 | TAG6 | TAG2 | TAG2 | TAG10 | TAG18 | TAG6 | TAG14 |
| TAG7 | TAG3 | TAG3 | TAG11 | TAG19 | TAG7 | TAG3 | TAG3 | TAG11 | TAG19 | TAG7 | TAG15 |
| TAG8 | TAG4 | TAG4 | TAG12 | TAG20 | TAG8 | TAG4 | TAG4 | TAG12 | TAG20 | TAG8 | TAG16 |

@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools
Expand Down Expand Up @@ -179,47 +139,6 @@ Feature: Access tag layouts through the API
| TAG8 | TAG16 | TAG24 | TAG32 | TAG40 | TAG47 | TAG55 | TAG63 | TAG71 | TAG79 | TAG87 | TAG95 |


@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools with an offset
Given the Baracoda barcode service returns "SQPD-1000001"
Given the Baracoda barcode service returns "SQPD-1000002"
Given the tag group "Example Tag Group" exists
And the UUID for the tag group "Example Tag Group" is "00000000-1111-2222-3333-444444444444"
And the tag group "Example Tag Group" has 30 tags

Given a "Stock plate" plate called "Testing the API" exists
And the UUID for the plate "Testing the API" is "11111111-2222-3333-4444-000000000002"
And all wells on the plate "Testing the API" have unique samples

Given a "Stock plate" plate called "Testing the tagging" exists
And the UUID for the plate "Testing the tagging" is "11111111-2222-3333-4444-000000000001"
And the wells for the plate "Testing the API" have been pooled to the plate "Testing the tagging" according to the pooling strategy 12, 8, 20, 12, 8, 20, 16

When I make an authorised POST with the following JSON to the API path "/tag_layouts":
"""
{
"tag_layout": {
"plate": "11111111-2222-3333-4444-000000000001",
"user": "99999999-8888-7777-6666-555555555555",
"tag_group": "00000000-1111-2222-3333-444444444444",
"direction": "column",
"walking_by": "manual by pool",
"initial_tag": 10
}
}
"""
Then the HTTP response should be "201 Created"

Then the tag layout on the plate "Testing the tagging" should be:
| TAG11 | TAG19 | TAG15 | TAG15 | TAG23 | TAG11 | TAG19 | TAG15 | TAG15 | TAG23 | TAG11 | TAG19 |
| TAG12 | TAG20 | TAG16 | TAG16 | TAG24 | TAG12 | TAG20 | TAG16 | TAG16 | TAG24 | TAG12 | TAG20 |
| TAG13 | TAG21 | TAG17 | TAG17 | TAG25 | TAG13 | TAG21 | TAG17 | TAG17 | TAG25 | TAG13 | TAG21 |
| TAG14 | TAG22 | TAG18 | TAG18 | TAG26 | TAG14 | TAG22 | TAG18 | TAG18 | TAG26 | TAG14 | TAG22 |
| TAG15 | TAG11 | TAG11 | TAG19 | TAG27 | TAG15 | TAG11 | TAG11 | TAG19 | TAG27 | TAG15 | TAG23 |
| TAG16 | TAG12 | TAG12 | TAG20 | TAG28 | TAG16 | TAG12 | TAG12 | TAG20 | TAG28 | TAG16 | TAG24 |
| TAG17 | TAG13 | TAG13 | TAG21 | TAG29 | TAG17 | TAG13 | TAG13 | TAG21 | TAG29 | TAG17 | TAG25 |
| TAG18 | TAG14 | TAG14 | TAG22 | TAG30 | TAG18 | TAG14 | TAG14 | TAG22 | TAG30 | TAG18 | TAG26 |

@tag_layout @create @barcode-service
Scenario: Creating a tag layout of an entire plate using 96 tags by pools with an offset
Given the Baracoda barcode service returns "SQPD-1000001"
Expand Down
1 change: 1 addition & 0 deletions features/support/step_definitions/plate_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@

Given /^a "([^"]+)" plate called "([^"]+)" exists$/ do |name, plate_name|
plate_purpose = PlatePurpose.find_by!(name: name)
# binding.pry
plate_purpose.create!(name: plate_name)
end

Expand Down
2 changes: 1 addition & 1 deletion features/support/step_definitions/tag_layout_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def plate_view_of_oligos(label, mapping) # rubocop:todo Metrics/AbcSize

def check_tag_layout(name, well_range, expected_wells_to_oligos) # rubocop:todo Metrics/MethodLength
plate = Plate.find_by(name: name) or raise StandardError, "Cannot find plate #{name.inspect}"

wells_to_oligos =
plate
.wells
.filter_map do |w|
next unless well_range.include?(w)

[w.map.description, w.primary_aliquot.try(:tag).try(:oligo) || '']
end
.to_h
Expand Down
1 change: 0 additions & 1 deletion spec/support/download_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def self.downloads
end

def self.downloaded_file(file, timeout: TIMEOUT)
# binding.pry
wait_for_download(file, timeout)
File.read(path_to(file))
ensure
Expand Down
Loading