Class: LabwareCreators::CustomTaggedPlate

Inherits:
Base
  • Object
show all
Includes:
CustomPage, SupportParent::PlateOnly, TaggedPlateBehaviour
Defined in:
app/models/labware_creators/custom_tagged_plate.rb

Overview

Duplicate of TaggedPlate Creator to allow configuration to be built independently of behaviour.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ CustomTaggedPlate

Returns a new instance of CustomTaggedPlate.



43
44
45
46
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 43

def initialize(*args, &block)
  super
  parent.populate_wells_with_pool
end

Instance Attribute Details

#childObject (readonly)

Returns the value of attribute child.



13
14
15
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 13

def child
  @child
end

#tag_layoutObject

Returns the value of attribute tag_layout.



14
15
16
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 14

def tag_layout
  @tag_layout
end

#tag_plateObject

Returns the value of attribute tag_plate.



13
14
15
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 13

def tag_plate
  @tag_plate
end

Instance Method Details

#create_plate! {|@child.uuid| ... } ⇒ Object

rubocop:todo Metrics/AbcSize

Yields:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 48

def create_plate! # rubocop:todo Metrics/AbcSize
  @child =
    api
      .pooled_plate_creation
      .create!(
        child_purpose: purpose_uuid,
        user: user_uuid,
        parents: [parent_uuid, tag_plate.asset_uuid].compact_blank
      )
      .child

  transfer_material_from_parent!(@child.uuid)

  yield(@child.uuid) if block_given?

  return true if tag_plate.asset_uuid.blank? || tag_plate.state == 'exhausted'

  begin
    flag_tag_plate_as_exhausted
  rescue RepeatedStateChangeError => e
    # Plate is already exhausted, the user is probably processing two plates
    # at the same time
    Rails.logger.warn(e.message)
  end

  true
end

#cross_plate_pool_detection?Bool Originally defined in module TaggedPlateBehaviour

Note:

This option is safest to enable when:

  • The pipeline has an earlier consolidation step

  • The pipeline will never pool at a higher level than the current late

  • Only one template is available anyway

In other scenarios you may be at risk of introducing tag clashes.

In the LTHR pipeline we begin with 4x96 well plates, which get combined on a single 384 well plate. This means that the cross-plate pool detection enforces unique UDI plates. This causes problems if a tag plate is used in error, and there needs to be a rework loop. As on the second run through, tag clash detection fires.

By setting the disable_cross_plate_pool_detection config option you can turn off this check.

Returns:

  • (Bool)

    Whether to disable tag uniqueness detection

#flag_tag_plate_as_exhaustedSequencescape::Api::StateChange Originally defined in module TaggedPlateBehaviour

Update the state of the tag plate to ‘exhausted’

Returns:

  • (Sequencescape::Api::StateChange)

    The created state change

#parentObject Originally defined in module SupportParent::PlateOnly

#pool_index(_pool_index) ⇒ Object



76
77
78
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 76

def pool_index(_pool_index)
  nil
end

#requires_tag2?Boolean Originally defined in module TaggedPlateBehaviour

Indicated that an i5 tag (tag2) is required for the tagging of this particular plate. i5 tags are required when a submission spans multiple plates, which will be tagged independently, and then pooled.

The combination of i5 and i7 tags help ensure that each sample in the pool has a unique tag. By using a combination of two tags you can maintain strong diversity in tag reads.

Returns:

  • (Boolean)

    Returns true if any submissions associated with the plate span multiple source plates.

#tag_group_adapter_type_name_filter<String] The name of the adapter type.

The adapter type name filter for limiting the tag group list drop downs on the custom tagging screen. In most cases this will not be present in the purposes yml and is not required. e.g. to just show tag groups with Chromium adapter types it is ‘Chromium’

Returns:

  • (<String] The name of the adapter type.)

    <String] The name of the adapter type.



98
99
100
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 98

def tag_group_adapter_type_name_filter
  purpose_config.fetch(:tag_group_adapter_type_name_filter, nil)
end

#tag_platesObject Originally defined in module TaggedPlateBehaviour

#tags_per_well<Number] The number of tags per well.

The tags per well number. In most cases this will be the default 1 unless overriden in the purposes yml e.g. for Chromium plates in bespoke it is 4

Returns:

  • (<Number] The number of tags per well.)

    <Number] The number of tags per well.



87
88
89
# File 'app/models/labware_creators/custom_tagged_plate.rb', line 87

def tags_per_well
  purpose_config.fetch(:tags_per_well, 1)
end

#transfer_hashObject Originally defined in module TaggedPlateBehaviour