Commit 0a51b212 authored by aomietanski's avatar aomietanski

Add percentages in report

parent 385243e3
Pipeline #23851 failed with stage
in 5 seconds
This diff is collapsed.
......@@ -116,9 +116,10 @@ function correctIMGTPositionsForInsertions(data) {
* An additional key (termed 'original') corresponds to the original
* results as returned by CloneDB.
*/
function processCloneDBContents(results) {
function processCloneDBContents(results,model) {
var existing_urls = {};
var final_results = {};
var clones_results = {};
var count_non_viewable = 0;
for (var clone in results) {
if (typeof results[clone].tags != 'undefined' &&
......@@ -139,11 +140,14 @@ function processCloneDBContents(results) {
url = '?sample_set_id='+results[clone].tags.sample_set[i]+'&config='+results[clone].tags.config_id[0];
var msg = '<a href="'+url+'">'+name+'</a> ('+config_name+')';
if (! (url in existing_urls)) {
clones_results[name] = [results[clone].occ,parseFloat(results[clone].tags.percentage[0])];
existing_urls[url] = true;
final_results[msg] = [results[clone].occ,parseFloat(results[clone].tags.percentage[0])];
} else{
final_results[msg][0] += results[clone].occ;
clones_results[name][0] += results[clone].occ;
final_results[msg][1] += parseFloat(results[clone].tags.percentage[0]);
clones_results[name][1] += parseFloat(results[clone].tags.percentage[0]);
}
} else {
......@@ -155,9 +159,7 @@ function processCloneDBContents(results) {
}
}
for (var fr in final_results) {
/* We make a round of the percentage * 1000 to keep 2 numbers after the comma and then we divide the
number by 100 to have the percentage with 2 numbers after the comma*/
final_results[fr] = final_results[fr][0]+' clone'+((final_results[fr][0] === 1) ? '' : 's') + ' (' + (Math.round(final_results[fr][1]*10000)/100) + '%)';
final_results[fr] = final_results[fr][0]+' clone'+((final_results[fr][0] === 1) ? '' : 's') + ' (' + model.formatSize(final_results[fr][1],true,model.getSizeThresholdQ(model.t)) + ')';
}
if (count_non_viewable > 0)
final_results['Non viewable samples'] = count_non_viewable;
......@@ -166,6 +168,7 @@ function processCloneDBContents(results) {
final_results['–'] = "No occurrence of this clone in CloneDB"
final_results.original = results;
final_results.clones_names = clones_results;
return final_results;
}
......
......@@ -6,3 +6,5 @@ $ 19 sequences with a seg field should be found
$ Affectation for sequence YYGGGYYACGYAYAGCGGYGYTTYYCCTYTYTGYTYTGCYAAAYAACYYYYTGTGYCTYTGTGCYGYGTTYCCCGGYYYAAACYCYCYYCCTYGGCYAGGYCYGGCTTTTGGYAYYGYYTYYAATGTYCYYCCC
1:VDJ 1 95 100 105 107 134
$ Percentage for sequence GGAGTCGGGGGAGGCTTGGTACAGCCTGGCAGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTTGATGATTATGCCATGCACTGGGTCCGGCAAGCTCCAGGGAAGGGCCTGGAGTGGGTCTCAGGTATTAGTTGGAATAGTGGTAGCATAGGCTATGCGGACTCTGTGAAGGGCCGATTCACCATCTCCAGAGACAACGCCAAGAACTCCCTGTATCTGCAAATGAACAGTCTGAGAGCTGAGGACACGGCCTTGTATTACTGTGCACCCGGAGGTATGGACGTCTGGGGCCAAGGGACCCTGGTCACC
0.304534313725
......@@ -221,11 +221,9 @@ def write_fuse_to_fasta(data, outfile, used_names, current_filename, options, me
if name in used_names:
used_names[name] += 1
clones_percentage[name] += percentage
additional_header_info.append(str(used_names[name]))
else:
used_names[name] = 1
clones_percentage[name] = percentage
if options.germline:
additional_header_info.append('germline=%s'%clone.d['germline'])
......@@ -235,7 +233,7 @@ def write_fuse_to_fasta(data, outfile, used_names, current_filename, options, me
sample_name = current_filename
additional_header_info.append('sample_name=%s' % sample_name)
additional_header_info.append('percentage=%s'%clones_percentage[name])
additional_header_info.append('percentage=%s'%percentage)
if len(metadata) > 0:
additional_header_info.append(metadata.replace(' ', spacer))
......
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