This is a single flat dictionary, but there is obvious nested structure here with the five primers sets 0 to 4, could we not have a (optional) nested dict?:
These make sense as top level entries:
'PRIMER_LEFT_EXPLAIN': 'considered 2285, too many Ns 25, GC content failed 32, low tm 1366, high tm 189, ok 673',
'PRIMER_RIGHT_EXPLAIN': 'considered 2285, too many Ns 25, GC content failed 80, low tm 1484, high tm 126, high hairpin stability 5, ok 565',
'PRIMER_INTERNAL_EXPLAIN': 'considered 3367, too many Ns 27, GC content failed 92, low tm 2862, high tm 17, high hairpin stability 15, ok 354',
'PRIMER_PAIR_EXPLAIN': 'considered 671, unacceptable product size 659, no internal oligo 5, ok 7',
Consider this example adapted from the one of your test cases:
This is a single flat dictionary, but there is obvious nested structure here with the five primers sets 0 to 4, could we not have a (optional) nested dict?:
These make sense as top level entries:
These would be redundant under my idea:
All the rest have an index and would be better a list of dicts or named tuples:
Here the
PRIMER_PAIR
entry could be:And the
PRIMER_LEFT
entry could be:(You'd need a key for
'PRIMER_LEFT_0': (46, 21),
though - maybeCOORDS
?)etc.
This could be requested by a keyword argument to preserve backward compatibility?