Class: LibraryTube

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

Overview

rubocop:todo Style/Documentation

Direct Known Subclasses

SpikedBuffer

Instance Attribute Summary

Attributes inherited from Labware

#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, #barcode!, #comments, create_with_barcode!, delegate_to_purpose, #details, #name_for_child_tube, #name_for_label, #pool_id, #sanger_barcode=, #stock_plate, #subject_type, #submission

Methods included from QcFile::Associations

#has_qc_files

Methods included from SingleReceptacleLabware

#receptacle

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

Methods inherited from Labware

#ancestor_of_purpose, #ancestors_of_purpose, #child, #display_name, find_by_barcode, find_from_any_barcode, #generate_name, #human_barcode, #labware, #labwhere_location, labwhere_locations, #parent, #role, #scanned_in_date, #source_plate, #source_plates, #storage_location

Methods included from SharedBehaviour::Named

included

Methods included from AssetLink::Associations

included

Methods included from Uuid::Uuidable

included, #unsaved_uuid!, #uuid

Methods included from Commentable

#after_comment_addition

Methods inherited from Asset

#add_parent, #ancestor_of_purpose, #asset_type_for_request_types, #assign_relationships, #barcode_number, #compatible_purposes, #contained_samples, #details, #external_identifier, #generate_barcode, #get_qc_result_value_for, #has_stock_asset?, #label, #label=, #original_stock_plates, #prefix, #printable?, #printable_target, #register_stock!, #request_types, #spiked_in_buffer, #summary_hash, #type, #update_from_qc

Methods included from EventfulRecord

#has_many_events, #has_many_lab_events, #has_one_event_with_family

Methods included from Event::PlateEvents

#event_date, #fluidigm_stamp_date, #gel_qc_date, #pico_date, #qc_started_date, #sequenom_stamp_date

Methods inherited from ApplicationRecord

convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!

Methods included from Squishify

extended

Methods included from Warren::BroadcastMessages

#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren

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