[Biopython] not technically a biopython question
George Devaniranjan
devaniranjan at gmail.com
Mon Oct 8 11:29:37 EDT 2012
Hi guys,
I am working on some FASTA like sequences (not FASTA but something I have
defined thats similar for some culled PDB from the PISCES server)
I have a question:
I have a small no of sequences called nCatSeq, for which there are MULTIPLE
nBasinSeq, I go through a a large PDB file and I want to extract for for
each nCatSeq the corresponding nBasinSeq without redundancies in a
dictionary. The code snippet that does this is given below.
nCatSeq=item[1][n]+item[1][n+1]+item[1][n+2]+item[1][n+3]
nBasinSeq=item[2][n]+item[2][n+1]+item[2][n+2]+item[2][n+3]
if nCatSeq not in potBasin:
potBasin[nCatSeq]=nBasinSeq
else:
if nBasinSeq not in potBasin[nCatSeq]:
potBasin[nCatSeq]=potBasin[nCatSeq],nBasinSeq
else:
pass
I get the following as the answer for one nCatSeq,
'4241': ((('VUVV', 'DDRV'), 'DDVG'), 'VUVV')
what I want however is :
'4241': ('VUVV', 'DDRV', 'DDVG', 'VUVV')
I don't want all the extra brackets due to the following command
potBasin[nCatSeq]=potBasin[nCatSeq],nBasinSeq
(see above code snippet)
Is there a way to do this ?
Thank you,
George
More information about the Biopython
mailing list