Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CD-CODE Web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
CD-CODE team
CD-CODE Web
Commits
9e67786a
Commit
9e67786a
authored
3 years ago
by
HongKee Moon
Browse files
Options
Downloads
Patches
Plain Diff
Close
#8
Evidence Stars on Protein Table in Condensate Detail Page
parent
add0fe1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/src/components/LlpsTable.vue
+33
-15
33 additions, 15 deletions
web/src/components/LlpsTable.vue
with
33 additions
and
15 deletions
web/src/components/LlpsTable.vue
+
33
−
15
View file @
9e67786a
...
...
@@ -14,17 +14,31 @@
let
table
;
function
getRatingValue
(
data
)
{
const
scoreMap
=
{
'
hungarian
'
:
5
,
'
blue
'
:
5
,
'
pink
'
:
1
,
'
grey
'
:
1
}
const
scoreMap
=
{
'
http://llps.biocuckoo.cn/
'
:
1
,
'
http://db.phasep.pro/browse/highthroughput/
'
:
2
,
'
http://db.phasep.pro/browse/reviewed/
'
:
4
,
'
http://db.phasep.pro/browse/uniprotreviewed/
'
:
4
,
'
http://bio-comp.ucas.ac.cn/
'
:
4
,
'
https://phasepro.elte.hu/
'
:
4
,
'
https://pubmed.ncbi.nlm.nih.gov/
'
:
4
}
function
getStartWith
(
url
)
{
let
ret
=
''
_
.
forEach
(
_
.
keys
(
scoreMap
),
i
=>
{
if
(
url
.
startsWith
(
i
))
{
ret
=
i
;
}
})
return
ret
}
function
getRatingValue
(
data
)
{
return
_
.
max
(
_
.
map
(
data
,
i
=>
scoreMap
[
i
]));
}
function
getRating
(
data
)
{
const
scoreMap
=
{
'
hungarian
'
:
5
,
'
blue
'
:
5
,
'
pink
'
:
1
,
'
grey
'
:
1
}
const
rating
=
_
.
max
(
_
.
map
(
data
,
i
=>
scoreMap
[
i
]));
// console.log(rating);
const
rating
=
_
.
max
(
_
.
map
(
data
,
i
=>
scoreMap
[
getStartWith
(
i
)]));
const
r
=
[
'
<div style="white-space: nowrap;">
'
]
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
if
(
i
<
rating
)
{
...
...
@@ -60,6 +74,11 @@
// console.log(url)
window
.
open
(
url
)
},
createLink
(
link
)
{
return
`<a href="" class="uniprot-link tooltipped tooltipped-n tooltipped-multiline"
aria-label="Clicking this link opens Evidence page.">
${
link
}
</a>`
},
createTable
(
id
,
data
)
{
const
vm
=
this
;
...
...
@@ -173,7 +192,7 @@
let
data
=
vm
.
map
[
oData
.
uniprot_id
];
if
(
data
)
{
// $(nTd).html(data.filter(a => a.startsWith('http')).join('\n'));
$
(
nTd
).
html
(
data
.
join
(
'
\n
'
));
$
(
nTd
).
html
(
data
.
map
(
i
=>
vm
.
createLink
(
i
)).
join
(
'
<br/>
'
));
}
}
},
...
...
@@ -207,15 +226,14 @@
title: 'Evidence Stars',
className: "text-nowrap",
data: 'uniprot_id',
render: function ( data, type, row, meta ) {
// console.log(_.flatMap(row.condensates, c => c.data_sources))
if(row.condensates) {
return getRatingValue(vm.map[row.uniprot_id]);
}
return '';
},
//
render: function ( data, type, row, meta ) {
//
// console.log(_.flatMap(row.condensates, c => c.data_sources))
//
if(row.condensates) {
//
return getRatingValue(vm.map[row.uniprot_id]);
//
}
//
return '';
//
},
fnCreatedCell: (nTd, sData, oData) => {
// console.log(sData)
let data = vm.map[oData.uniprot_id];
if(data) {
$(nTd).html(getRating(data).join('\n'));
...
...
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