Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
1e76012b
Commit
1e76012b
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Normalize by given clade
parent
c81fe6bd
No related branches found
No related tags found
1 merge request
!222
Refseq no sys
Pipeline
#123365
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/RefseqDb.vue
+85
-17
85 additions, 17 deletions
components/content/RefseqDb.vue
with
85 additions
and
17 deletions
components/content/RefseqDb.vue
+
85
−
17
View file @
1e76012b
...
@@ -25,26 +25,29 @@ onBeforeMount(async () => {
...
@@ -25,26 +25,29 @@ onBeforeMount(async () => {
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
facets
:
[
"
*
"
],
filter
:
[],
filter
:
[],
page
:
1
,
limit
:
500000
,
hitsPerPage
:
25
,
sort
:
[
"
type:asc
"
]
}
}
})
})
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
allHitsDb
.
value
=
toValue
(
data
)?.
hits
})
})
const
allHitsDb
=
ref
<
Record
<
string
,
any
>
[]
|
undefined
>
(
undefined
)
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
const
{
data
}
=
await
useAsyncMeiliSearch
({
const
{
data
}
=
await
useAsyncMeiliSearch
({
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
index
:
toValue
(
dbName
),
query
:
""
,
params
:
{
facets
:
[
"
*
"
],
facets
:
[
"
*
"
],
filter
:
[],
filter
:
[],
page
:
1
,
// page: 1,
hitsPerPage
:
25
,
// hitsPerPage: 25,
limit
:
500000
,
sort
:
[
"
type:asc
"
]
}
}
})
})
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
autocompleteMeiliFacetsProps
.
value
.
facetDistribution
=
toValue
(
data
)?.
facetDistribution
allHitsDb
.
value
=
toValue
(
data
)?.
hits
})
})
...
@@ -238,11 +241,12 @@ const computedDistriSystemOptions = computed(() => {
...
@@ -238,11 +241,12 @@ const computedDistriSystemOptions = computed(() => {
// Taxo distri
// Taxo distri
const
computedTaxonomyDistribution
=
computed
(()
=>
{
const
computedTaxonomyDistribution
=
computed
(()
=>
{
const
toValNormalizePerAssembly
=
toValue
(
normalizePerAssembly
)
const
toValSelectedTaxoRank
=
toValue
(
selectedTaxoRank
)
if
(
toValNormalizePerAssembly
?.
length
>
0
)
{
const
toValFacetsPerRank
=
toValue
(
msResult
)?.
facetDistribution
?.[
toValSelectedTaxoRank
]
return
Object
.
entries
(
toValue
(
msResult
).
facetDistribution
[
selectedTaxoRank
.
value
]).
map
(([
key
,
value
])
=>
{
if
(
toValFacetsPerRank
)
{
return
Object
.
entries
(
toValFacetsPerRank
).
map
(([
key
,
value
])
=>
{
return
{
return
{
[
s
electedTaxoRank
.
value
]:
key
,
[
toValS
electedTaxoRank
]:
key
,
count
:
value
count
:
value
}
}
}).
sort
()
}).
sort
()
...
@@ -298,11 +302,27 @@ const binPlotOptions = ref({
...
@@ -298,11 +302,27 @@ const binPlotOptions = ref({
grid
:
true
,
grid
:
true
,
x
:
{
tickRotate
:
90
,
tip
:
true
,
label
:
"
Systems
"
},
x
:
{
tickRotate
:
90
,
tip
:
true
,
label
:
"
Systems
"
},
// y: { tickFormat: 's' },
// y: { tickFormat: 's' },
color
:
{
scheme
:
"
plasma
"
,
legend
:
true
},
color
:
{
scheme
:
"
plasma
"
,
legend
:
true
,
domain
:
[
0
,
100
]
},
})
const
binPlotGroup
=
computed
(()
=>
{
return
Plot
.
group
(
{
fill
:
"
count
"
},
{
x
:
"
type
"
,
y
:
selectedTaxoRank
.
value
,
tip
:
true
,
inset
:
0.5
,
sort
:
{
y
:
"
fill
"
}
})
})
})
const
binPlotDataOptions
=
computed
(()
=>
{
const
binPlotDataOptions
=
computed
(()
=>
{
const
toValueAllHits
=
toValue
(
allHits
)
const
toValueAllHits
=
toValue
(
allHits
)
const
data
=
toValueAllHits
?.
hits
??
[]
return
toValueAllHits
?.
hits
?.
length
>
0
?
{
return
toValueAllHits
?.
hits
?.
length
>
0
?
{
...
binPlotOptions
.
value
,
...
binPlotOptions
.
value
,
width
:
width
.
value
,
width
:
width
.
value
,
...
@@ -312,9 +332,47 @@ const binPlotDataOptions = computed(() => {
...
@@ -312,9 +332,47 @@ const binPlotDataOptions = computed(() => {
type
:
scaleType
.
value
,
type
:
scaleType
.
value
,
tickFormat
:
'
~s
'
,
tickFormat
:
'
~s
'
,
ticks
:
scaleType
.
value
===
'
symlog
'
?
3
:
5
,
ticks
:
scaleType
.
value
===
'
symlog
'
?
3
:
5
,
},
},
marks
:
[
marks
:
[
Plot
.
cell
(
toValueAllHits
?.
hits
??
[],
Plot
.
group
({
fill
:
"
count
"
},
{
x
:
"
type
"
,
y
:
selectedTaxoRank
.
value
,
tip
:
true
,
inset
:
0.5
,
sort
:
{
y
:
"
fill
"
}
})),
Plot
.
cell
(
data
,
Plot
.
group
(
{
fill
:
{
label
:
`Normalize by
${
selectedTaxoRank
.
value
}
clade`
,
reduceIndex
:
function
(
I
,
X
)
{
const
toValAssemblyPerRank
=
toValue
(
assemblyPerRank
)
if
(
toValAssemblyPerRank
?.
size
>
0
)
{
const
clade
=
X
[
I
[
0
]][
selectedTaxoRank
.
value
]
const
system
=
X
[
I
[
0
]].
type
console
.
log
(
I
)
console
.
log
(
X
)
// Get the list of item for this group
const
itemsPerGroup
=
d3
.
rollup
(
I
.
map
(
index
=>
{
return
X
[
index
]
}),
D
=>
D
.
length
,
d
=>
d
.
type
,
d
=>
d
.
Assembly
)
console
.
log
(
itemsPerGroup
)
// console.log(clade)
// console.log(toValAssemblyPerRank.get(clade))
const
countForClade
=
toValAssemblyPerRank
.
get
(
clade
).
size
// console.log(countForClade)
// console.log(I);
// console.log(X);
const
frequency
=
(
itemsPerGroup
.
get
(
system
).
size
/
countForClade
)
*
100
console
.
log
(
frequency
)
return
frequency
}
return
I
.
length
}
}
},
{
x
:
"
type
"
,
y
:
selectedTaxoRank
.
value
,
tip
:
true
,
inset
:
0.5
,
sort
:
{
y
:
"
fill
"
}
}))
]
]
}
:
null
}
:
null
...
@@ -357,11 +415,21 @@ const systemPerAssemblyPerRank = computed(() => {
...
@@ -357,11 +415,21 @@ const systemPerAssemblyPerRank = computed(() => {
}
}
})
})
const
assemblyPerRank
=
computed
(()
=>
{
const
systemPerRankPerAssembly
=
computed
(()
=>
{
const
toValueAllHits
=
toValue
(
allHits
)
const
toValueAllHits
=
toValue
(
allHits
)
console
.
log
(
"
all hits dans system per...
"
)
console
.
log
(
toValueAllHits
)
if
(
toValueAllHits
&&
toValueAllHits
?.
hits
?.
length
>
0
)
{
if
(
toValueAllHits
&&
toValueAllHits
?.
hits
?.
length
>
0
)
{
return
d3
.
rollup
(
toValueAllHits
.
hits
,
D
=>
D
.
length
,
d
=>
d
[
toValue
(
selectedTaxoRank
)],
d
=>
d
.
Assembly
)
return
d3
.
rollup
(
toValueAllHits
.
hits
,
D
=>
D
.
length
,
d
=>
d
[
toValue
(
selectedTaxoRank
)],
d
=>
d
.
type
,
d
=>
d
.
Assembly
)
}
})
const
assemblyPerRank
=
computed
(()
=>
{
const
toValueAllHits
=
toValue
(
allHitsDb
)
if
(
toValueAllHits
&&
toValueAllHits
?.
length
>
0
)
{
return
d3
.
rollup
(
toValueAllHits
,
D
=>
D
.
length
,
d
=>
d
[
toValue
(
selectedTaxoRank
)],
d
=>
d
.
Assembly
)
}
}
})
})
...
@@ -585,8 +653,8 @@ async function downloadPng(component: ComponentPublicInstance | null, filename:
...
@@ -585,8 +653,8 @@ async function downloadPng(component: ComponentPublicInstance | null, filename:
</v-chip>
</v-chip>
</
template
>
</
template
>
<
template
#
[`
item.replicon
`
]=
"{ item }"
>
<
template
#
[`
item.replicon
`
]=
"{ item }"
>
<v-chip
color=
"info"
link
size=
"small"
<v-chip
color=
"info"
link
size=
"small"
:href=
"`https://www.ncbi.nlm.nih.gov/nuccore/$
{item.replicon}`"
:href=
"`https://www.ncbi.nlm.nih.gov/nuccore/$
{item.replicon}`"
target="_blank">
{{
target="_blank">
{{
item
.
replicon
}}
item
.
replicon
}}
</v-chip>
</v-chip>
</
template
>
</
template
>
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment