Commit fa108f65 authored by Marc Duez's avatar Marc Duez
Browse files

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

parents f641d7be 479944e6
......@@ -57,9 +57,9 @@ should_gcovr: should_coverage
### Upload to coveralls.io
unit_coveralls:
coveralls --exclude release --exclude algo/tests --exclude algo/tools --gcov-options '\-lp'
coveralls --exclude release --exclude algo/tests --exclude algo/tools --exclude tests --exclude tools --gcov-options '\-lp'
should_coveralls:
coveralls --exclude release --exclude algo/tests --exclude algo/tools --gcov-options '\-lp' -r algo
coveralls --exclude release --exclude algo/tests --exclude algo/tools --exclude tests --exclude tools --gcov-options '\-lp' -r algo
data germline: %:
make -C $@
......
#include <algorithm>
#include "cut-pcr.h"
#define MIN_CUT 20
void cut(Sequence read, vector<Sequence> primers, int verbose,
map <string, int> &stats,
const Cost cutCost, const int cutRelativeThreshold)
// ostream &cut_file)
{
string seq = read.sequence ;
if (seq.size() < MIN_CUT)
return;
if (verbose)
{
cout << endl ;
cout << seq << endl ;
}
vector<int> hits;
// For each primer
for (unsigned p = 0 ; p<primers.size() ; p++)
{
Sequence pri = primers[p] ;
string primer = pri.sequence;
bool positive = true ;
// Les amorces '-' sont deja en revcomp
// if (pri.label_full[0] == '-') // dans le fichier
// positive = not positive ;
if (pri.label[0] == '-') // detection sens ou antisens
positive = not positive ;
int shift_pos = positive ? primer.size() : 0 ;
int threshold = (primer.size() * cutCost.match) + cutRelativeThreshold ;
if (verbose)
{
cout << "==" << " " << pri.label << " " << pri.label_full << " ";
cout << " shift: " << shift_pos ;
cout << " size:" << primer.size() ;
cout << " threshold:" << threshold ;
cout << " \t" << primer << " \t" ;
}
DynProg dp = DynProg(primer, seq, DynProg::SemiGlobal, cutCost);
// Run dynprog
int score = dp.compute();
if (verbose)
cout << "\t best score: " << score << " @" << dp.best_j << " ";
// Collect hits
vector<int> my_hits;
dp.SemiGlobal_hits_threshold(my_hits, threshold, shift_pos, verbose);
if (verbose)
cout << endl;
for (/* */; !my_hits.empty(); my_hits.pop_back())
{
stats[primer]++ ;
int pos = my_hits.back() ;
hits.push_back(pos);
if (verbose)
{
int z = pos - primer.size() + shift_pos ;
if (z > 0)
cout << string(z, ' ') ;
cout << primer ;
cout << "\t @" << pos << " " << shift_pos << " " << primers[p].label << " " << primers[p].label_full << endl ;
}
}
}
// Process hits
hits.push_back(0);
sort(hits.begin(), hits.end());
if (verbose)
cout << " --> " ;
int old_pos = seq.size();
int nb_cut = 0;
for (/* */; !hits.empty(); hits.pop_back())
{
int pos = hits.back();
if (verbose)
cout << pos << " " ;
if (old_pos - pos > MIN_CUT)
{
// Output cut pos..old_pos
// TODO: reflechir sur +/- 1 de chaque cote :-)
if (verbose)
cout << "! " << endl ;
nb_cut++ ;
Sequence cut ;
cut.label = read.label + "--" + string_of_int(nb_cut) + " " + string_of_int(pos) + " " + string_of_int(old_pos) ;
cut.sequence = seq.substr(pos, old_pos-pos) ;
// cut_file << cut ;
cout << cut ;
}
old_pos = pos ;
}
if (verbose)
cout << "\n ==> " << nb_cut << " cuts" << endl ;
}
#include <map>
#include "fasta.h"
#include "dynprog.h"
void cut(Sequence read, vector<Sequence> primers, int verbose,
map <string, int> &stats,
const Cost cutCost, const int cutRelativeThreshold);
// ostream cut_file);
......@@ -565,7 +565,8 @@ Database.prototype = {
/*crée une liste de suggestion dynamique autour d'un input text*/
function suggest_box(id, list) {
list = list.sort()
var input_box = document.getElementById(id)
//positionnement d'une boite vide pour contenir les suggestions
......@@ -623,11 +624,6 @@ function suggest_box(id, list) {
count++
}
}
if (count == 0){
var suggestion = document.createElement("div")
suggestion.appendChild(document.createTextNode("no suggestions ..."))
suggest_list.appendChild(suggestion)
}
};
//masque la liste
......
......@@ -29,6 +29,9 @@ query = db(
<td class="column_100"> birth </td>
<td> info </td>
<td class="column_100"> configs </td>
{{if auth.has_membership("admin"):}}
<td class="column_100"> users </td>
{{pass}}
<td class="column_100"> files </td>
<td class="column5"> </td>
<td class="column5"> </td>
......@@ -47,6 +50,21 @@ query = db(
<td> {{for row2 in db( db.fused_file.patient_id == row.patient.id ).select(db.fused_file.config_id, distinct=True) :}}
{{=db.config[row2.config_id].name}}
{{pass}}</td>
<!-- groups/users -->
{{if auth.has_membership("admin"):}}
<td>
{{for row3 in db(
(db.auth_permission.name == "read") &
(db.auth_permission.table_name == "patient") &
(db.auth_permission.record_id == row.patient.id)
).select( orderby=db.auth_permission.group_id, distinct=True ) :}}
{{if db.auth_permission[row3.id].group_id > 2:}}
{{=db.auth_permission[row3.id].group_id}}
{{pass}}
{{pass}}
</td>
{{pass}}
<!-- end groups/users -->
<td> {{=row[count]}}</td>
{{if auth.has_membership("admin"):}}
<td onclick="db.call('patient/permission', {'id' :'{{=row.patient.id}}'} )" > p </td> {{else:}} <td></td> {{pass}}
......
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