Commit 31b2bd64 authored by flothoni's avatar flothoni

fuse & warning, add a new warning if clone have not same name between samples

Link to #4566
parent f6bb6e74
Pipeline #188618 passed with stages
in 2 minutes and 24 seconds
......@@ -58,4 +58,5 @@ Warnings which were implemented ([x]) have a fixed code that should not be chang
## Comparisons between several samples or patients (such as with clonedb)
- [ ] W8x Potential contamination or public clone #1744
- [ ] Known public clone
- [x] W81 Clone have different names between samples #4566
......@@ -222,6 +222,16 @@ class Window:
if key not in obj.d:
obj.d[key] = source.d[key]
# !! No name field if fuse with an empty clone
if "name" in self.d and "name" in other.d and self.d["name"] != other.d["name"]:
if obj.d["name"] == self.d["name"]:
name = other.d["name"]
else:
name = self.d["name"]
# init warn field if not already present
if not "warn" in obj.d:
obj.d["warn"] = []
obj.d["warn"].append( {"code":"W81", "msg":"Clone have different names between samples: %s" % name, "level": "warn"})
return obj
def get_nb_reads(self, cid, point=0):
......
{"clones": [{"germline": "IGK", "id": "clone_1", "name": "clone_name_1", "reads": [500], "top": 1}, {"germline": "IGK", "id": "clone_3", "name": "clone_name_3", "reads": [500], "top": 2}], "clusters": [], "germlines": {}, "notes": "Sample with clone 1 and 3;", "producer": "vidjil fuse", "reads": {"germline": {"IGK": [9500]}, "segmented": [9500], "total": [9500]}, "samples": {"commandline": ["cmdline_1"], "log": ["log_1"], "number": 1, "original_names": ["seq_1"], "producer": ["vidjil-algo 2018.02"], "run_timestamp": ["2018-03-28 10:26:11"], "timestamp": ["2018-04-06 13:48:48"]}, "timestamp": "2019-04-08 15:18:00", "vidjil_json_version": "2016b", "warn": []}
{"clones": [{"germline": "IGK", "id": "clone_1", "name": "clone_name_1", "reads": [500], "top": 1}, {"germline": "IGK", "id": "clone_2", "name": "clone_name_2", "reads": [500], "top": 2}, {"germline": "IGK", "id": "clone_3", "name": "clone_name_3b", "reads": [500], "top": 3}], "clusters": [], "germlines": {}, "notes": "Sample with clone 1-3; clone 3 have a variation in his name", "producer": "vidjil fuse", "reads": {"germline": {"IGK": [9500]}, "segmented": [9500], "total": [9500]}, "samples": {"commandline": ["cmdline_2"], "log": ["log_2"], "number": 1, "original_names": ["seq_2"], "producer": ["vidjil-algo 2018.02"], "run_timestamp": ["2018-03-28 10:26:11"], "timestamp": ["2018-04-06 13:48:48"]}, "timestamp": "2019-04-08 15:18:00", "vidjil_json_version": "2016b", "warn": []}
!LAUNCH: python ../../fuse.py $FUSE_OPTIONS ../data/warnings/w81_sample_1.vidjil ../data/warnings/w81_sample_2.vidjil -o fuse_warnings.vidjil ; cat fuse_warnings.vidjil
$ Fuse the three files
2: ListWindows: .9500, 9500.
$ Middle file has the good 40-bp windows
1: "id": "clone_1"
1: "id": "clone_2"
1: "id": "clone_3"
$ fields 'warn' present 3 times (sample, clone, level)
1: "level": "warn"
$ Correct warning is present
1: W81
1: Clone have different names between samples: clone_name_3b
\ No newline at end of file
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