Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Durairaj, Janani
caretta
Commits
b88ce14b
Commit
b88ce14b
authored
Jan 31, 2020
by
Akdel
Browse files
demo site eta
parent
ac4f0b5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/caretta-app-demo3
View file @
b88ce14b
...
...
@@ -244,6 +244,8 @@ app.layout = html.Div(children=[html.Div(html.Div([html.H1("Caretta",
type
=
"default"
),
html
.
P
(
id
=
"time-estimate"
,
style
=
{
"text-align"
:
"center"
},
children
=
""
,
className
=
"row"
),
html
.
P
(
id
=
"is-it-done"
,
style
=
{
"text-align"
:
"center"
},
children
=
""
,
className
=
"row"
),
html
.
Div
(
id
=
"alignment-done"
,
style
=
{
"display"
:
"none"
},
children
=
[
False
]),
],
...
...
@@ -366,6 +368,7 @@ def show_selected_atoms(clicked, pfam_class, pfam_id):
return
[{
"label"
:
"no selection"
,
"value"
:
"None"
}]
def
get_estimated_time
(
pdb_entries
):
n
=
len
(
pdb_entries
)
l
=
max
(
p
.
PdbResNumEnd
-
p
.
PdbResNumStart
for
p
in
pdb_entries
)
...
...
@@ -373,17 +376,24 @@ def get_estimated_time(pdb_entries):
return
func
((
l
,
n
),
9.14726052e-06
)
/
60
@
app
.
callback
(
dash
.
dependencies
.
Output
(
"time-estimate"
,
"children"
),
[
dash
.
dependencies
.
In
put
(
"align
"
,
"n_clicks
"
),
dash
.
dependencies
.
Input
(
"align
ment-done"
,
"children
"
)],
@
app
.
callback
(
[
dash
.
dependencies
.
Output
(
"time-estimate"
,
"children"
),
dash
.
dependencies
.
Out
put
(
"align
ment-done"
,
"children
"
)
]
,
[
dash
.
dependencies
.
Input
(
"align
"
,
"n_clicks
"
)],
[
dash
.
dependencies
.
State
(
"structure-selection"
,
"value"
)])
def
get_time_estimate
(
clicked
,
aln_done
,
pdb_entries
):
def
get_time_estimate
(
clicked
,
pdb_entries
):
if
clicked
and
pdb_entries
:
pdb_entries
=
[
decompress_object
(
x
)
for
x
in
pdb_entries
]
time
=
get_estimated_time
(
pdb_entries
)
return
f
"ETA:
{
np
.
round
(
time
,
2
)
}
min"
if
aln_done
[
0
]:
return
""
return
f
"ETA:
{
np
.
round
(
time
,
2
)
}
min"
,
[
False
]
else
:
return
""
,
[
False
]
@
app
.
callback
(
dash
.
dependencies
.
Output
(
"is-it-done"
,
"children"
),
[
dash
.
dependencies
.
Input
(
"alignment-done"
,
"children"
)])
def
is_it_done
(
done
):
if
done
[
0
]:
return
"Alignment done!"
else
:
return
""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment