Class: BioPlatesCLI

Inherits:
Thor
  • Object
show all
Defined in:
bin/bioplates

Instance Method Summary collapse

Instance Method Details

#exampleObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'bin/bioplates', line 22

def example
puts "Input as comma-separated values, must have a column headed Plate containing plate name, and either a well column Well (e.g. A01 or B4) or two further columns with Row and Column (A,3)"
puts "Any number of further columns can be specified for annotations"
print "
Plate,Well,Row,Column,siRNA,Conc
Plate1,,A,1,si1,5
Plate1,,A,2,si2,5
Plate1,,A,3,si3,5
Plate1,,A,4,si4,5
Plate1,,A,5,si5,5
Plate1,,A,6,si6,5
Plate1,,A,7,si7,5
Plate1,,A,8,si8,5
Plate1,,A,9,si9,5
Plate1,,A,10,si10,5
Plate1,,A,11,si11,5
Plate1,,A,12,si12,5
Plate1,,B,1,si1,5
Plate1,,B,1,si1,5
Plate1,,B,1,si1,5
Plate1,,B,1,si1,5
...
Plate2,A01,,,si1,15
Plate2,A02,,,si1,15
Plate2,A03,,,si1,15"


end

#quadrants(*plates) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'bin/bioplates', line 9

def quadrants(*plates)
  # read files and merge
  plate_array = []
  plates.each do |plate|
    # TODO: check/warn if any plate names are the same
    BioPlates.read(plate).each{|k,v| plate_array << v}
  end
  output = options[:output] || "output.csv"
  newname = options[:newname] || "QuadrantPlate"
  BioPlates.quadrants(plate_array, newname).dump(output)
end