Commit 67744b02 authored by Marc Duez's avatar Marc Duez
Browse files
parents 6996ee8c 3bee4487
......@@ -102,12 +102,9 @@ DynProg::DynProg(const string &x, const string &y, DynProgMode mode, const Cost&
S[i] = new int[n+1];
}
B = new int**[m+1];
B = new backtrack_info*[m+1];
for (int i = 0; i <= m; i++) {
B[i] = new int*[n+1];
for (int j = 0; j <= n; j++) {
B[i][j] = new int[3];
}
B[i] = new backtrack_info[n+1];
}
this -> mode = mode;
......@@ -131,11 +128,6 @@ DynProg::~DynProg() {
}
delete [] S;
for (int i = 0; i <= m; i++) {
for (int j = 0; j <= n; j++) {
delete [] B[i][j];
}
}
for (int i = 0; i <= m; i++) {
delete [] B[i];
}
......@@ -209,45 +201,45 @@ int DynProg::compute()
}
if (best == 0){
B[i][j][2] = FIN;
B[i][j].type = FIN;
}
}
S[i][j] = best ;
if (best==subst){
B[i][j][0] = i-1 ;
B[i][j][1] = j-1 ;
B[i][j][2] = SUBST ;
B[i][j].i = i-1 ;
B[i][j].j = j-1 ;
B[i][j].type = SUBST ;
}
if (best==inser){
B[i][j][0] = i-1 ;
B[i][j][1] = j ;
B[i][j][2] = INSER ;
B[i][j].i = i-1 ;
B[i][j].j = j ;
B[i][j].type = INSER ;
}
if (best==delet){
B[i][j][0] = i ;
B[i][j][1] = j-1 ;
B[i][j][2] = DELET ;
B[i][j].i = i ;
B[i][j].j = j-1 ;
B[i][j].type = DELET ;
}
if (best==homo2x){
B[i][j][0] = i-2 ;
if (B[i][j][0] < 0) B[i][j][0] = 0 ;
B[i][j][1] = j-1 ;
B[i][j][2] = HOMO2X ;
B[i][j].i = i-2 ;
if (B[i][j].i < 0) B[i][j].i = 0 ;
B[i][j].j = j-1 ;
B[i][j].type = HOMO2X ;
}
if (best==homo2y){
B[i][j][0] = i-1 ;
B[i][j][1] = j-2 ;
if (B[i][j][1] < 0) B[i][j][1] = 0 ;
B[i][j][2] = HOMO2Y ;
B[i][j].i = i-1 ;
B[i][j].j = j-2 ;
if (B[i][j].j < 0) B[i][j].j = 0 ;
B[i][j].type = HOMO2Y ;
}
if (mode == Local || mode == LocalEndWithSomeDeletions)
{
if (best == 0){
B[i][j][2] = FIN;
B[i][j].type = FIN;
}
}
......@@ -256,10 +248,10 @@ int DynProg::compute()
if (mode == Local || mode == LocalEndWithSomeDeletions)
{
for (int i=0; i<=n; i++){
B[0][i][2] = FIN;
B[0][i].type = FIN;
}
for (int i=0; i<=m; i++){
B[i][0][2] = FIN;
B[i][0].type = FIN;
}
}
......@@ -274,12 +266,12 @@ int DynProg::compute()
best_j = j ;
}
for (int i=1; i<=n; i++){
B[0][i][0] = 0 ;
B[0][i][1] = i-1 ;
B[0][i][2] = DELET;
B[0][i].i = 0 ;
B[0][i].j = i-1 ;
B[0][i].type = DELET;
}
for (int i=0; i<=m; i++){
B[i][0][2] = FIN;
B[i][0].type = FIN;
}
}
......@@ -295,12 +287,12 @@ int DynProg::compute()
}
for (int i=0; i<=n; i++){
B[0][i][2] = FIN;
B[0][i].type = FIN;
}
for (int i=0; i<=m; i++){
B[i][0][0] = i-1 ;
B[i][0][1] = 0 ;
B[i][0][2] = INSER;
B[i][0].i = i-1 ;
B[i][0].j = 0 ;
B[i][0].type = INSER;
}
}
......@@ -312,16 +304,16 @@ int DynProg::compute()
best_score = S[m][n];
for (int i=0; i<=m; i++){
B[i][0][0] = i-1 ;
B[i][0][1] = 0 ;
B[i][0][2] = INSER;
B[i][0].i = i-1 ;
B[i][0].j = 0 ;
B[i][0].type = INSER;
}
for (int i=1; i<=n; i++){
B[0][i][0] = 0 ;
B[0][i][1] = i-1 ;
B[0][i][2] = DELET;
B[0][i].i = 0 ;
B[0][i].j = i-1 ;
B[0][i].type = DELET;
}
B[0][0][2] = FIN;
B[0][0].type = FIN;
}
if (reverse_x)
......@@ -370,12 +362,12 @@ void DynProg::backtrack()
ostringstream back;
while ( B[ti][tj][2] != FIN ){
while ( B[ti][tj].type != FIN ){
tmpi=B[ti][tj][0];
tmpj=B[ti][tj][1];
tmpi=B[ti][tj].i;
tmpj=B[ti][tj].j;
if (B[ti][tj][2] == SUBST ){
if (B[ti][tj].type == SUBST ){
linkgap[g1]=g2;
back_s1 << x[ti-1];
g1--;
......@@ -389,7 +381,7 @@ void DynProg::backtrack()
}
}
if (B[ti][tj][2] == INSER ){
if (B[ti][tj].type == INSER ){
linkgap[g1]=g2;
back_s1 << x[ti-1];
g1--;
......@@ -398,7 +390,7 @@ void DynProg::backtrack()
back_tr << ".";
}
if (B[ti][tj][2] == DELET){
if (B[ti][tj].type == DELET){
linkgap[g1]=g2;
back_s1 << " ";
gap1[g1]++;
......@@ -407,7 +399,7 @@ void DynProg::backtrack()
back_tr << ".";
}
if (B[ti][tj][2] == HOMO2X ){
if (B[ti][tj].type == HOMO2X ){
linkgap[g1]=g2;
back_s1 << x[ti-1] << x[ti-2];
g1--;
......@@ -420,7 +412,7 @@ void DynProg::backtrack()
}
if (B[ti][tj][2] == HOMO2Y ){
if (B[ti][tj].type == HOMO2Y ){
linkgap[g1]=g2;
back_s1 << " " << x[ti-1] ;
gap1[g1]++;
......
......@@ -15,6 +15,12 @@ using namespace std;
float identity_percent(int score);
typedef struct {
int i;
int j;
int type;
} backtrack_info;
class Cost
{
public:
......@@ -103,7 +109,7 @@ class DynProg
friend ostream& operator<<(ostream& out, const DynProg& dp);
int **S;
int ***B;
backtrack_info **B;
int *gap1 ;
int *linkgap ;
int *gap2 ;
......
......@@ -59,7 +59,7 @@
// GIT_VERSION should be defined in "git-version.h", created by "create-git-version-h.sh", to be used outside of releases
#include "git-version.h"
#define VIDJIL_JSON_VERSION "2014.09"
#define VIDJIL_JSON_VERSION "2014.10"
//$$ #define (mainly default options)
......@@ -206,7 +206,6 @@ void usage(char *progname)
<< " -b <string> output basename (by default basename of the input file)" << endl
<< " -a output all sequences by cluster (" << CLONE_FILENAME << "*), to be used only on small datasets" << endl
<< " -x do not compute representative sequences" << endl
<< " -v verbose mode" << endl
<< endl
......
......@@ -2,7 +2,6 @@
#+AUTHOR: The Vidjil team (Mathieu, Mikaël and Marc)
This is the help of the Vidjil browser : [[http://www.vidjil.org/browser]].
This help will be extended in a few months.
Further help can always be asked to [[mailto:contact@vidjil.org][contact@vidjil.org]]. We can also arrange phone or Skype meeting.
The Vidjil team (Mathieu, Mikaël and Marc)
......@@ -12,38 +11,41 @@ The Vidjil team (Mathieu, Mikaël and Marc)
** Browser
The Vidjil browser runs in any modern browser. It has been successfully tested on the following platforms
- Firefox version >= XX
- Chrome version >= XX
- IE version >= XX
- Firefox version >= 32
- Chrome version >= 38
- IE version >= 10.0 (Vidjil will not run on IE 9.0 or below)
- Opera version >= XX
- Safari version >= XX
- Safari version >= 6.0
** The .vidjil files
The vidjil browser displays .vidjil files that summarize the V(D)J
rearrangements and the sequences found in a run. Such files can be
obtained:
rearrangements and the sequences found in a run.
If you have an access to the patient database, you are able to upload,
manage, process your runs (.fasta/.fastq or .clntab files) directly on the browser
(see below 'patient database'), and the server behind the patient
database computes these .vidjil files.
Otherwise, such .vidjil files can be obtained:
- by sending us your .fasta/.fastq files, either through
http://www.vidjil.org/submit.html or using any other method
(e.g. your own FTP)
- from the command-line version of Vidjil (starting from
.fasta/.fastq files, see doc/algo.org in the command-line version).
To gather several .vidjil files, you have to use the [[../server/fuse.py][fuse.py]] script
- in a next release (start of 2015), you will be able to upload,
manage and process your runs (.fasta/.fastq files) directly on the browser (with
authentication to ensure that you keep the control on your data).
- or by post-processing of other V(D)J analysis pipelines (contact us
if you are interested)
* First aid
- Go to the “file”/“import/export” menu to access your data.
Your files are protected with your login and password.
There is always a “sample/L2-LIL.data” dataset for demonstration purposes.
- Open data by:
- either with “patients”/“open patient” (if you have access to the database)
- or with “file”/“import/export”, manually selecting a .vidjil file
There is always a “LIL-L2” dataset for demonstration purposes.
- You can change the number of displayed clones by moving the slider “number of clones” (menu “filter”)
The maximal number of clones that can be displayed depends on what has been run before
The maximal number of clones that can be displayed depends on the processing step before
- Due to sequencing errors, there may be several clones corresponding to a real clone.
- You can select several clones (for example those sharing a same V and a same J),
......@@ -115,13 +117,14 @@ obtained:
- You can unselect all sequences by clicking on the background of the scatterplot.
** The database / server connection (experimental)
** The patient database (experimental)
A *server* is currently developed to link the browser and the
algorithmic part. The goal is that the clinicians will be able to
upload, manage and process their runs directly on the browser (with
authentication).
This part is experimental, we have provided an access to some labs to this feature.
The release is expected to be at Q1 2015.
A server links the browser and the algorithmic part. You can upload,
manage, process your runs (.fasta/.fastq or .clntab files) directly on
the browser.
*** Patients
......@@ -129,10 +132,8 @@ Once you are authentified, this page show the patient list. Here you
can see your patients and patients whose permission has been given to you.
New patients can be added ('add patient'), edited ('e') or deleted ('X').
By default, you are the only one who can see/access this new patient.
You can grant access to other people or group ('P'),
people will be able to see your patient and make some action depending of the access granted.
By default, you are the only one who can see and update this new patient.
If you have an admin access, you can grant access to other users ('p').
*** Samples
......
......@@ -51,7 +51,7 @@ def run_request():
id_patient = db.sequence_file[request.vars["sequence_file_id"]].patient_id
if not auth.has_permission('admin', 'patient', id_patient) :
error += "you don't have permission to run request for this patient ("+str(id_patient)+"), "
error += "you do not have permission to launch process for this patient ("+str(id_patient)+"), "
if error == "" :
res = schedule_run(request.vars["sequence_file_id"], request.vars["config_id"])
......@@ -81,7 +81,7 @@ def get_data():
error += "id config needed, "
if not auth.has_permission('admin', 'patient', request.vars["patient_id"]) and \
not auth.has_permission('read', 'patient', request.vars["patient_id"]):
error += "you don't have permission to consult this patient ("+id_patient+")"
error += "you do not have permission to consult this patient ("+id_patient+")"
query = db( ( db.fused_file.patient_id == request.vars["patient_id"] )
& ( db.fused_file.config_id == request.vars["config_id"] )
......@@ -131,7 +131,7 @@ def get_analysis():
error += "id config needed, "
if not auth.has_permission('admin', 'patient', request.vars["patient_id"]) and \
not auth.has_permission('read', 'patient', request.vars["patient_id"]):
error += "you don't have permission to consult this patient ("+id_patient+")"
error += "you do not have permission to consult this patient ("+id_patient+")"
## empty analysis file
res = {"samples": {"number": 0,
......@@ -189,7 +189,7 @@ def save_analysis():
if not "config_id" in request.vars:
error += "id config needed, "
if not auth.has_permission('admin', 'patient', request.vars['patient_id']) :
error += "you don't have permission to make change on this patient, "
error += "you do not have permission to save changes on this patient"
if error == "" :
analysis_query = db( (db.analysis_file.patient_id == request.vars['patient_id'])
......
......@@ -217,7 +217,9 @@ def remove_permission():
auth.del_permission(request.vars["group_id"], 'admin', db.patient, request.vars["patient_id"])
auth.del_permission(request.vars["group_id"], 'read', db.patient, request.vars["patient_id"])
res = {"redirect" : "patient/permission" , "args" : { "id" : request.vars["patient_id"]} }
res = {"redirect" : "patient/permission" ,
"args" : { "id" : request.vars["patient_id"]},
"message" : "access removed to '%s'" % request.vars["group_id"]}
log.info(res)
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
......@@ -232,7 +234,9 @@ def change_permission():
if (auth.has_permission('admin', 'patient', request.vars["patient_id"]) ):
auth.add_permission(request.vars["group_id"], request.vars["permission"], db.patient, request.vars["patient_id"])
res = {"redirect" : "patient/permission" , "args" : { "id" : request.vars["patient_id"]} }
res = {"redirect" : "patient/permission" ,
"args" : { "id" : request.vars["patient_id"]},
"message" : "access '%s' granted to '%s'" % (request.vars["permission"], request.vars["group_id"])}
log.info(res)
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
......
......@@ -224,7 +224,10 @@ class MsgUserAdapter(logging.LoggerAdapter):
def process(self, msg, kwargs):
if type(msg) is dict:
msg = msg['message']
if 'message' in msg:
msg = msg['message']
else:
msg = '?'
ip = request.client
if ip in ips:
ip = "%s/%s" % (ip, ips[ip])
......
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