Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jass
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léo HENCHES
jass
Commits
22a2e996
Commit
22a2e996
authored
1 year ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
transmit initTable name when creating project
parent
fc14511d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
client/pages/phenotypes.vue
+6
-1
6 additions, 1 deletion
client/pages/phenotypes.vue
jass/models/phenotype.py
+1
-1
1 addition, 1 deletion
jass/models/phenotype.py
jass/server.py
+1
-1
1 addition, 1 deletion
jass/server.py
jass/tasks.py
+6
-6
6 additions, 6 deletions
jass/tasks.py
with
14 additions
and
9 deletions
client/pages/phenotypes.vue
+
6
−
1
View file @
22a2e996
...
@@ -87,7 +87,12 @@ export default {
...
@@ -87,7 +87,12 @@ export default {
},
},
runAnalysis
(){
runAnalysis
(){
const
{
selectedRows
,
$axios
}
=
this
;
const
{
selectedRows
,
$axios
}
=
this
;
const
phenotypeIds
=
{
phenotypeID
:
selectedRows
.
map
(
function
(
phenotype
){
return
phenotype
.
id
})};
const
phenotypeIds
=
{
phenotypeID
:
selectedRows
.
map
(
function
(
phenotype
){
return
phenotype
.
id
}),
initTableName
:
"
initTable.hdf5
"
// phenotypeID: ["z_MAGIC_FAST-GLUCOSE", "z_MAGIC_FAST-INSULIN"],
// initTableName: "initTableTest.hdf5"
};
console
.
log
(
"
REQUEST POST
"
)
console
.
log
(
"
REQUEST POST
"
)
console
.
log
(
phenotypeIds
)
console
.
log
(
phenotypeIds
)
...
...
This diff is collapsed.
Click to expand it.
jass/models/phenotype.py
+
1
−
1
View file @
22a2e996
...
@@ -85,5 +85,5 @@ class ProjectNameModel(BaseModel):
...
@@ -85,5 +85,5 @@ class ProjectNameModel(BaseModel):
raise
ValueError
(
f
"
Prohibited char, only
\"
{
_initTableNamePattern
.
pattern
}
\"
allowed.
"
)
raise
ValueError
(
f
"
Prohibited char, only
\"
{
_initTableNamePattern
.
pattern
}
\"
allowed.
"
)
return
value
return
value
class
PhenotypeIdList
(
BaseModel
):
class
PhenotypeIdList
(
ProjectNameModel
,
BaseModel
):
phenotypeID
:
List
[
str
]
=
[]
phenotypeID
:
List
[
str
]
=
[]
This diff is collapsed.
Click to expand it.
jass/server.py
+
1
−
1
View file @
22a2e996
...
@@ -70,7 +70,7 @@ def inittable_meta():
...
@@ -70,7 +70,7 @@ def inittable_meta():
def
project_create
(
phenotype_id_list
:
PhenotypeIdList
):
def
project_create
(
phenotype_id_list
:
PhenotypeIdList
):
return
create_project
(
return
create_project
(
phenotype_id_list
.
phenotypeID
,
phenotype_id_list
.
phenotypeID
,
get_available_phenotypes
(
os
.
path
.
join
(
config
[
"
DATA_DIR
"
],
"
initTable
.hdf5
"
))
,
init_table_name
=
phenotype_id_list
.
initTable
Name
,
)
)
...
...
This diff is collapsed.
Click to expand it.
jass/tasks.py
+
6
−
6
View file @
22a2e996
...
@@ -10,7 +10,7 @@ from flask import Flask
...
@@ -10,7 +10,7 @@ from flask import Flask
import
jass.models.project
import
jass.models.project
from
jass.models.project
import
GlobalProject
,
Project
,
ensure_space_in_project_dir
from
jass.models.project
import
GlobalProject
,
Project
,
ensure_space_in_project_dir
from
jass.models.phenotype
import
Phenotype
from
jass.models.phenotype
import
Phenotype
,
get_available_phenotypes
from
jass.config
import
config
from
jass.config
import
config
...
@@ -155,22 +155,22 @@ def run_project_analysis_if_needed(project):
...
@@ -155,22 +155,22 @@ def run_project_analysis_if_needed(project):
def
create_project
(
def
create_project
(
phenotype_ids
:
List
[
str
],
phenotype_ids
:
List
[
str
],
available_phenotypes
:
List
[
Phenotype
],
chromosome
:
str
=
None
,
chromosome
:
str
=
None
,
start
:
str
=
None
,
start
:
str
=
None
,
end
:
str
=
None
,
end
:
str
=
None
,
init_table_name
:
str
=
None
,
):
):
init_table_path
=
os
.
path
.
join
(
config
[
"
DATA_DIR
"
],
init_table_name
)
available_phenotype
_ids
=
[
phenotype
.
id
for
phenotype
in
available_phenotypes
]
available_phenotype
s
=
get_
available_phenotypes
(
init_table_path
)
unavailable_requested_ids
=
set
(
phenotype_ids
).
difference
(
unavailable_requested_ids
=
set
(
phenotype_ids
).
difference
(
set
(
available_phenotype
_id
s
)
set
(
phenotype
.
id
for
phenotype
in
available_phenotypes
)
)
)
if
len
(
unavailable_requested_ids
)
>
0
:
if
len
(
unavailable_requested_ids
)
>
0
:
raise
HTTPException
(
status_code
=
404
,
detail
=
f
"
Phenotype IDs not found:
{
'
,
'
.
join
(
unavailable_requested_ids
)
}
"
)
raise
HTTPException
(
status_code
=
404
,
detail
=
f
"
Phenotype IDs not found:
{
'
,
'
.
join
(
unavailable_requested_ids
)
}
"
)
phenotypes
=
[
phenotypes
=
[
phenotype
for
phenotype
in
available_phenotypes
if
phenotype
.
id
in
phenotype_ids
phenotype
for
phenotype
in
available_phenotypes
if
phenotype
.
id
in
phenotype_ids
]
]
project
=
GlobalProject
(
phenotypes
=
phenotypes
)
project
=
GlobalProject
(
phenotypes
=
phenotypes
,
init_table_path
=
init_table_path
)
project
.
create
(
fail_if_exists
=
False
)
project
.
create
(
fail_if_exists
=
False
)
ensure_space_in_project_dir
(
except_project_id
=
project
.
id
)
ensure_space_in_project_dir
(
except_project_id
=
project
.
id
)
...
...
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