Class: FluidigmFile

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

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


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

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

Instance Method Details

#each_wellObject


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

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

#for_plate?(test_plate) ⇒ Boolean

Returns:

  • (Boolean)

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

def for_plate?(test_plate)
  plate_barcode == test_plate
end

#plate_barcodeObject


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

def plate_barcode
  @csv[0][2]
end

#well_at(description) ⇒ Object


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

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

#well_locationsObject


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

def well_locations
  @wells.keys
end