Commit 49ec131d authored by root's avatar root
parents e05a863c 548b61a4
......@@ -10,7 +10,11 @@ test: all
# make -C $(VIDJIL_SERVER_SRC) tests
make -C $(VIDJIL_ALGO_SRC)/tests
make should
make pytests
pytests:
@echo "*** Launching python tests..."
python server/fuse.py --test x
should: all
@echo
......
......@@ -157,10 +157,8 @@ JsonArray WindowsStorage::sortedWindowsToJsonArray(map <junction, JsonList> json
{
JsonList windowsList;
//JsonArray normalization_ratios = json_normalization(norm_list, it->second,
// nb_segmented);
JsonArray json_size;
JsonArray json_seg;
json_size.add(it->second);
if (json_data_segment.find(it->first) != json_data_segment.end()){
......@@ -170,11 +168,11 @@ JsonArray WindowsStorage::sortedWindowsToJsonArray(map <junction, JsonList> json
}
windowsList.add("window", it->first);
windowsList.add("size", json_size);
//windowsList.add("ratios", normalization_ratios);
windowsList.add("top", top++);
windowsList.add("id", this->getId(it->first));
JsonList seg_stat = this->statusToJson(it->first);
windowsList.add("seg_stat", seg_stat);
json_seg.add(seg_stat);
windowsList.add("seg_stat", json_seg);
windowsArray.add(windowsList);
}
......
#!/bin/sh
tr "\n" " " | sed "s/}/}\n/g"
!LAUNCH: ../../vidjil -G ../../germline/IGH -d ../../data/Stanford_S22.fasta ; cat out/vidjil.data | sh format-json.sh
$ Number of reads
1:"reads_total" : [ 13153 ] ,
$ Number of segmented reads
1:"reads_segmented" : [ 13139 ] ,
$ Most abundant window
1:"window" : "CCACCTATTACTGTACCCGGGAGGAACAATATAGCAGCTGGTACTTTGACTTCTGGGGCC", "size" : [ 8 ]
!LAUNCH: ../../vidjil -G ../../germline/IGH -d ../../data/Stanford_S22.fasta ; python ../../server/fuse.py out/vidjil.data out/vidjil.data -o out/fused.data ; cat out/fused.data | sh format-json.sh
$ Points list
1:"point": [ "", "" ]
$ Most abundant window, twice, fused
1:"window": "CCACCTATTACTGTACCCGGGAGGAACAATATAGCAGCTGGTACTTTGACTTCTGGGGCC", "id": .*, "size": [ 8, 8 ]
......@@ -593,7 +593,7 @@ int main (int argc, char **argv)
f_germlines.push_back("germline/TRAJ.fa");
f_germlines.push_back("germline/TRBV.fa");
f_germlines.push_back("germline/TRDJ.fa");
f_germlines.push_back("germline/TRBD.fa");
f_germlines.push_back("germline/TRBJ.fa");
f_germlines.push_back("germline/TRDV.fa");
......
......@@ -1670,13 +1670,21 @@ Model.prototype = {
//segmentation info
html += "<tr><td class='header' colspan='" + (time_length + 1) + "'> segmentation information</td></tr>"
html += "<tr><td> segmented </td><td colspan='" + time_length + "'>" + this.getStatus(id) + "</td></tr>"
var total_stat = 0;
for (var key in this.windows[id].seg_stat) total_stat += this.windows[id].seg_stat[key]
for (var key in this.windows[id].seg_stat){
html += "<tr><td> "+this.segmented_mesg[key]+" </td><td colspan='" + time_length + "'>"
+ this.windows[id].seg_stat[key] + " (" + ((this.windows[id].seg_stat[key]/total_stat) * 100)
.toFixed(1) + " %) </td></tr>"
var total_stat = [];
for (var i=0; i<this.windows[id].seg_stat.length; i++) total_stat[i] = 0
for (var i=0; i<this.windows[id].seg_stat.length; i++){
for (var key in this.windows[id].seg_stat[i]) total_stat[i] += this.windows[id].seg_stat[i][key]
}
for (var key in this.windows[id].seg_stat[0]){
html += "<tr><td> "+this.segmented_mesg[key]+"</td>"
for (var i = 0; i < time_length; i++) {
html += "<td>"+this.windows[id].seg_stat[i][key]
+ " (" + ((this.windows[id].seg_stat[i][key]/total_stat[i]) * 100).toFixed(1) + " %)</td>"
}
}
html += "<tr><td> sequence </td><td colspan='" + time_length + "'>" + this.windows[id].sequence + "</td></tr>"
html += "<tr><td> window </td><td colspan='" + time_length + "'>" + this.windows[id].window + "</td></tr>"
html += "<tr><td> V </td><td colspan='" + time_length + "'>" + this.windows[id].V + "</td></tr>"
......
// This file gives the description of germlines and "pseudo-germlines" for incomplete/irregular rearrangements
germlines = {
// TRA
"TRA": {
"shortcut": "A",
"description": "Human T-cell receptor, alpha locus (14q11.2)",
"5": ["TRAV.fa"],
"3": ["TRAJ.fa"],
"parameters": {
"seed": "13s"
}
},
// TRB
"TRB": {
"shortcut": "B",
"description": "Human T-cell receptor, beta locus (7q34)",
"5": ["TRBV.fa"],
"4": ["TRBD.fa"],
"3": ["TRBJ.fa"],
"parameters": {
"seed": "12s"
}
},
// TRG
"TRG": {
"shortcut": "G",
"description": "Human T-cell receptor, gamma locus (7p14)",
"5": ["TRGJ.fa"],
"3": ["TRGV.fa"],
"parameters": {
"seed": "10s"
}
},
// TRD
"TRD": {
"shortcut": "D",
"description": "Human T-cell receptor, delta locus (14q11.2)",
"5": ["TRDV.fa"],
"4": ["TRDD.fa"],
"3": ["TRDJ.fa"],
"parameters": {
"seed": "10s"
}
},
"TRD+": {
"shortcut": "d",
"description": "Human T-cell receptor, delta locus (14q11.2), incomplete Dd2-Dd3 rearrangements",
"follows": "TRD",
"5": ["TRDD-d2.fa"],
"3": ["TRDD-d3.fa"]
// "seed": "8" ? (pipeline.py)
},
// IGH
"IGH": {
"shortcut": "H",
"description": "Human immunoglobulin, heavy locus (14q32.33)",
"5": ["IGHV.fa"],
"4": ["IGHD.fa"],
"3": ["IGHJ.fa"],
"parameters": {
"seed": "12s"
}
},
"IGH+": { // "DHJH" ?
"shortcut": "h",
"description": "Human immunoglobulin, heavy locus (14q32.33), incomplete DH-JH rearrangements",
"follows": "IGH",
"5": ["IGHD.fa"],
"3": ["IGHJ.fa"]
// "seed": "10s" ? (pipeline.py)
},
// IGK
"IGK": {
"shortcut": "K",
"description": "Human immunoglobulin, kappa locus (2p11.2)",
"5": ["IGKV.fa"],
"3": ["IGKJ.fa"],
"parameters": {
"seed": "11s"
}
},
"IGK+": {
"shortcut": "k",
"description": "Human immunoglobulin, kappa locus (2p11.2), Vk-KDE and Intron-KDE rearrangements",
"follows": "IGK",
"5": ["IGKV.fa", "INTRON.fa"],
"3": ["KDE.fa"]
// "seed": "10s" ? (pipeline.py)
},
// IGL
"IGL": {
"shortcut": "L",
"description": "Human immunoglobulin, lambda locus (22q11.2)",
"5": ["IGLV.fa"],
"3": ["IGLJ.fa"],
"parameters": {
"seed": "11s"
}
}
}
......@@ -68,6 +68,7 @@ class Window:
def __add__(self, other):
#data we don't need to duplicate
myList = [ "V", "D", "J", "Vend", "Dend", "Jstart", "Dstart", "top", "window", "Nlength", "sequence", "name", "id", "status"]
myList += [ "seg_stat" ] # temporary hack, TODO
obj = Window(1)
t1 = []
......@@ -400,6 +401,7 @@ class ListWindows:
return result
raise TypeError(repr(obj) + " fail !")
if isinstance(obj, Window):
result = {}
for key in obj.d :
......@@ -407,7 +409,14 @@ class ListWindows:
return result
raise TypeError(repr(obj) + " fail !")
if isinstance(obj, dict):
result = {}
for key in obj :
result[key]= obj[key]
return result
raise TypeError(repr(obj) + " fail !")
def toPython(self, obj_dict):
'''Reverse serializer for json module'''
......@@ -426,6 +435,12 @@ class ListWindows:
for key in obj_dict :
obj.d[key]=obj_dict[key]
return obj
if not "window" in obj_dict and not "reads_segmented" in obj_dict:
res = {}
for key in obj_dict :
res[key]=obj_dict[key]
return res
......
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