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
Container Registry
Model registry
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
Statistical-Genetics
jass
Commits
d1f63557
Commit
d1f63557
authored
1 year ago
by
Simon Malesys
Browse files
Options
Downloads
Patches
Plain Diff
Use the table filenames instead of the metadata name field
parent
96079957
No related branches found
No related tags found
1 merge request
!88
Update frontend
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/pages/gwas.vue
+9
-9
9 additions, 9 deletions
client/pages/gwas.vue
client/store/index.js
+16
-8
16 additions, 8 deletions
client/store/index.js
with
25 additions
and
17 deletions
client/pages/gwas.vue
+
9
−
9
View file @
d1f63557
...
...
@@ -11,25 +11,25 @@
<h2>
Select an ancestry:
</h2>
<div
class=
"init-table-card-list"
>
<v-card
v-for=
"table in initTables"
:key=
"
table.n
ame"
v-for=
"
(
table
Meta, fileName)
in initTables"
:key=
"
fileN
ame"
class=
"init-table-card"
:class=
"
{ 'selected-table': selectedInitTable ===
table.n
ame }"
:color="selectedInitTable ===
table.n
ame ? 'blue lighten-4' : ''">
<v-card-title>
{{
table
.
name
}}
</v-card-title>
<v-card-text>
{{
table
.
desc
}}
</v-card-text>
:class=
"
{ 'selected-table': selectedInitTable ===
fileN
ame }"
:color="selectedInitTable ===
fileN
ame ? 'blue lighten-4' : ''">
<v-card-title>
{{
table
Meta
.
name
}}
</v-card-title>
<v-card-text>
{{
table
Meta
.
desc
}}
</v-card-text>
<v-card-text>
<div>
<strong>
{{
table
.
nb_snps
.
toLocaleString
()
}}
</strong>
<strong>
{{
table
Meta
.
nb_snps
.
toLocaleString
()
}}
</strong>
SNPS
</div>
<div>
<strong>
{{
table
.
nb_phenotypes
.
toLocaleString
()
}}
</strong>
<strong>
{{
table
Meta
.
nb_phenotypes
.
toLocaleString
()
}}
</strong>
phenotypes
</div>
</v-card-text>
<v-card-actions
class=
"card-buttons"
>
<v-btn
class=
"button"
color=
"primary"
@
click=
"selectAncestry(
table.n
ame)"
>
<v-btn
class=
"button"
color=
"primary"
@
click=
"selectAncestry(
fileN
ame)"
>
Select this ancestry
</v-btn>
</v-card-actions>
...
...
This diff is collapsed.
Click to expand it.
client/store/index.js
+
16
−
8
View file @
d1f63557
...
...
@@ -3,15 +3,15 @@
// https://v2.nuxt.com/docs/directory-structure/store
export
const
state
=
()
=>
({
initTables
:
[]
initTables
:
{}
})
export
const
getters
=
{
getTotalTables
(
state
)
{
return
state
.
initTables
.
length
return
Object
.
keys
(
state
.
initTables
)
.
length
},
getTotalPhenotypes
(
state
)
{
return
state
.
initTables
.
reduce
((
total
,
table
)
=>
{
return
Object
.
values
(
state
.
initTables
)
.
reduce
((
total
,
table
)
=>
{
if
(
typeof
(
table
.
nb_phenotypes
)
===
'
number
'
)
{
return
total
+
table
.
nb_phenotypes
}
else
{
...
...
@@ -20,7 +20,7 @@ export const getters = {
},
0
)
},
getTotalSNP
(
state
)
{
return
state
.
initTables
.
reduce
((
total
,
table
)
=>
{
return
Object
.
values
(
state
.
initTables
)
.
reduce
((
total
,
table
)
=>
{
if
(
typeof
(
table
.
nb_snps
)
===
'
number
'
)
{
return
total
+
table
.
nb_snps
}
else
{
...
...
@@ -38,15 +38,23 @@ export const mutations = {
export
const
actions
=
{
async
fetchTables
({
commit
})
{
const
initTables
=
{}
return
await
this
.
$axios
.
$get
(
'
/tables
'
)
.
then
((
initTables
)
=>
{
const
initMetaRequests
=
initTables
.
map
(
initTableName
=>
{
return
this
.
$axios
.
$post
(
'
/initmeta
'
,
{
initTableName
})
.
then
((
initTablesList
)
=>
{
const
initMetaRequests
=
initTablesList
.
map
(
initTableName
=>
{
return
this
.
$axios
.
$post
(
'
/initmeta
'
,
{
initTableName
})
.
then
(
initMeta
=>
{
initTables
[
initTableName
]
=
initMeta
})
})
return
Promise
.
all
(
initMetaRequests
)
})
.
then
(
initTables
=>
{
.
then
(()
=>
{
// Store the initTables all at once to avoid partial fetching
// if one of the previous requests fail.
commit
(
'
setInitTables
'
,
initTables
)
})
}
...
...
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