Commit 10674992 authored by lcottret's avatar lcottret

Bouton reset

Nombre de décimales augmenté pour la p-value
Colonne date dans la liste des analyses
parent e7e2b052
......@@ -16,7 +16,7 @@ sub LaunchAnalysis {
my $userid = &__GetUserId( \$o_webbuilder );
if ( &MODE_TEST == 1 ) {
$userid = "l.cottret\@gmail.com";
$userid = "michel\@gmail.com";
}
my %h_param = (
......@@ -50,7 +50,8 @@ sub LaunchAnalysis {
#print STDERR "DEBUG $outdir/analysis.json\n";
my $cmd = "$FindBin::RealBin/../bin/int/bbric_orthomcl-companion.pl --verbose --outdir=$outdir --analysis_cfg=$outdir/analysis.json";
my $cmd =
"$FindBin::RealBin/../bin/int/bbric_orthomcl-companion.pl --verbose --outdir=$outdir --analysis_cfg=$outdir/analysis.json";
my $ret = system("(nohup $cmd > $outdir/log ) 2> $outdir/error&");
print STDERR "[DEBUG] cmd : $cmd\n";
......@@ -87,7 +88,7 @@ sub LaunchAnalysis {
# Liste les analyses à partir du repertoire de l'utilisateur
#
sub ListAnalyses {
print STDERR "DEBUG ListAnalysis\n";
my $o_webbuilder = shift;
......@@ -99,7 +100,7 @@ sub ListAnalyses {
my $userid = &__GetUserId( \$o_webbuilder );
if ( &MODE_TEST == 1 ) {
$userid = 'l.cottret@gmail.com';
$userid = 'michel@gmail.com';
}
my %h_param = (
......@@ -130,17 +131,9 @@ sub ListAnalyses {
symlink( $out_dir, "$tmp_dir/$md5" );
$out_dir = "$tmp_dir/$md5";
my $out_url = $tmp_url . "/" . $md5;
print STDERR "[DEBUG] repository user : $out_dir\n";
# if ( &MODE_TEST == 1 ) {
# $out_dir =
# $O_CONF->Get('portal_install_dir')
# . "/site/data/examples/results/";
# $out_url =
# $O_CONF->Get("portal_web_server") . "/"
# . $O_CONF->Get("portal_http_root")
# . "/site/data/examples/results/";
# }
my $out_url = $tmp_url . "/" . $md5;
# liste les repertoires dans le repertoire de l'utilisateur
foreach my $subdir ( glob "$out_dir/*" ) {
......@@ -152,13 +145,14 @@ sub ListAnalyses {
$rh_desc->{"title"} = "";
$rh_desc->{"url"} = "";
# Si un fichier error existe, c'est lui qui prime pour definir le status
# ensuite le fichier success puis le fichier log
# Il faut que l'un des trois fichiers soient presents pour que l'analyse soit listee
# checke si un fichier success, log, ou error existe
foreach my $file ( glob "$subdir/*" ) {
#print STDERR "File : $file\n";
$rh_desc->{"url"} =
$out_url . "/" . basename($subdir);
$rh_desc->{"url"} = $out_url . "/" . basename($subdir);
if ( !-d $file ) {
......@@ -168,33 +162,43 @@ sub ListAnalyses {
# l'analyse est en cours
# le fichier contient les logs
$rh_desc->{"status"} = "log";
$rh_desc->{"log"} = &Cat($file);
$rh_desc->{"log"} = &Cat($file);
if ( $rh_desc->{"status"} ne "success"
&& $rh_desc->{"status"} ne "error" )
{
$rh_desc->{"status"} = "log";
}
}
elsif ( $fileName eq "error" ) {
# l'analyse s'est terminee par une erreur
# le fichier contient ce qu'il y avait dans le fichier log
$rh_desc->{"status"} = "error";
$rh_desc->{"log"} = &Cat($file);
$rh_desc->{"status"} = "error";
}
elsif ( $fileName eq "success" ) {
# l'analyse s'est terminee par un succes
# le fichier contient ce qu'il y avait dans le fichier log
$rh_desc->{"status"} = "success";
$rh_desc->{"log"} = &Cat($file);
$rh_desc->{"log"} = &Cat($file);
if ( $rh_desc->{"status"} ne "error" ) {
$rh_desc->{"status"} = "success";
}
}
elsif ( $fileName eq "title" ) {
# Le ficheir contient le titre de l'analyse
$rh_desc->{"title"} = &Cat($file);
elsif ( $fileName eq "analysis.json" ) {
my $rh_document = from_json(&Cat($file));
if(defined $rh_document->{"title"})
{
$rh_desc->{"title"} = $rh_document->{"title"};
$rh_desc->{"date"} = $rh_document->{"date"};
}
}
}
}
# il faut que le titre et le status soient specifies
if ( $rh_desc->{"title"} ne "" && $rh_desc->{"status"} ne "" ) {
if ( $rh_desc->{"status"} ne "" && $rh_desc->{"title"} ne "") {
push( @{ $h_param{"analyses"} }, $rh_desc );
}
}
......@@ -205,6 +209,5 @@ sub ListAnalyses {
return;
}
1;
{success: true, email:"l.cottret@gmail.com"}
\ No newline at end of file
{success: true, email:"michel@gmail.com"}
\ No newline at end of file
......@@ -17,7 +17,7 @@ Ext.application({
stores : ['S_Analyses'],
controllers : [ 'C_Login', 'C_Upload', 'C_EnableIprScan',
'C_LaunchAnalysis', 'C_Proteome', 'C_ViewResult', 'C_Reload' ],
'C_LaunchAnalysis', 'C_Proteome', 'C_ViewResult', 'C_Reload', 'C_Reset' ],
launch : function() {
......
File mode changed from 100644 to 100755
......@@ -15,7 +15,7 @@ Ext.define('BP.controller.C_LaunchAnalysis', {
launchAnalysis : function(button) {
var panel = button.up("form");
var form = panel.getForm();
var codes = [];
......@@ -24,9 +24,6 @@ Ext.define('BP.controller.C_LaunchAnalysis', {
form.getFields().each(
function(item) {
console.log("item");
console.log(item);
if (!item.isValid()) {
ERROR_STRING = ERROR_STRING + "The field '"
+ item.fieldLabel + "' is invalid, reasons: "
......@@ -66,6 +63,8 @@ Ext.define('BP.controller.C_LaunchAnalysis', {
json.contact = BP.globals.ConnectionData.mail;
json.title = values.analysis_title;
var d = new Date();
json.date = d.toLocaleString();
json.description = values.analysis_description;
json.orthomcl = {
pmatch_cutoff : values.pMatchCutoff,
......@@ -104,7 +103,7 @@ Ext.define('BP.controller.C_LaunchAnalysis', {
var win_alert = Ext.create("Ext.window.MessageBox");
win_wait.wait("Adding resource...", "Please Wait");
win_wait.wait("Launching analysis...", "Please Wait");
Ext.Ajax.request({
url : '../cgi/index.cgi',
......@@ -126,15 +125,12 @@ Ext.define('BP.controller.C_LaunchAnalysis', {
json = Ext.decode(response.responseText);
console.log("response");
console.log(json);
if(! json["success"]) {
win_alert.alert("Error", "Error during analysis (3)");
win_wait.close();
}
else {
win_alert.alert("Success", json.message);
win_alert.alert("Success", json.message +"<br />Please regularly press the reload button in the panel 'List Of Analyses' to follow the progress of your analyses");
}
......
Ext.define('BP.controller.C_Reset', {
extend : 'Ext.app.Controller',
requires : [ "BP.view.form.V_NewAnalysis" ],
init : function() {
this.control({
'button[action=reset]' : {
click : this.reset
},
});
},
reset: function(button) {
var panel = button.up("form");
var tabPanel = panel.up("tabpanel");
tabPanel.remove(panel, true);
tabPanel.insert(1, {xtype:"newAnalysis"});
tabPanel.setActiveTab(1);
}
});
\ No newline at end of file
......@@ -5,13 +5,7 @@ Ext.define('BP.controller.C_Upload', {
this.control({
'filefield' : {
change : this.uploadFile
},
'button[action=uploadOrthoMclFile]' : {
click : this.uploadFile
},
'button[action=uploadIprScanFile]' : {
click : this.uploadFile
},
}
});
},
......
......@@ -4,7 +4,13 @@ Ext.define('BP.model.M_Analysis', {
fields : [ {
name : 'title',
type : 'string'
}, {
},
{
name : 'date',
type : 'string'
},
{
name : 'log',
type : 'string'
}, {
......
......@@ -6,6 +6,12 @@ Ext.define('BP.store.S_Analyses', {
model : 'BP.model.M_Analysis',
autoLoad : true,
sorters:
{
property: 'date',
direction: 'DESC'
},
proxy : {
type : 'ajax',
......
......@@ -15,6 +15,7 @@ Ext
autoScroll : true,
bodyPadding : 5,
border : false,
title : "New analysis",
fieldDefaults : {
labelAlign : 'left',
......@@ -26,11 +27,21 @@ Ext
items : [
{
xtype : "button",
text : "Launch analysis",
action : "launchAnalysis",
formBind : false
xtype : "container",
layout : "hbox",
items : [ {
xtype : "button",
text : "Launch analysis",
action : "launchAnalysis",
formBind : false
}, {
xtype : "button",
text : "Reset",
action : "reset",
formBind : false
}
]
},
{
xtype : "customFieldSet",
......@@ -80,8 +91,21 @@ Ext
collapsed : false,
items : [
{
xtype : "customFieldSet",
xtype : "uploadFile",
title : "OrthoMcl result file",
flex : 1,
allowBlank : true,
fileLabel : 'Select an OrthoMCL file',
buttonLabel : 'Upload OrthoMcl File',
uploadAction : 'uploadOrthoMclFile',
pathVariable : "pathOrthoMcl"
},
{
xtype : 'splitter'
},
{
xtype : "customFieldSet",
flex : 2,
title : "Parameters",
items : [
{
......@@ -91,6 +115,7 @@ Ext
fieldLabel : 'pv_cutoff',
qtip : "P-Value or E-Value Cutoff in BLAST search and/or ortholog clustering, 1e-5 (DEFAULT).",
value : 0.00001,
decimalPrecision : 10,
allowBlank : false
},
{
......@@ -99,6 +124,8 @@ Ext
name : "piCutoff",
fieldLabel : 'pi_cutoff',
qtip : "Percent Identity Cutoff <0-100> in ortholog clustering, 0 (DEFAULT)",
minValue : 0,
maxValue : 100,
value : 0,
allowBlank : false
},
......@@ -108,6 +135,8 @@ Ext
name : "pMatchCutoff",
fieldLabel : 'pmatch_cutoff',
qtip : "Percent Match Cutoff <0-100> in ortholog clustering, 0 (DEFAULT).",
minValue : 0,
maxValue : 100,
value : 0,
allowBlank : false
......@@ -121,32 +150,27 @@ Ext
qtip : "Markov Inflation Index, used in MCL algorithm, 1.5 (DEFAULT). Increasing this index increases cluster tightness, and the number of clusters.",
allowBlank : false
} ]
},
{
xtype : 'splitter'
},
{
xtype : "uploadFile",
title : "OrthoMcl result file",
flex : 2,
allowBlank : true,
fileLabel : 'Select an OrthoMCL file',
buttonLabel : 'Upload OrthoMcl File',
uploadAction : 'uploadOrthoMclFile',
pathVariable : "pathOrthoMcl"
} ]
},
{
}, {
xtype : "proteomesFieldSet",
titleWidth : 15
},
{
xtype : "button",
text : "Launch analysis",
action : "launchAnalysis",
formBind : false, // only enabled once the
// form is valid
}
}, {
xtype : "container",
layout : "hbox",
items : [ {
xtype : "button",
text : "Launch analysis",
action : "launchAnalysis",
formBind : false
}, {
xtype : "button",
text : "Reset",
action : "reset",
formBind : false
}
]
},
]
......
......@@ -6,7 +6,7 @@ Ext.define('BP.view.form.V_NumberField', {
hideTrigger: true,
keyNavEnabled: false,
mouseWheelEnabled: false,
size:5,
size:10,
listeners : {
render : function(c) {
......
......@@ -73,7 +73,7 @@ Ext.define('BP.view.grid.V_ListAnalyses', {
+ a_path[a_path.length - 1]
return "<a href='" + "../cgi/index.cgi?download=" + path
+ "' target=_blank>link</a>";
+ "' target=_blank>zip</a>";
}
},
flex : 2
......@@ -83,8 +83,14 @@ Ext.define('BP.view.grid.V_ListAnalyses', {
, {
text : "title",
dataIndex : "title",
flex : 8
}, {
flex : 4
},
{
text : "date",
dataIndex : "date",
flex : 4
},
{
text : "log",
dataIndex : "log",
flex : 8
......
......@@ -21,8 +21,6 @@ Ext.define('BP.view.panel.V_MainPanel', {
if (flag) {
this.items.push({
title : 'New Analysis',
closable : false,
xtype : 'newAnalysis'
});
......
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