Commit 686bf290 authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Marc Duez

fuse.py: orders 'systems_segmented' according to GERMLINES_ORDER

parent c10db250
......@@ -31,6 +31,12 @@ from operator import itemgetter
VIDJIL_JSON_VERSION = "2014.02"
GERMLINES_ORDER = ['TRA', 'TRB', 'TRG', 'TRD', 'DD', 'IGH', 'DHJH', 'IJK', 'IJL']
def ordered(d, key=None):
'''sorts a dictionary into an OrderedDict'''
return collections.OrderedDict([(k, d[k]) for k in sorted(d, key=key)])
####
class Window:
......@@ -733,6 +739,7 @@ def main():
print '\t==> merge to', jlist_fused
jlist_fused.d['germline'][0] = "multi"
jlist_fused.d["system_segmented"] = ordered(jlist_fused.d["system_segmented"], key=lambda sys: ((GERMLINES_ORDER + [sys]).index(sys), sys))
else:
print "### Read and merge input files"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment