Module: Pulldown::PlatePurposes

Defined in:
app/models/pulldown/plate_purposes.rb

Overview

TODO:

#2396 Remove

This module contains methods associated with the now defunct Pulldown pipleine.

This module was used to generate the purposes and their associations as part of both the seeds and the original migration.

Removal of this code shouldn't affect production, but will disrupt seeds, and potentially a number of cucumber features. It will probably also require the corresponding search objects to be deprecated.

Constant Summary collapse

ISCH_PURPOSE_FLOWS =
[
  [
    'Lib PCR-XP',
    'ISCH lib pool',
    'ISCH hyb',
    'ISCH cap lib',
    'ISCH cap lib PCR',
    'ISCH cap lib PCR-XP',
    'ISCH cap lib pool'
  ]
].freeze
PLATE_PURPOSE_FLOWS =
[
  [
    'WGS stock DNA',
    'WGS Covaris',
    'WGS post-Cov',
    'WGS post-Cov-XP',
    'WGS lib',
    'WGS lib PCR',
    'WGS lib PCR-XP',
    'WGS lib pool'
  ],
  [
    'SC stock DNA',
    'SC Covaris',
    'SC post-Cov',
    'SC post-Cov-XP',
    'SC lib',
    'SC lib PCR',
    'SC lib PCR-XP',
    'SC hyb',
    'SC cap lib',
    'SC cap lib PCR',
    'SC cap lib PCR-XP',
    'SC cap lib pool'
  ],
  [
    'ISC stock DNA',
    'ISC Covaris',
    'ISC post-Cov',
    'ISC post-Cov-XP',
    'ISC lib',
    'ISC lib PCR',
    'ISC lib PCR-XP',
    'ISC lib pool',
    'ISC hyb',
    'ISC cap lib',
    'ISC cap lib PCR',
    'ISC cap lib PCR-XP',
    'ISC cap lib pool'
  ],
  ISCH_PURPOSE_FLOWS.first
].freeze
STOCK_PLATE_PURPOSES =
['WGS stock DNA', 'SC stock DNA', 'ISC stock DNA'].freeze

Class Method Summary collapse

Class Method Details

.create_purposes(branch) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'app/models/pulldown/plate_purposes.rb', line 74

 do
  # NOTE: The following attribute is not required for Microarray Genotyping.
  # I think this might be broken and suggests that there should be separate classes for project: one for
  # next-gen sequencing that includes this attribute in it's metadata, and one for microarray genotyping
  # that doesn't.
  include ProjectManager::Associations
  include BudgetDivision::Associations

  custom_attribute(:project_cost_code, required: true)
  custom_attribute(:funding_comments)
  custom_attribute(:collaborators)
  custom_attribute(:external_funding_source)
  custom_attribute(:sequencing_budget_cost_centre)
  custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
  custom_attribute(:gt_committee_tracking_id)

  before_validation do |record|
    record.project_cost_code = nil if record.project_cost_code.blank?
    record.project_funding_model = nil if record.project_funding_model.blank?
  end
end