Module: AvitiSampleSheet::SampleSheetGenerator

Defined in:
app/controllers/aviti_sample_sheet/sample_sheet_generator.rb

Overview

This module is responsible for generating a sequencing run manifest file for the Element Aviti machines. The run manifest format can support different configurations, but this implementation is tailored to the specific template used in Sanger's lab.

The generated file includes structured sections:

  • A [SETTINGS] section with static sequencing parameters used in the lab.
  • A [SAMPLES] section containing static PhiX control sample entries.
  • A dynamic sample section populated from the batch object.

The sequencing settings section is static, defining the consistent parameters applied in our lab. The PhiX control samples section is also static, as no metadata about the actual PhiX controls is stored. Element recommends using a consistent sample name that clearly identifies the control sequences.

Allowed characters in the output file name include: letters, numbers, dashes, dots, parentheses, and underscores. In the next phase, we will add support for use cases where the samples in the pool have different index lengths(https://docs.elembio.io/docs/run-manifest/samples/#reconciling)

Defined Under Namespace

Classes: Generator

Class Method Summary collapse

Class Method Details

.generate(batch) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/aviti_sample_sheet/sample_sheet_generator.rb', line 20

 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