vendredi 27 février 2015

Matching characters in dictionaries


Vote count:

0




I am new to python and I need help in solving this error. I have two dictionaries that look something like this:


OtherSeqDict


{'Protein1':'AGCGGGTTTTTACCCCCCGTTTTGGGACCCCCACTGCGTC', 'Protein2':'AGCGGGTTTTACCC---GGTTTTGGACCCCCACTGCGTC', 'Protein3':'AGCGGGTTTTTACCCCCCGTGTTGGGACCCCCACTGCGTC'}


MouseSeqDict


{'Protein4':'AGCGGCTTTTTACCCCCCGTGTTGGGACCGCCACTGCGTC'}


I am trying to print (i) matching characters in the values of Protein 4 to characters in the values of Protein1, Protein2 and Protein 3 and (ii) mismatched characters in Protein 4 to those of Protein1, Protein2 and Protein3 and the position of these mismatched characters in Protein4.


I am currently on my first question and edited the script that I found online but I received error while running it


The error is shown below


p = _cache.get(cachekey) TypeError: unhashable type: 'list'


This is my script:


otherseq=OtherSeqDict.values()


mouseseq=MouseSeqDict.values()


for match in re.finditer(mouseseq,otherseq):



start=match.start()

end=match.end()

print 'Found "%s" at %d:%d' %(text[start:end],start,end)


Can anyone show me how to do this (i) and (ii)?


Thanks!!



asked 19 secs ago







Matching characters in dictionaries

Aucun commentaire:

Enregistrer un commentaire