Class: LibraryTube

Inherits:
Tube
  • Object
show all
Extended by:
Asset::Stock::CanCreateStockAsset
Includes:
Api::LibraryTubeIO::Extensions, Asset::SharedLibraryTubeBehaviour, ModelExtensions::LibraryTube
Defined in:
app/models/library_tube.rb

Direct Known Subclasses

SpikedBuffer

Instance Attribute Summary

Attributes included from AssetRefactor::Labware::Methods

#storage_location_service

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Asset::Stock::CanCreateStockAsset

extended, is_a_stock_asset?

Methods included from Asset::SharedLibraryTubeBehaviour

#library_source_plates

Methods included from Api::LibraryTubeIO::Extensions

included, #json_root

Methods inherited from Tube

#after_comment_addition, #ancestor_of_purpose, #barcode!, #comments, create_with_barcode!, delegate_to_purpose, #details, #name_for_child_tube, #name_for_label, #pool_id, #sanger_barcode=, #source_plate, #subject_type, #submission

Methods included from QcFile::Associations

#has_qc_files

Methods included from AssetRefactor::Labware::Methods

#labware, #labwhere_location, #scanned_in_date, #storage_location

Methods included from Transfer::State::TubeState

included

Methods included from Transfer::Associations

included

Methods included from Asset::Ownership::Unowned

#change_owner_to

Methods included from Tag::Associations

#untag!

Methods included from Barcode::Barcodeable

#aker_barcode, #aker_barcode=, #any_barcode_matching?, #barcode_format, #barcode_number, #cgap_barcode, #cgap_barcode=, #external_barcode, #external_barcode=, #external_identifier, #fluidigm_barcode, #fluidigm_barcode=, #generate_barcode, included, #infinium_barcode, #infinium_barcode=, #prefix, #primary_barcode, #printable_target, #sanger_barcode

Class Method Details

.stock_asset_purposeObject


12
13
14
# File 'app/models/library_tube.rb', line 12

def self.stock_asset_purpose
  Tube::Purpose.stock_library_tube
end

.stock_asset_typeObject


8
9
10
# File 'app/models/library_tube.rb', line 8

def self.stock_asset_type
  StockLibraryTube
end

Instance Method Details

#library_informationObject


16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/models/library_tube.rb', line 16

def library_information
  tag  = aliquots.first.tag
  tag2 = aliquots.first.tag2
  {
    library_type: aliquots.first.library_type,
    insert_size_from: aliquots.first.insert_size_from,
    insert_size_to: aliquots.first.insert_size_to
  }.tap do |tag_hash|
    tag_hash[:tag] = tag.summary if tag
    tag_hash.merge!(tag2: tag2.summary) if tag2
  end
end