By using iterations and comprehensions, I created a python dictionary that stores keys associated with values (stats related to certain features). The keys, refer to an unique ID (in my case, a gene). I have populated the values by a list of tuples each indicating the startpoint and length of a feature (in this case, an ORF or in other words potential protein coding sequence) of the gene ID. Any given gene can have many such features. The general form is as under:
{key1:[(startpoint1,length1)], key2[(startpoint1,length1)(startpoint2,length2)...], key3[]}
As shown below (in a sample dictionary), some keys could have only one feature (only one tuple pair), while others could have as many as 100 or more. For simplicity, I have shown seq1 with 3 pairs. Also there can be keys with no features, for example, seq3 and 4.
{'seq2': [(1,6)], 'seq1': [(1, 12), (16, 9), (32,9)], 'seq3': [], 'seq4': []}
I want to iterate through this dictionary to get the "startpoint" when the "length" is maximum. In my example the answer I should get is
startpoint 1 (in seq1), because it has biggest length value (12) among all the entries.
I find it hard to iterate over multiple tuples.