Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D-GENIES
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
genotoul-bioinfo
d-genies
D-GENIES
Commits
dc87e236
Commit
dc87e236
authored
7 years ago
by
Floreal Cabanettes
Browse files
Options
Downloads
Patches
Plain Diff
Upload fasta files in results folder
parent
47ce7f89
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
application.properties
+0
-1
0 additions, 1 deletion
application.properties
srv/config_reader.py
+0
-6
0 additions, 6 deletions
srv/config_reader.py
srv/main.py
+12
-12
12 additions, 12 deletions
srv/main.py
with
12 additions
and
19 deletions
application.properties
+
0
−
1
View file @
dc87e236
[global]
upload_folder
=
/home/fcabanettes/public_html/tmp
data_folder
=
/home/fcabanettes/public_html/test
# batch system type: local, sge, slurm
batch_system_type
=
local
...
...
This diff is collapsed.
Click to expand it.
srv/config_reader.py
+
0
−
6
View file @
dc87e236
...
...
@@ -15,12 +15,6 @@ class AppConfigReader(object):
self
.
reader
=
RawConfigParser
()
self
.
reader
.
read
(
os
.
path
.
join
(
os
.
path
.
dirname
(
inspect
.
getfile
(
self
.
__class__
)),
self
.
CONFIG_FILE_PATH
))
def
get_upload_folder
(
self
):
try
:
return
self
.
reader
.
get
(
"
global
"
,
"
upload_folder
"
)
except
NoOptionError
:
raise
Exception
(
"
No upload folder found in application.properties (global section)
"
)
def
get_app_data
(
self
):
try
:
return
self
.
reader
.
get
(
"
global
"
,
"
data_folder
"
)
...
...
This diff is collapsed.
Click to expand it.
srv/main.py
+
12
−
12
View file @
dc87e236
...
...
@@ -20,13 +20,10 @@ sqlite_file = os.path.join(app_folder, "database.sqlite")
# Init config reader:
config_reader
=
AppConfigReader
()
UPLOAD_FOLDER
=
config_reader
.
get_upload_folder
()
app_title
=
"
D-GENIES - Dotplot for Genomes Interactive, E-connected and Speedy
"
# Init Flask:
app
=
Flask
(
__name__
,
static_url_path
=
'
/static
'
)
app
.
config
[
'
UPLOAD_FOLDER
'
]
=
UPLOAD_FOLDER
app
.
config
[
'
SECRET_KEY
'
]
=
'
dsqdsq-255sdA-fHfg52-25Asd5
'
# Folder containing data:
...
...
@@ -88,23 +85,26 @@ def launch_analysis():
flash
(
"
Format of target fasta must be in fasta format (*.%s)
"
%
"
, *.
"
.
join
(
ALLOWED_EXTENSIONS
))
form_pass
=
False
if
form_pass
:
# Get final job id:
id_job_orig
=
id_job
while
os
.
path
.
exists
(
os
.
path
.
join
(
app_data
,
id_job
)):
id_job
=
id_job_orig
+
"
_2
"
folder_files
=
os
.
path
.
join
(
app_data
,
id_job
)
os
.
makedirs
(
folder_files
)
# Save files:
query_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
file_query
.
filename
))[
0
]
filename_query
=
get_valid_uploaded_filename
(
secure_filename
(
file_query
.
filename
),
app
.
config
[
"
UPLOAD_FOLDER
"
]
)
filename_query
=
get_valid_uploaded_filename
(
secure_filename
(
file_query
.
filename
),
folder_files
)
target_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
file_target
.
filename
))[
0
]
query_path
=
os
.
path
.
join
(
app
.
config
[
"
UPLOAD_FOLDER
"
]
,
filename_query
)
query_path
=
os
.
path
.
join
(
folder_files
,
filename_query
)
file_query
.
save
(
query_path
)
target_path
=
None
if
file_target
.
filename
!=
""
:
filename_target
=
get_valid_uploaded_filename
(
secure_filename
(
file_target
.
filename
),
app
.
config
[
"
UPLOAD_FOLDER
"
]
)
target_path
=
os
.
path
.
join
(
app
.
config
[
"
UPLOAD_FOLDER
"
]
,
filename_target
)
filename_target
=
get_valid_uploaded_filename
(
secure_filename
(
file_target
.
filename
),
folder_files
)
target_path
=
os
.
path
.
join
(
folder_files
,
filename_target
)
file_target
.
save
(
target_path
)
# Get final job id:
id_job_orig
=
id_job
while
os
.
path
.
exists
(
os
.
path
.
join
(
app_data
,
id_job
)):
id_job
=
id_job_orig
+
"
_2
"
# Launch job:
job
=
JobManager
(
id_job
,
email
,
query_path
,
target_path
,
query_name
,
target_name
)
job
.
launch
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment