I have a dictionary which is made pretty as a matrix:
Dictionary:
{'1': {'3': 0, '2': 1, '5': 1, '4': 0, '6': 29},
'3': {'1': 0, '2': 0, '5': 0, '4': 1, '6': 1},
'2': {'1': 13, '3': 1, '5': 21, '4': 0, '6': 0},
'5': {'1': 39, '3': 0, '2': 1, '4': 0, '6': 14},
'4': {'1': 1, '3': 1, '2': 17, '5': 2, '6': 0},
'6': {'1': 0, '3': 43, '2': 0, '5': 0, '4': 1}}
The information as a matrix:...
User Profile
Collapse
-
How to return matrix index
-
AnneTanne replied to How to find a overlap between 2 sequences, and make the function return the overlapin PythonWhen i turn the s1, and s2 around, the answer is supposed to be 'c', but i get the same answer. -
AnneTanne replied to How to find a overlap between 2 sequences, and make the function return the overlapin PythonI have tried this:...Code:left = "CGATTCCAGGCTCCCCACGGGGTACCCATAACTTGACAGTAGATCTC" right = "GGCTCCCCACGGGGTACCCATAACTTGACAGTAGATCTCGTCCAGACCCCTAGC" def getOverlap(left,right): if left == right[::-1]: return "" else: for i in left: for i in right: if left[len(left)-i]==(right[::-1])[len(right)-i]:Last edited by bvdet; Jan 2 '13, 09:12 PM. Reason: Please use code tags when posting code. [code]....[/code]Leave a comment:
-
AnneTanne started a topic How to find a overlap between 2 sequences, and make the function return the overlapin PythonHow to find a overlap between 2 sequences, and make the function return the overlap
I need to make a function that determines the overlap between 2 sequences, and then return the overlap.
The overlap is a coherent sequence that is in the left end of the first sequence, and in the right end of the second sequence.
my sequences are: s1= "CGATTCCAGGCTCC CCACGGGGTACCCAT AACTTGACAGTAGAT CTC"
s2= "GGCTCCCCACGGGG TACCCATAACTTGAC AGTAGATCTCGTCCA GACCCCTAGC"
my function should be...
No activity results to display
Show More
Leave a comment: