Jul-25-2017, 09:16 PM
To make the functions replicate I just added in a variable to replicate it. It's basically the same code but:
B= values
However, as I work through that, I was wondering, if alternatively, there was is a way to transfer plate numbers (A1, A2,) to just numbers (1,2,3,4,5,6)
so A1 = 1
A12 = 12
B1 = 13
B12 = 24
and so on. What would be the easiest way of working towards this?
What I've tried so far is assigning A1 = 1 and so on but I get an error that says I can't assign it to literal - which makes sense becaues it is a number. I find the A1, B1, C1 format easier to understand, but for some plates we require combinations that go past H1 (which is the last letter we have for a column). Do I need to make a list of consecutive numbers somewhere?
def transfer(p_amount, p_source, p_target): print("Transfering {:>10}ul from {} to {}".format(p_amount, p_source, p_target)) mastermix_sources = ['A1', 'A2', 'A3' ] cDNA_sources = ['B1', 'B2', 'B3' ] replicate = 2 for i, mm in enumerate(mastermix_sources): #list of targets for mastermix targets = [] for j in range(len(cDNA_sources * replicate)): column = chr(65+i ) row = j+1 target = "{}{}".format(column, row) targets.append(target) transfer( 6, mm, targets ) for i, mm in enumerate(cDNA_sources * replicate): #list of targets for mastermix targets = [] for j in range(len(mastermix_sources)): column = chr(65+j) row = i+1 target = "{}{}".format(column, row) targets.append(target) transfer( 4, mm, targets )I'm still working to collaborate all the results into one line, so results are all put together, i.e. there aren't two lines for cDNA where
B= values
However, as I work through that, I was wondering, if alternatively, there was is a way to transfer plate numbers (A1, A2,) to just numbers (1,2,3,4,5,6)
so A1 = 1
A12 = 12
B1 = 13
B12 = 24
and so on. What would be the easiest way of working towards this?
What I've tried so far is assigning A1 = 1 and so on but I get an error that says I can't assign it to literal - which makes sense becaues it is a number. I find the A1, B1, C1 format easier to understand, but for some plates we require combinations that go past H1 (which is the last letter we have for a column). Do I need to make a list of consecutive numbers somewhere?