/
unitoperations.go
254 lines (219 loc) · 7.09 KB
/
unitoperations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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
147
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
// Part of the Antha language
// Copyright (C) 2015 The Antha authors. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// For more information relating to the software or licensing issues please
// contact license@antha-lang.org or write to the Antha team c/o
// Synthace Ltd. The London Bioscience Innovation Centre
// 2 Royal College St, London NW1 0NH UK
// Package for working with bioprocessing unitoperations
package UnitOperations
import (
"time"
"github.com/antha-lang/antha/antha/anthalib/mixer"
"github.com/antha-lang/antha/antha/anthalib/wtype"
"github.com/antha-lang/antha/antha/anthalib/wunit"
)
type Pellet struct {
}
type Culture struct {
wtype.Suspension
wtype.Organism
}
func Separate(culture Culture) (supernatant *wtype.Liquid, pellet Pellet) {
return
}
type Chromstep struct {
Pipetstep
Column
Buffer *wtype.Liquid
//Mobilephase ... this is really the buffer; should separate out chromstep from pipette step
}
type Pipetstep struct {
Name string
Volume wunit.Volume //transfer volume and process volume?
Aspiraterate wunit.FlowRate
Aspiratepause time.Duration
Dispenserate wunit.FlowRate
Dispensepause time.Duration
Cycles int
//Mobilephase ... this is really the buffer; should separate out chromstep from pipette step
}
type Column struct {
Beadsize wunit.Length
Stationaryphase string
Separationproperty string
Diameter wunit.Length
Height wunit.Length
Packedvolume wunit.Volume
}
type Phytips struct { // interface?
Column
Tip wtype.LHTip
}
// may already be functions for aspirate and dispense in anthalib
func Aspirate(column Column, mixture *wtype.Liquid, volume wunit.Volume, aspiraterate wunit.FlowRate) (aspiratedcolumn Column, aspiratedsolution *wtype.Liquid) {
return
}
func Dispense(column Column, mixture *wtype.Liquid, volume wunit.Volume, aspiraterate wunit.FlowRate) (dispensedcolumn Column, dispensedsolution *wtype.Liquid) {
return
}
/*
func PhysicaltoComponent(pellet *wtype.Physical) (component *wtype.Liquid) {
// placeholder
return
}
*/
func PelletToComponent(p Pellet) *wtype.Liquid {
return wtype.NewLHComponent()
}
/*
func Resuspend(pellet Pellet, step Chromstep, column Column) (output_c *wtype.Liquid, processedcolumn Column) {
var output *wtype.Liquid
//input := PhysicaltoComponent(pellet)
input := PelletToComponent(pellet)
samples := make([]*wtype.Liquid, 0)
samples = append(samples, step.Buffer, input)
mixture := mixer.Mix(samples...)
for i := 0; i < step.Pipetstep.Cycles; i++ {
aspiratedcolumn, aspiratedsolution := Aspirate(column, mixture, step.Volume, step.Aspiraterate)
time.Sleep(step.Aspiratepause)
_, output = Dispense(aspiratedcolumn, aspiratedsolution, step.Volume, step.Dispenserate)
time.Sleep(step.Dispensepause)
}
processedcolumn = column
output_c = wtype.SolutionToComponent(output)
return output_c, processedcolumn
}
*/
func Chromatography(input *wtype.Liquid, step Chromstep, column Column) (output_c *wtype.Liquid, processedcolumn Column) {
var output *wtype.Liquid
samples := make([]*wtype.Liquid, 0)
samples = append(samples, input, step.Buffer)
mixture := mixer.Mix(samples...)
for i := 0; i < step.Pipetstep.Cycles; i++ {
aspiratedcolumn, aspiratedsolution := Aspirate(column, mixture, step.Volume, step.Aspiraterate)
time.Sleep(step.Aspiratepause)
_, output = Dispense(aspiratedcolumn, aspiratedsolution, step.Volume, step.Dispenserate)
time.Sleep(step.Dispensepause)
}
processedcolumn = column
return output, processedcolumn
}
func Blot(column Column, blotcycles int, blottime time.Duration) (blottedcolumn Column) {
// placeholder for moving column to blot paper and dabbing and then waiting
for i := 0; i < blotcycles; i++ {
time.Sleep(blottime)
}
return blottedcolumn
}
func Dry(tips Column /*wtype.LHTip*/, Drytime time.Duration, Vacuumstrength float64) (drytips Column) {
// set vacuum manifold to vacuum strength
///move tips to vacuum position
time.Sleep(Drytime)
drytips = tips
return drytips
}
/*
func Equilibration (Input Watersolution, step Chromstep, column Column) readycolumn Column {
readycolumn = step Chromstep.cycles *
(
column ( aspirate mixture(
step Chromstep.volume,
step Chromstep.aspiraterate
)
wait step Chromstep.aspiratepause
dispense mixture(
step Chromstep.volume,
step Chromstep.dispenserate
)
wait step Chromstep.dispensepause
)
)
return readycolumn
}
func AirChromatography (Input Gas, step Chromstep, column Column) readycolumn Column {
mixture := mix (Input, step Chromstep.buffer)
Output = step Chromstep.cycles *
(
column ( aspirate mixture(
step Chromstep.volume,
step Chromstep.aspiraterate
)
wait step Chromstep.aspiratepause
dispense mixture(
step Chromstep.volume,
step Chromstep.dispenserate
)
wait step Chromstep.dispensepause
)
)
return readycolumn
}
func Resuspension (Input Pellet, step pipetstep) output Suspension {
mixture := mix (step Pipetstep.buffer, Input)
Output = step Pipetstep.cycles *
(
aspirate mixture(
step Pipetstep.volume,
step Pipetstep.aspiraterate
)
wait step Pipetstep.aspiratepause
dispense mixture(
step Pipetstep.volume,
step Pipetstep.dispenserate
)
wait step Pipetstep.dispensepause
)
return output
}
func Lysis (Input Suspension, step pipetstep) output Lysate {
mixture := mix (step, Input)
Output = step Pipetstep.cycles *
(
aspirate mixture(
step Pipetstep.volume,
step Pipetstep.aspiraterate
)
wait step Pipetstep.aspiratepause
dispense mixture(
step Pipetstep.volume,
step Pipetstep.dispenserate
)
wait step Pipetstep.dispensepause
)
return output
}
func Precipitation (Input Suspension, step pipetstep) output Precipitate {
mixture := mix (step, Input)
Output = step Pipetstep.cycles *
(
aspirate mixture(
step Pipetstep.volume,
step Pipetstep.aspiraterate
)
wait step Pipetstep.aspiratepause
dispense mixture(
step Pipetstep.volume,
step Pipetstep.dispenserate
)
wait step Pipetstep.dispensepause
)
return output
}
func Growthcurve () {
}
*/