Re: recombination variations

2004-12-02 Thread Scott David Daniels
Hung Jung Lu wrote: ... expand = lambda t: reduce(lambda r, s: [x+y for x in r >for y in alphabet[s]], t, ['']) print expand('ATSGS') Or, for a more verbose version: multis = dict(W='AT', M='AC', R='AG', Y='TC', K='TG', S='CG', H='ATC', D='ATG'

Re: recombination variations

2004-12-01 Thread Hung Jung Lu
alphabet = { 'A': 'A', 'T': 'T', 'C': 'C', 'G': 'G', 'W': 'AT', 'M': 'AC', 'R': 'AG', 'Y': 'TC', 'K': 'TG', 'S': 'CG', 'H': 'ATC', 'D': 'ATG', 'V': 'AGC', 'B': 'CTG', 'N': 'ATCG'

Re: recombination variations

2004-12-01 Thread Peter Otten
David Siedband wrote: > The problem I'm solving is to take a sequence like 'ATSGS' and make all > the DNA sequences it represents. The A, T, and G are fine but the S > represents C or G. I want to take this input: > > [ [ 'A' ] , [ 'T' ] , [ 'C' , 'G' ], [ 'G' ] , [ 'C' , 'G' ] ] > > and make

Re: recombination variations

2004-11-30 Thread Dennis Benzinger
David Siedband wrote: > [...] > Is there a better way to do this? > [...] Take a look at Biopython: http://biopython.org/ Your problem may be solved there already. -- http://mail.python.org/mailman/listinfo/python-list

recombination variations

2004-11-30 Thread David Siedband
The problem I'm solving is to take a sequence like 'ATSGS' and make all the DNA sequences it represents. The A, T, and G are fine but the S represents C or G. I want to take this input: [ [ 'A' ] , [ 'T' ] , [ 'C' , 'G' ], [ 'G' ] , [ 'C' , 'G' ] ] and make the list: [ 'ATCGC' , 'ATCGG' , 'ATG