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.



84
85
86
87
# File 'app/models/fluidigm_file.rb', line 84

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

Instance Method Details

#each_wellObject



89
90
91
# File 'app/models/fluidigm_file.rb', line 89

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

#for_plate?(test_plate) ⇒ Boolean

Returns:

  • (Boolean)


93
94
95
# File 'app/models/fluidigm_file.rb', line 93

def for_plate?(test_plate)
  plate_barcode == test_plate
end

#plate_barcodeObject



97
98
99
# File 'app/models/fluidigm_file.rb', line 97

def plate_barcode
  @csv[0][2]
end

#well_at(description) ⇒ Object



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

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

#well_locationsObject



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

def well_locations
  @wells.keys
end