Commit e7cca318 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'feature-t/4566-warnings-clone-multiple-denominations' into 'dev'

Resolve "Warnings, avoir un nouveau wrning si un clone a plusiuers dénomination sur différents samples"

Closes #4566

See merge request !850
parents f6bb6e74 3c0a193b
Pipeline #188654 passed with stages
in 18 minutes and 27 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,8 +222,24 @@ 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"]
msg = "Clone have different names between samples: %s" % name
obj.addWarning(code="W81", msg=msg, level="warn")
return obj
def addWarning(self, code, msg, level):
# init warn field if not already present
if not "warn" in self.d:
self.d["warn"] = []
self.d["warn"].append( {"code":code, "msg":msg, "level": level})
return
def get_nb_reads(self, cid, point=0):
return self[cid]["reads"][point]
......
{
"notes": "Sample with clone 1 and 3;",
"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": {},
"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": []
}
{
"notes": "Sample with clone 1-3; clone 3 have a variation in his name",
"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": {},
"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": []
}
\ No newline at end of file
!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