BMS.serial_dilution_volumes() Function¶
This function can be helpful when writing protocols with a serial dilution step. By defining the serial dilution steps and the final volume for each dilution, the BMS.serial_dilution_volumes function can calculate the volume of sample and solution required at each step.
Usage¶
First, the BMS generic tools module is imported as BMS
import BiomationScripter as BMS
Next, the dilution factors for the serial dilution should be specified. The example below shows a 1 in 2 serial dilution with 5 steps, plus an undiluted step
Dilution_Factors = [1, 2, 4, 8, 16, 32]
Next, the final volume for each dilution should be specified in microlitres
Final_Volume = 100
Finally, the BMS.serial_dilution_volumes function can be used to calculate and return the volumes of sample and solution required
Sample_Volumes, Solution_Volumes = BMS.serial_dilution_volumes(
dilution_factors = Dilution_Factors,
total_volume= Final_Volume
)
print(Sample_Volumes)
print(Solution_Volumes)
[100.0, 50.0, 50.0, 50.0, 50.0, 50.0] [0.0, 50.0, 50.0, 50.0, 50.0, 50.0]
The order of the volumes in each list above are determined by the order of the dilution factors used as the input
It is also possible to define irregular serial dilutions
Dilution_Factors = [1, 2, 10, 50, 75, 100, 200]
Final_Volume = 100
Sample_Volumes, Solution_Volumes = BMS.serial_dilution_volumes(
dilution_factors = Dilution_Factors,
total_volume= Final_Volume
)
print(Sample_Volumes)
print(Solution_Volumes)
[100.0, 50.0, 20.0, 20.0, 66.66666666666666, 75.0, 50.0] [0.0, 50.0, 80.0, 80.0, 33.33333333333334, 25.0, 50.0]