I am working on some FASTA-like sequences (not FASTA, but something I have defined that's 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 large PDB file and I want to extract 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],nBasinSeqelse: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 ?