Module: SampleManifestExcel

Defined in:
lib/sample_manifest_excel.rb,
lib/sample_manifest_excel/tags.rb,
lib/sample_manifest_excel/download.rb,
lib/sample_manifest_excel/upload/row.rb,
lib/sample_manifest_excel/upload/base.rb,
lib/sample_manifest_excel/upload/data.rb,
lib/sample_manifest_excel/upload/rows.rb,
lib/sample_manifest_excel/upload/cache.rb,
lib/sample_manifest_excel/configuration.rb,
lib/sample_manifest_excel/test_download.rb,
lib/sample_manifest_excel/upload/processor.rb,
lib/sample_manifest_excel/tags/example_data.rb,
lib/sample_manifest_excel/upload/converters.rb,
lib/sample_manifest_excel/manifest_type_list.rb,
lib/sample_manifest_excel/tags/clashes_finder.rb,
lib/sample_manifest_excel/tags/aliquot_updater.rb,
lib/sample_manifest_excel/upload/processor/base.rb,
lib/sample_manifest_excel/upload/processor/plate.rb,
lib/sample_manifest_excel/worksheet/data_worksheet.rb,
lib/sample_manifest_excel/worksheet/test_worksheet.rb,
lib/sample_manifest_excel/tags/validator/formatting.rb,
lib/sample_manifest_excel/tags/validator/uniqueness.rb,
lib/sample_manifest_excel/upload/processor/tube_rack.rb,
lib/sample_manifest_excel/upload/processor/one_d_tube.rb,
lib/sample_manifest_excel/upload/processor/library_tube.rb,
lib/sample_manifest_excel/upload/processor/compound_tube.rb,
lib/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

.configuration ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/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 'lib/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 'lib/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