Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
genotoul-bioinfo
D-GENIES
Commits
c6d4f0ac
Commit
c6d4f0ac
authored
Feb 21, 2018
by
Floreal Cabanettes
Browse files
Don't ask for compression on standalone mode + fix bug on windows
parent
b946b9f3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
src/dgenies/lib/functions.py
View file @
c6d4f0ac
...
...
@@ -161,7 +161,7 @@ class Functions:
@
staticmethod
def
sort_fasta
(
job_name
,
fasta_file
,
index_file
,
lock_file
,
compress
=
False
,
mailer
=
None
):
def
sort_fasta
(
job_name
,
fasta_file
,
index_file
,
lock_file
,
compress
=
False
,
mailer
=
None
,
mode
=
"webserver"
):
index
,
sample_name
=
Functions
.
read_index
(
index_file
)
is_compressed
=
fasta_file
.
endswith
(
".gz"
)
if
is_compressed
:
...
...
@@ -185,7 +185,7 @@ class Functions:
if
compress
:
Functions
.
compress
(
fasta_file_o
)
os
.
remove
(
lock_file
)
if
mailer
is
not
None
and
not
os
.
path
.
exists
(
lock_file
+
".pending"
):
if
mode
==
"webserver"
and
mailer
is
not
None
and
not
os
.
path
.
exists
(
lock_file
+
".pending"
):
Functions
.
send_fasta_ready
(
mailer
,
job_name
,
sample_name
,
compress
)
@
staticmethod
...
...
src/dgenies/static/js/dgenies.result.export.js
View file @
c6d4f0ac
...
...
@@ -86,36 +86,41 @@ dgenies.result.export.export_fasta = function(compress=false) {
};
dgenies
.
result
.
export
.
ask_export_fasta
=
function
()
{
let
dialog
=
$
(
"
<div>
"
)
.
attr
(
"
id
"
,
"
dialog-confirm
"
)
.
attr
(
"
title
"
,
"
Gzip?
"
);
let
icon
=
$
(
"
<span>
"
)
.
attr
(
"
class
"
,
"
ui-icon ui-icon-help
"
)
.
css
(
"
float
"
,
"
left
"
)
.
css
(
"
margin
"
,
"
12px 12px 20px 0
"
);
let
body
=
$
(
"
<p>
"
);
body
.
append
(
icon
);
body
.
append
(
"
Compression is recommanded on slow connections. Download Gzip file?
"
);
dialog
.
append
(
body
);
dialog
.
dialog
({
resizable
:
false
,
height
:
"
auto
"
,
width
:
500
,
modal
:
true
,
buttons
:
{
"
Use default
"
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
dgenies
.
result
.
export
.
export_fasta
(
false
);
},
"
Use Gzip
"
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
dgenies
.
result
.
export
.
export_fasta
(
true
);
},
Cancel
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
if
(
dgenies
.
mode
===
"
webserver
"
)
{
let
dialog
=
$
(
"
<div>
"
)
.
attr
(
"
id
"
,
"
dialog-confirm
"
)
.
attr
(
"
title
"
,
"
Gzip?
"
);
let
icon
=
$
(
"
<span>
"
)
.
attr
(
"
class
"
,
"
ui-icon ui-icon-help
"
)
.
css
(
"
float
"
,
"
left
"
)
.
css
(
"
margin
"
,
"
12px 12px 20px 0
"
);
let
body
=
$
(
"
<p>
"
);
body
.
append
(
icon
);
body
.
append
(
"
Compression is recommanded on slow connections. Download Gzip file?
"
);
dialog
.
append
(
body
);
dialog
.
dialog
({
resizable
:
false
,
height
:
"
auto
"
,
width
:
500
,
modal
:
true
,
buttons
:
{
"
Use default
"
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
dgenies
.
result
.
export
.
export_fasta
(
false
);
},
"
Use Gzip
"
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
dgenies
.
result
.
export
.
export_fasta
(
true
);
},
Cancel
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
}
}
}
});
});
}
else
{
dgenies
.
result
.
export
.
export_fasta
(
false
);
}
};
dgenies
.
result
.
export
.
export_association_table
=
function
()
{
...
...
src/dgenies/static/js/dgenies.result.min.js
View file @
c6d4f0ac
This diff is collapsed.
Click to expand it.
src/dgenies/views.py
View file @
c6d4f0ac
...
...
@@ -391,21 +391,33 @@ def build_fasta(id_res):
Path
(
lock_query
).
touch
()
if
not
compressed
or
MODE
==
"standalone"
:
# If compressed, it will took a long time, so not wait
Path
(
lock_query
+
".pending"
).
touch
()
thread
=
threading
.
Timer
(
1
,
Functions
.
sort_fasta
,
kwargs
=
{
"job_name"
:
id_res
,
"fasta_file"
:
query_fasta
,
"index_file"
:
os
.
path
.
join
(
res_dir
,
"query.idx.sorted"
),
"lock_file"
:
lock_query
,
"compress"
:
compressed
,
"mailer"
:
mailer
})
thread
.
start
()
index_file
=
os
.
path
.
join
(
res_dir
,
"query.idx.sorted"
)
if
MODE
==
"webserver"
:
thread
=
threading
.
Timer
(
1
,
Functions
.
sort_fasta
,
kwargs
=
{
"job_name"
:
id_res
,
"fasta_file"
:
query_fasta
,
"index_file"
:
index_file
,
"lock_file"
:
lock_query
,
"compress"
:
compressed
,
"mailer"
:
mailer
,
"mode"
:
MODE
})
thread
.
start
()
else
:
Functions
.
sort_fasta
(
job_name
=
id_res
,
fasta_file
=
query_fasta
,
index_file
=
index_file
,
lock_file
=
lock_query
,
compress
=
compressed
,
mailer
=
None
,
mode
=
MODE
)
if
not
compressed
or
MODE
==
"standalone"
:
i
=
0
time
.
sleep
(
5
)
while
os
.
path
.
exists
(
lock_query
)
and
(
i
<
2
or
MODE
==
"standalone"
):
i
+=
1
if
MODE
==
"webserver"
:
i
=
0
time
.
sleep
(
5
)
while
os
.
path
.
exists
(
lock_query
)
and
(
i
<
2
or
MODE
==
"standalone"
):
i
+=
1
time
.
sleep
(
5
)
os
.
remove
(
lock_query
+
".pending"
)
if
os
.
path
.
exists
(
lock_query
):
return
jsonify
({
"success"
:
True
,
"status"
:
1
,
"status_message"
:
"In progress"
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment