Class: SampleManifestExcel::Worksheet::TestWorksheet
- Inherits:
-
SequencescapeExcel::Worksheet::Base
- Object
- SequencescapeExcel::Worksheet::Base
- SampleManifestExcel::Worksheet::TestWorksheet
- Includes:
- SequencescapeExcel::Helpers::Worksheet
- Defined in:
- app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb
Overview
A test worksheet is necessary for testing uploads.
Constant Summary
Constants included from SequencescapeExcel::Helpers::Worksheet
SequencescapeExcel::Helpers::Worksheet::STYLES
Instance Attribute Summary collapse
-
#cgap ⇒ Object
Returns the value of attribute cgap.
-
#count ⇒ Object
Returns the value of attribute count.
-
#data ⇒ Object
Returns the value of attribute data.
-
#dynamic_attributes ⇒ Object
readonly
Returns the value of attribute dynamic_attributes.
- #manifest_type ⇒ Object
-
#missing_columns ⇒ Object
Returns the value of attribute missing_columns.
-
#no_of_rows ⇒ Object
Returns the value of attribute no_of_rows.
-
#num_filled_wells_per_plate ⇒ Object
Returns the value of attribute num_filled_wells_per_plate.
-
#num_plates ⇒ Object
Returns the value of attribute num_plates.
-
#num_rows_per_well ⇒ Object
writeonly
Sets the attribute num_rows_per_well.
-
#partial ⇒ Object
Returns the value of attribute partial.
-
#study ⇒ Object
Returns the value of attribute study.
-
#supplier ⇒ Object
Returns the value of attribute supplier.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
Returns the value of attribute type.
-
#validation_errors ⇒ Object
Returns the value of attribute validation_errors.
Attributes inherited from SequencescapeExcel::Worksheet::Base
#axlsx_worksheet, #columns, #name, #password, #ranges, #workbook
Instance Method Summary collapse
- #assets ⇒ Object
- #compute_last_row ⇒ Object
-
#create_sample_manifest ⇒ Object
rubocop:todo Metrics/MethodLength.
- #empty_columns ⇒ Object
-
#initialize(attributes = {}) ⇒ TestWorksheet
constructor
rubocop:todo Metrics/MethodLength.
- #last_row ⇒ Object
- #multiplexed_library_tube ⇒ Object
- #sample_manifest ⇒ Object
Methods included from SequencescapeExcel::Helpers::Worksheet
#add_headers, #create_styles, #find_or_create_style, #first_row, #styles
Methods inherited from SequencescapeExcel::Worksheet::Base
#add_row, #add_rows, #create_worksheet, #insert_axlsx_worksheet, #protect
Constructor Details
#initialize(attributes = {}) ⇒ TestWorksheet
rubocop:todo Metrics/MethodLength
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 26 def initialize(attributes = {}) # rubocop:todo Metrics/MethodLength super @validation_errors ||= [] if type == 'Plates' # create a worksheet for Plates create_plate_dynamic_attributes else # by default create a worksheet for Tubes create_library_type create_reference_genome create_tube_dynamic_attributes create_tube_requests end create_styles add_title_and_description(study.name, supplier, count) add_headers add_data end |
Instance Attribute Details
#cgap ⇒ Object
Returns the value of attribute cgap.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def cgap @cgap end |
#count ⇒ Object
Returns the value of attribute count.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def count @count end |
#data ⇒ Object
Returns the value of attribute data.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def data @data end |
#dynamic_attributes ⇒ Object (readonly)
Returns the value of attribute dynamic_attributes.
23 24 25 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 23 def dynamic_attributes @dynamic_attributes end |
#manifest_type ⇒ Object
75 76 77 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 75 def manifest_type @manifest_type ||= 'tube_default' end |
#missing_columns ⇒ Object
Returns the value of attribute missing_columns.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def missing_columns @missing_columns end |
#no_of_rows ⇒ Object
Returns the value of attribute no_of_rows.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def no_of_rows @no_of_rows end |
#num_filled_wells_per_plate ⇒ Object
Returns the value of attribute num_filled_wells_per_plate.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def num_filled_wells_per_plate @num_filled_wells_per_plate end |
#num_plates ⇒ Object
Returns the value of attribute num_plates.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def num_plates @num_plates end |
#num_rows_per_well=(value) ⇒ Object
Sets the attribute num_rows_per_well
24 25 26 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 24 def num_rows_per_well=(value) @num_rows_per_well = value end |
#partial ⇒ Object
Returns the value of attribute partial.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def partial @partial end |
#study ⇒ Object
Returns the value of attribute study.
23 24 25 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 23 def study @study end |
#supplier ⇒ Object
Returns the value of attribute supplier.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def supplier @supplier end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
23 24 25 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 23 def @tags end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def type @type end |
#validation_errors ⇒ Object
Returns the value of attribute validation_errors.
12 13 14 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 12 def validation_errors @validation_errors end |
Instance Method Details
#assets ⇒ Object
67 68 69 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 67 def assets @assets ||= [] end |
#compute_last_row ⇒ Object
59 60 61 62 63 64 65 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 59 def compute_last_row if %w[plate_default plate_full plate_rnachip].include? manifest_type computed_first_row + (num_plates * num_filled_wells_per_plate * num_rows_per_well) - 1 else computed_first_row + no_of_rows end end |
#create_sample_manifest ⇒ Object
rubocop:todo Metrics/MethodLength
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 83 def create_sample_manifest # rubocop:todo Metrics/MethodLength case manifest_type when /plate/ FactoryBot.create( :pending_plate_sample_manifest, num_plates:, num_filled_wells_per_plate:, num_rows_per_well:, study: ) when /tube_library/, /tube_chromium_library/ FactoryBot.create(:sample_manifest, asset_type: 'library', study: study) when /tube_multiplexed_library/ FactoryBot.create(:sample_manifest, asset_type: 'multiplexed_library', study: study) when /tube_rack/ FactoryBot.create(:tube_rack_manifest, asset_type: 'tube_rack', study: study) else FactoryBot.create(:sample_manifest, asset_type: '1dtube', study: study) end end |
#empty_columns ⇒ Object
71 72 73 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 71 def empty_columns %w[supplier_name i7 i5] end |
#last_row ⇒ Object
55 56 57 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 55 def last_row @last_row ||= compute_last_row end |
#multiplexed_library_tube ⇒ Object
104 105 106 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 104 def multiplexed_library_tube @multiplexed_library_tube ||= FactoryBot.create(:multiplexed_library_tube) end |
#sample_manifest ⇒ Object
79 80 81 |
# File 'app/sample_manifest_excel/sample_manifest_excel/worksheet/test_worksheet.rb', line 79 def sample_manifest @sample_manifest ||= create_sample_manifest end |