Module: SampleManifestExcel

Defined in:
app/sample_manifest_excel/sample_manifest_excel.rb,
app/sample_manifest_excel/sample_manifest_excel/tags.rb,
app/sample_manifest_excel/sample_manifest_excel/download.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/row.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/base.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/data.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/rows.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/cache.rb,
app/sample_manifest_excel/sample_manifest_excel/configuration.rb,
app/sample_manifest_excel/sample_manifest_excel/test_download.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor.rb,
app/sample_manifest_excel/sample_manifest_excel/tags/example_data.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/converters.rb,
app/sample_manifest_excel/sample_manifest_excel/manifest_type_list.rb,
app/sample_manifest_excel/sample_manifest_excel/tags/clashes_finder.rb,
app/sample_manifest_excel/sample_manifest_excel/tags/aliquot_updater.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor/base.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor/plate.rb,
app/sample_manifest_excel/sample_manifest_excel/worksheet/data_worksheet.rb,
app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb,
app/sample_manifest_excel/sample_manifest_excel/tags/validator/formatting.rb,
app/sample_manifest_excel/sample_manifest_excel/tags/validator/uniqueness.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor/tube_rack.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor/one_d_tube.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor/library_tube.rb,
app/sample_manifest_excel/sample_manifest_excel/upload/processor/multiplexed_library_tube.rb

Overview

Creates a Sample Manifest Excel spreadsheet from a Sample Manifest object

Defined Under Namespace

Modules: Tags, Upload, Worksheet Classes: Configuration, Download, ManifestTypeList, TestDownload

Constant Summary collapse

FIRST_ROW =
9

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/sample_manifest_excel/sample_manifest_excel.rb', line 14

 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

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'app/sample_manifest_excel/sample_manifest_excel.rb', line 18

 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

.reset!Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/sample_manifest_excel/sample_manifest_excel.rb', line 22

 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