Class: OpenTrons::Pipette
- Inherits:
-
Object
- Object
- OpenTrons::Pipette
- Defined in:
- lib/opentrons/instruments.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#instruments ⇒ Object
Returns the value of attribute instruments.
-
#model ⇒ Object
Returns the value of attribute model.
-
#mount ⇒ Object
Returns the value of attribute mount.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#tip_model ⇒ Object
Returns the value of attribute tip_model.
-
#tip_racks ⇒ Object
Returns the value of attribute tip_racks.
Instance Method Summary collapse
- #aspirate(volume, location) ⇒ Object
- #blowout(location) ⇒ Object
- #delay(wait, message: "") ⇒ Object
- #dispense(volume, location) ⇒ Object
- #drop_tip(location = false) ⇒ Object
-
#get_next_tip(multi: false) ⇒ Object
For whatever reason, air gap has no location in Python API but has a location in the JSON schema.
-
#initialize(protocol, instruments, model, mount: "left", tip_racks: [], tip_model: nil) ⇒ Pipette
constructor
A new instance of Pipette.
- #inspect ⇒ Object
- #pick_up_tip(location = false) ⇒ Object
- #to_hash ⇒ Object
- #to_s ⇒ Object
- #touch_tip(location) ⇒ Object
Constructor Details
#initialize(protocol, instruments, model, mount: "left", tip_racks: [], tip_model: nil) ⇒ Pipette
77 78 79 80 81 82 83 84 85 |
# File 'lib/opentrons/instruments.rb', line 77 def initialize(protocol, instruments, model, mount: "left", tip_racks: [], tip_model: nil) @protocol = protocol @instruments = instruments @model = model @mount = mount @tip_racks = tip_racks @tip_model = tip_model end |
Instance Attribute Details
#instruments ⇒ Object
Returns the value of attribute instruments.
75 76 77 |
# File 'lib/opentrons/instruments.rb', line 75 def instruments @instruments end |
#model ⇒ Object
Returns the value of attribute model.
75 76 77 |
# File 'lib/opentrons/instruments.rb', line 75 def model @model end |
#mount ⇒ Object
Returns the value of attribute mount.
75 76 77 |
# File 'lib/opentrons/instruments.rb', line 75 def mount @mount end |
#protocol ⇒ Object
Returns the value of attribute protocol.
75 76 77 |
# File 'lib/opentrons/instruments.rb', line 75 def protocol @protocol end |
#tip_model ⇒ Object
Returns the value of attribute tip_model.
75 76 77 |
# File 'lib/opentrons/instruments.rb', line 75 def tip_model @tip_model end |
#tip_racks ⇒ Object
Returns the value of attribute tip_racks.
75 76 77 |
# File 'lib/opentrons/instruments.rb', line 75 def tip_racks @tip_racks end |
Instance Method Details
#aspirate(volume, location) ⇒ Object
102 103 104 105 106 |
# File 'lib/opentrons/instruments.rb', line 102 def aspirate(volume, location) command = Aspirate.new(self, volume, location) protocol.commands.command_list << command return command end |
#blowout(location) ⇒ Object
193 194 195 196 197 |
# File 'lib/opentrons/instruments.rb', line 193 def blowout(location) command = Blowout.new(self, location) protocol.commands.command_list << command return command end |
#delay(wait, message: "") ⇒ Object
199 200 201 202 203 |
# File 'lib/opentrons/instruments.rb', line 199 def delay(wait, message: "") command = Delay.new(wait, ) protocol.commands.command_list << command return command end |
#dispense(volume, location) ⇒ Object
108 109 110 111 112 |
# File 'lib/opentrons/instruments.rb', line 108 def dispense(volume, location) command = Dispense.new(self, volume, location) protocol.commands.command_list << command return command end |
#drop_tip(location = false) ⇒ Object
180 181 182 183 184 185 |
# File 'lib/opentrons/instruments.rb', line 180 def drop_tip(location=false) location = protocol.trash.wells(0) if !location command = DropTip.new(self, location) protocol.commands.command_list << command return command end |
#get_next_tip(multi: false) ⇒ Object
For whatever reason, air gap has no location in Python API but has a location in the JSON schema. Not implemented for now. def air_gap(volume, location) command = Aspirate.new(self, volume, location) self.protocol.commands << command return command end
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/opentrons/instruments.rb', line 122 def get_next_tip(multi: false) location = nil catch :tip_found do tip_racks.each do |tip_rack| tip_rack.well_list.each do |column| if multi if column.all? {|x| x.tip} location = column[0] throw :tip_found end else column.each do |x| if x.tip location = x throw :tip_found end end end end end return false end return location end |
#inspect ⇒ Object
98 99 100 |
# File 'lib/opentrons/instruments.rb', line 98 def inspect to_s end |
#pick_up_tip(location = false) ⇒ Object
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/opentrons/instruments.rb', line 148 def pick_up_tip(location=false) if !location tip_location = self.get_next_tip() # If no tip found and tip model is provided, create a tip rack. if !tip_location if tip_model tip_racks << protocol.labware.load(tip_model, protocol.labware.free_slots[-1], 'Auto-generated-tip-rack') else raise ArgumentError.new "pick_up_tip called without location and pipette is out of tips." end end tip_location = self.get_next_tip() location = tip_location end if location.is_a? Array well = location[0] else well = location end if !(well.tip) puts "Warning: Already picked up tip at #{location}." else well.tip = false end command = PickUpTip.new(self, location) protocol.commands.command_list << command return command end |
#to_hash ⇒ Object
87 88 89 90 91 92 |
# File 'lib/opentrons/instruments.rb', line 87 def to_hash as_hash = {} as_hash["mount"] = mount as_hash["model"] = model return as_hash end |
#to_s ⇒ Object
94 95 96 |
# File 'lib/opentrons/instruments.rb', line 94 def to_s "<OpenTrons::Pipette:0x#{self.__id__.to_s(16)}>" end |
#touch_tip(location) ⇒ Object
187 188 189 190 191 |
# File 'lib/opentrons/instruments.rb', line 187 def touch_tip(location) command = TouchTip.new(self, location) protocol.commands.command_list << command return command end |