Class: FluidigmFile

Inherits:
Object
  • Object
show all
Defined in:
app/models/fluidigm_file.rb

Overview

rubocop:todo Style/Documentation

Defined Under Namespace

Modules: Finder Classes: Assay, FluidigmWell, InvalidFile

Instance Method Summary collapse

Constructor Details

#initialize(file_contents) ⇒ FluidigmFile

Returns a new instance of FluidigmFile.


102
103
104
105
# File 'app/models/fluidigm_file.rb', line 102

def initialize(file_contents)
  @csv = CSV.parse(file_contents)
  build_wells
end

Instance Method Details

#each_wellObject


107
108
109
# File 'app/models/fluidigm_file.rb', line 107

def each_well
  @wells.each { |_, w| yield(w) }
end

#for_plate?(test_plate) ⇒ Boolean

Returns:

  • (Boolean)

111
112
113
# File 'app/models/fluidigm_file.rb', line 111

def for_plate?(test_plate)
  plate_barcode == test_plate
end

#plate_barcodeObject


115
116
117
# File 'app/models/fluidigm_file.rb', line 115

def plate_barcode
  @csv[0][2]
end

#well_at(description) ⇒ Object


119
120
121
122
# File 'app/models/fluidigm_file.rb', line 119

def well_at(description)
  @wells ||= Hash.new { |hash, desc| hash[desc] = FluidigmWell.new(desc) }
  @wells[description]
end

#well_locationsObject


124
125
126
# File 'app/models/fluidigm_file.rb', line 124

def well_locations
  @wells.keys
end