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
vidjil
vidjil
Commits
1cf43f19
Commit
1cf43f19
authored
Sep 12, 2018
by
Ryan Herbert
Browse files
sample_set.py stats_decorator.py add loci list
See
#3456
parent
df9a97dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/controllers/sample_set.py
View file @
1cf43f19
...
...
@@ -659,6 +659,7 @@ def getStatHeaders():
b
=
BooleanDecorator
()
p
=
BarDecorator
()
bc
=
BarChartDecorator
()
l
=
LociListDecorator
()
return
[(
'sample_sets'
,
'db'
,
s
),
(
'main_clone'
,
'parser'
,
m
),
(
'reads'
,
'parser'
,
m
),
...
...
@@ -666,6 +667,7 @@ def getStatHeaders():
(
'mapped_percent'
,
'parser'
,
p
),
(
'bool'
,
'parser'
,
b
),
(
'bool_true'
,
'parser'
,
b
),
(
'loci'
,
'parser'
,
l
),
(
'genescan'
,
'parser'
,
bc
)
]
...
...
@@ -698,6 +700,7 @@ def getFusedStats(file_name, res, dest):
dest
[
'mapped_percent'
]
=
100.0
*
(
float
(
data
[
'reads'
][
'segmented'
][
result_index
])
/
float
(
reads
))
dest
[
'bool'
]
=
False
dest
[
'bool_true'
]
=
True
dest
[
'loci'
]
=
[
x
for
x
in
data
[
'reads'
][
'germline'
]
if
data
[
'reads'
][
'germline'
][
x
][
result_index
]
>=
0
]
dest
[
'genescan'
]
=
[
68
,
27
,
18
,
45
,
89
,
63
,
53
,
64
,
93
,
21
,
47
,
5
,
64
,
68
,
46
,
68
,
18
,
72
,
36
,
70
,
39
,
21
,
84
,
32
,
29
,
4
,
76
,
51
,
33
,
67
,
14
,
57
,
75
,
61
,
29
,
11
,
81
,
71
,
91
,
32
,
40
,
71
,
87
,
54
,
50
,
88
,
72
,
59
,
29
,
80
,
48
,
...
...
server/web2py/applications/vidjil/models/stats_decorator.py
View file @
1cf43f19
...
...
@@ -51,3 +51,15 @@ class SetsDecorator(StatDecorator):
d
=
DIV
(
"(%d) %s"
%
(
sample_set
[
'id'
],
sample_set
[
'name'
]))
ssets
.
append
(
d
)
return
DIV
(
*
ssets
)
class
LociListDecorator
(
StatDecorator
):
def
__init__
(
self
):
super
(
LociListDecorator
,
self
).
__init__
()
def
decorate
(
self
,
data
):
loci
=
[]
for
locus
in
data
:
span
=
SPAN
(
locus
)
loci
.
append
(
span
)
return
DIV
(
*
loci
)
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