Commit e2cb9928 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/vidjil/vidjil into antonin-squash

Conflicts:
	browser/css/vidjil.less
	browser/index.html
	browser/js/model.js
	browser/js/scatterPlot.js
parents 55063d74 0ba5c684
...@@ -115,11 +115,14 @@ OnlineFasta::OnlineFasta(const OnlineFasta &of) { ...@@ -115,11 +115,14 @@ OnlineFasta::OnlineFasta(const OnlineFasta &of) {
OnlineFasta::~OnlineFasta() { OnlineFasta::~OnlineFasta() {
if (input_allocated) if (input_allocated)
delete input; delete input;
if (current.seq)
delete [] current.seq;
} }
void OnlineFasta::init() { void OnlineFasta::init() {
line_nb = 0; line_nb = 0;
line = getInterestingLine(); line = getInterestingLine();
current.seq = NULL;
} }
size_t OnlineFasta::getLineNb() { size_t OnlineFasta::getLineNb() {
...@@ -142,7 +145,8 @@ void OnlineFasta::next() { ...@@ -142,7 +145,8 @@ void OnlineFasta::next() {
current.label.erase(); current.label.erase();
current.sequence.erase(); current.sequence.erase();
current.quality.erase(); current.quality.erase();
current.seq = NULL; if (current.seq)
delete [] current.seq;
if (hasNext()) { if (hasNext()) {
switch(line[0]) { switch(line[0]) {
...@@ -201,7 +205,8 @@ void OnlineFasta::next() { ...@@ -201,7 +205,8 @@ void OnlineFasta::next() {
case 'C': B = 1; break; case 'C': B = 1; break;
case 'G': B = 2; break; case 'G': B = 2; break;
case 'T': B = 3; break; case 'T': B = 3; break;
B = 4; break; default:
B = 4; break;
} }
current.seq[i] = B ; current.seq[i] = B ;
} }
......
...@@ -169,6 +169,7 @@ KmerSegmenter::KmerSegmenter(Sequence seq, IKmerStore<KmerAffect> *index, ...@@ -169,6 +169,7 @@ KmerSegmenter::KmerSegmenter(Sequence seq, IKmerStore<KmerAffect> *index,
info = "" ; info = "" ;
info_extra = "seed"; info_extra = "seed";
segmented = false; segmented = false;
reversed = false;
Dend=0; Dend=0;
int s = (size_t)index->getS() ; int s = (size_t)index->getS() ;
......
#!/bin/bash #!/usr/bin/env bash
if [ $# -eq 0 -o "$1" == "-h" -o "$1" == "--help" ]; then if [ $# -eq 0 -o "$1" == "-h" -o "$1" == "--help" ]; then
echo "Usage: $0 <file.should_get> echo "Usage: $0 <file.should_get>
...@@ -74,7 +74,7 @@ TMP_TAP_FILE=$(mktemp tap.XXXX) ...@@ -74,7 +74,7 @@ TMP_TAP_FILE=$(mktemp tap.XXXX)
{ {
nb_tests=0 nb_tests=0
# Count number of tests to be performed # Count number of tests to be performed
nb_tests=`grep -Pc '^[^$#!]' $BASE` nb_tests=`grep -Ec '^[^$#!]' $BASE`
echo "1.."$nb_tests echo "1.."$nb_tests
test_nb=1 test_nb=1
...@@ -161,7 +161,7 @@ while read line; do ...@@ -161,7 +161,7 @@ while read line; do
# Replace whitespaces if needed # Replace whitespaces if needed
if [ $IGNORE_WHITESPACES -ne 0 ]; then if [ $IGNORE_WHITESPACES -ne 0 ]; then
pattern=$(sed -r 's/\s+/[[:space:]]+/g' <<< $pattern) pattern=$(sed -r 's/[[:space:]]+/[[:space:]]+/g' <<< $pattern)
fi fi
debug "Grepping \"$pattern\" in $FILE_TO_GREP" debug "Grepping \"$pattern\" in $FILE_TO_GREP"
......
#!/bin/bash #!/usr/bin/env bash
# This script also parse a file .should_get # This script also parse a file .should_get
# In the .should_get format, every line starting with a # is a comment # In the .should_get format, every line starting with a # is a comment
......
...@@ -614,7 +614,7 @@ span .substitution{ ...@@ -614,7 +614,7 @@ span .substitution{
left :50%; left :50%;
font-size: 13px; font-size: 13px;
padding: 10px; padding: 10px;
background:inherit; background:@background;
display:none; display:none;
} }
...@@ -718,6 +718,7 @@ span .substitution{ ...@@ -718,6 +718,7 @@ span .substitution{
margin-right:5px; margin-right:5px;
margin-left:5px; margin-left:5px;
min-width : 16px; min-width : 16px;
color: @default;
} }
.button2 { .button2 {
...@@ -877,7 +878,7 @@ span.logo ...@@ -877,7 +878,7 @@ span.logo
color: grey; color: grey;
} }
.selector, #list_menu, #top-container, .list_clones, .bot-bar, #bot-container, #popup-container, #file_menu, #tagSelector, .closeButton .selector, #list_menu, #top-container, .list_clones, .bot-bar, #bot-container, #popup-container, #file_menu, #tagSelector, .closeButton, #analysis_menu
{ {
border-color: @border; border-color: @border;
} }
...@@ -1089,9 +1090,6 @@ span.logo ...@@ -1089,9 +1090,6 @@ span.logo
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
max-height: 275px; max-height: 275px;
border: solid;
border-color: @border;
border-width: 1px;
position: relative; position: relative;
} }
...@@ -1169,3 +1167,8 @@ span.logo ...@@ -1169,3 +1167,8 @@ span.logo
select>option:hover { select>option:hover {
background-color: @border; background-color: @border;
} }
.inactive {
opacity: 0.5;
}
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
<body> <body>
<div id="file_menu" > <div id="file_menu" >
<span class="closeButton" onclick="cancel();">X</span> <span class="closeButton" onclick="cancel();">X</span>
...@@ -98,19 +97,20 @@ ...@@ -98,19 +97,20 @@
<div class="menu" id="demo_file_menu" onmouseover="showSelector('demoSelector');"> file <div class="menu" id="demo_file_menu" onmouseover="showSelector('demoSelector');"> file
<div id="demoSelector" class="selector"><div> <div id="demoSelector" class="selector"><div>
<a class="buttonSelector" onclick="javascript:loadData()">load data/analysis</a></br> <div class="menu_box">
<!--<a class="buttonSelector" onclick="javascript:loadAnalysis()">load analysis</a> --> <a class="buttonSelector" onclick="javascript:loadData()">Open </a>
<a class="buttonSelector" onclick="javascript:loadAnalysis()">Open analysis file</a>
</div>
<!--<a class="buttonSelector" onclick="javascript:m.resetAnalysis()">reset analysis</a> --> <!--<a class="buttonSelector" onclick="javascript:m.resetAnalysis()">reset analysis</a> -->
<!--<a class="buttonSelector" onclick="javascript:reset()">reset all</a> --> <!--<a class="buttonSelector" onclick="javascript:reset()">reset all</a> -->
<div id="upload_list"></br> <div class="menu_box">
<a class="buttonSelector" onclick="javascript:m.saveAnalysis()">Save analysis file</a>
<a class="buttonSelector" onclick="javascript:new PDF(m, 'visu2_svg')">Save pdf (graph + selected clones)</a>
</div>
<div class="menu_box">
<div id="upload_list">
</div>
</div> </div>
</div></div>
</div>
<div class="menu" onmouseover="showSelector('loadSelector');"> export
<div id="loadSelector" class="selector"><div>
<a class="buttonSelector" onclick="javascript:m.saveAnalysis()">save analysis</a>
<a class="buttonSelector" onclick="javascript:new PDF(m, 'visu2_svg')">export pdf (graph + selected clones)</a>
</div></div> </div></div>
</div> </div>
...@@ -157,40 +157,37 @@ ...@@ -157,40 +157,37 @@
</div></div> </div></div>
</div> </div>
<div class="menu" id="display_menu" onmouseover="showSelector('displaySelector');"> display <div class="menu" onmouseover="showSelector('filterSelector');" > filter
<div id="displaySelector" class="selector"><div> <div id="filterSelector" class="selector"><div>
<div class="submenu"> <div class="menu_box">
number of clones</br>
<div class="menu_box"> <input id="top_slider" type="range" min="5" max="100" step="5" value="10" onchange="m.displayTop(this.value)" />
tag visibility</br> </div>
<ul> <div class="menu_box">
</ul> tag visibility</br>
</div> <ul id="tagList">
</ul>
</div> </div>
</div></div>
</div>
<!--
<div class="submenu"> <div class="submenu">
<div class="menu_box">
number of clones</br>
<input id="top_slider" type="range" min="5" max="100" step="5" value="10" onchange="m.displayTop(this.value)" />
</div>
<!--Slider for the variation of the epsilon parameter-->
<div class="menu_box"> <div class="menu_box">
<div id="DBSCANEpsSlider"> <div id="DBSCANEpsSlider">
<input id="changeEps" type="range" min="0" max="40" step="1" value="0" onchange="m.changeEps(this.value)" /> <input id="changeEps" type="range" min="0" max="40" step="1" value="0" onchange="m.changeEps(this.value)" />
</div> </div>
</div> </div>
<!--Slider for the variation of the min pts parameter-->
<div class="menu_box"> <div class="menu_box">
<div id="DBSCANNbrSlider"> <div id="DBSCANNbrSlider">
<input id="changeNbr" type="range" min="0" max="100" step="1" value="0" onchange="m.changeNbr(this.value)" /> <input id="changeNbr" type="range" min="0" max="100" step="1" value="0" onchange="m.changeNbr(this.value)" />
</div> </div>
</div> </div>
<!--Slider for the variation of the max distance-->
<div class="menu_box"> <div class="menu_box">
<div id="EditDistanceSlider"> <div id="EditDistanceSlider">
</br> </br>
...@@ -198,35 +195,36 @@ ...@@ -198,35 +195,36 @@
</div> </div>
</div> </div>
<div class="menu_box">
normalization (<span id="normalize_value"> </span>)</br> -->
<input id="normalize" type="checkbox" name="normalize" onclick="m.normalization_switch(this.checked);"> <div class="menu" onmouseover="showSelector('settingsSelector');" > settings
<span id="normalize_info"></span> <div id="settingsSelector" class="selector"><div>
</div> <div class="menu_box">
normalization (<span id="normalize_value"> </span>)</br>
<div class="menu_box"> <input id="normalize" type="checkbox" name="normalize" onclick="m.normalization_switch(this.checked);">
size display</br> <span id="normalize_info"></span>
<input type="radio" name="notation" value="scientific" onchange="m.notation_switch()">scientific notation</input></br> </div>
<input type="radio" name="notation" value="percent" onchange="m.notation_switch()" checked>percent</input>
</div>
<div class="menu_box"> <div class="menu_box">
point key</br> size display</br>
<input type="radio" name="time" value="name" onchange="m.time_switch()" checked>name</input> <input type="radio" name="notation" value="scientific" onchange="m.notation_switch()">scientific notation</input></br>
<input type="radio" name="time" value="sampling_date" onchange="m.time_switch()">sampling date</input></br> <input type="radio" name="notation" value="percent" onchange="m.notation_switch()" checked>percent</input>
</div> </div>
<div class="menu_box">
point key</br>
<input type="radio" name="time" value="name" onchange="m.time_switch()" checked>name</input></br>
<input type="radio" name="time" value="sampling_date" onchange="m.time_switch()">sampling date</input>
</div> </div>
<div class="submenu" id="system_menu" style="display:none"> <div class="submenu" id="system_menu" style="display:none">
<div class="menu_box"> <div class="menu_box">
germline (for color and scatterplot)</br> germline (for color and scatterplot)</br>
<ul id="germline_list"> <ul id="germline_list">
</ul> </ul>
</div> </div>
</div> </div>
</div></div> </div></div>
</div> </div>
......
...@@ -278,7 +278,7 @@ Builder.prototype = { ...@@ -278,7 +278,7 @@ Builder.prototype = {
var self = this; var self = this;
var displaySelector = document.getElementById("displaySelector") var displaySelector = document.getElementById("displaySelector")
var listTag = displaySelector.getElementsByTagName("ul")[0] var listTag = document.getElementById("tagList")
var listGermline = document.getElementById("germline_list") var listGermline = document.getElementById("germline_list")
//reset //reset
......
...@@ -38,11 +38,11 @@ Database.prototype = { ...@@ -38,11 +38,11 @@ Database.prototype = {
$.ajax({ $.ajax({
type: "POST", type: "POST",
timeout: 1000,
crossDomain: true, crossDomain: true,
context: self, //we can't do closure with ajax event handler so we use context to keepref context: self, //we can't do closure with ajax event handler so we use context to keepref
url: url, url: url,
contentType: 'text/plain', contentType: 'text/plain',
timeout: 1000,
xhrFields: {withCredentials: true}, xhrFields: {withCredentials: true},
success: function (result) { success: function (result) {
self.display_result(result, url) self.display_result(result, url)
...@@ -431,6 +431,16 @@ Database.prototype = { ...@@ -431,6 +431,16 @@ Database.prototype = {
}, 5000); }, 5000);
},
user_rights: function (value, name, id) {
var arg = {}
arg.value = value
arg.name = name
arg.id = id
this.call('user/rights', arg)
} }
} }
...@@ -1460,7 +1460,7 @@ Model.prototype = { ...@@ -1460,7 +1460,7 @@ Model.prototype = {
this.addClonesSelected(cloneID); this.addClonesSelected(cloneID);
} }
} }
this.updateElem([cloneID]); this.updateElemStyle([cloneID]);
this.lastCloneSelected = cloneID; this.lastCloneSelected = cloneID;
this.updateElemStyle([cloneID]); this.updateElemStyle([cloneID]);
this.updateAlignmentButton(); this.updateAlignmentButton();
......
...@@ -274,9 +274,9 @@ PDF.prototype = { ...@@ -274,9 +274,9 @@ PDF.prototype = {
//clone reads (%) //clone reads (%)
var data = [] var data = []
for (var i = 0; i < this.m.time.length; i++) { for (var i = 0; i < this.m.time.length; i++) {
data[i] = this.m.getSize(cloneID, i) data[i] = this.m.getStrSize(cloneID, i)
} }
this.row('', data, '%') this.row('', data, 'raw')
this.next_row() this.next_row()
this.sequence(cloneID) this.sequence(cloneID)
......
This diff is collapsed.
...@@ -226,9 +226,19 @@ Segment.prototype = { ...@@ -226,9 +226,19 @@ Segment.prototype = {
if (document.getElementById("seq" + list[i])) { if (document.getElementById("seq" + list[i])) {
var spanF = document.getElementById("f" + list[i]); var spanF = document.getElementById("f" + list[i]);
this.div_elem(spanF, list[i]); this.div_elem(spanF, list[i]);
} else {
this.addToSegmenter(list[i]);
this.show();
}
} else {
if (document.getElementById("seq" + list[i])) {
var element = document.getElementById("seq" + list[i]);
element.parentNode.removeChild(element);
} }
} }
} }
}, },
/* genere le code HTML des infos d'un clone /* genere le code HTML des infos d'un clone
......
# coding: utf8 # coding: utf8
import gluon.contrib.simplejson
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
def index(): def index():
import gluon.contrib.simplejson
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
if not auth.user : if not auth.user :
res = {"redirect" : "default/user/login"} res = {"redirect" : "default/user/login"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':')) return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
...@@ -16,22 +14,11 @@ def index(): ...@@ -16,22 +14,11 @@ def index():
def add(): def add():
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
return dict(message=T('add config')) return dict(message=T('add config'))
#TODO check data #TODO check data
def add_form(): def add_form():
import gluon.contrib.simplejson, shutil, os.path
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
error ="" error =""
if request.vars['config_name'] == "" : if request.vars['config_name'] == "" :
...@@ -61,19 +48,11 @@ def add_form(): ...@@ -61,19 +48,11 @@ def add_form():
def edit(): def edit():
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
return dict(message=T('edit config')) return dict(message=T('edit config'))
def edit_form(): def edit_form():
import gluon.contrib.simplejson, shutil, os.path import shutil, os.path
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
error ="" error =""
...@@ -103,18 +82,10 @@ def edit_form(): ...@@ -103,18 +82,10 @@ def edit_form():
return gluon.contrib.simplejson.dumps(res, separators=(',',':')) return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def confirm(): def confirm():
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
return dict(message=T('confirm config deletion')) return dict(message=T('confirm config deletion'))
def delete(): def delete():
import gluon.contrib.simplejson, shutil, os.path import shutil, os.path
if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400
#delete data_file using this config #delete data_file using this config
db(db.data_file.config_id==request.vars["id"]).delete() db(db.data_file.config_id==request.vars["id"]).delete()
......
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
## - call exposes all registered services (none by default) ## - call exposes all registered services (none by default)
######################################################################### #########################################################################
import gluon.contrib.simplejson
if request.env.http_origin: if request.env.http_origin:
response.headers['Access-Control-Allow-Origin'] = request.env.http_origin response.headers['Access-Control-Allow-Origin'] = request.env.http_origin
response.headers['Access-Control-Allow-Credentials'] = 'true' response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Max-Age'] = 86400 response.headers['Access-Control-Max-Age'] = 86400