Commit 48ff68af authored by Mathieu Giraud's avatar Mathieu Giraud

tools/fuse.py: keep all interesting clone metadata, even from non-topmost clones

Closes #3585.
parent c421fc67
Pipeline #52992 passed with stages
in 7 minutes and 10 seconds
......@@ -98,21 +98,25 @@ class Window:
myList = [ "seg", "top", "id", "sequence", "name", "id", "stats", "germline"]
obj = Window(1)
# 'id' and 'top' will be taken from 'topmost' clone
del obj.d["id"]
del obj.d["top"]
# Data of type 'list'
concatenate_with_padding(obj.d,
self.d, len(self.d["reads"]),
other.d, len(other.d["reads"]),
myList)
#keep other data who don't need to be concat
if other.d["top"] < self.d["top"] :
for key in other.d :
if key in myList :
obj.d[key] = other.d[key]
else :
for key in self.d :
if key in myList :
obj.d[key] = self.d[key]
# All other data, including 'top'
# When there are conflicting keys, keep data from the 'topmost' clone
order = [other, self] if other.d["top"] < self.d["top"] else [self, other]
for source in order:
for key in source.d:
if key not in obj.d:
obj.d[key] = source.d[key]
return obj
def get_nb_reads(self, cid, point=0):
......
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