Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
eae010f2
Commit
eae010f2
authored
Apr 05, 2017
by
Mathieu Giraud
Browse files
js/clone.js, js/model.js: light refactor, .csv export, lists instead of strings
parent
ffbf8812
Changes
2
Hide whitespace changes
Inline
Side-by-side
browser/js/clone.js
View file @
eae010f2
...
...
@@ -1201,21 +1201,31 @@ Clone.prototype = {
},
toCSVheader
:
function
(
m
)
{
var
csv
=
"
name,id,system,tag,v,d,j,sequence
"
for
(
var
i
=
0
;
i
<
m
.
samples
.
order
.
length
;
i
++
)
csv
+=
"
,reads_
"
+
i
for
(
var
i
=
0
;
i
<
m
.
samples
.
order
.
length
;
i
++
)
csv
+=
"
,ratio_
"
+
i
for
(
var
i
=
0
;
i
<
m
.
samples
.
order
.
length
;
i
++
)
csv
+=
"
,ratios_
"
+
i
var
csv
=
[
"
name
"
,
"
id
"
,
"
system
"
,
"
tag
"
,
"
v
"
,
"
d
"
,
"
j
"
,
"
sequence
"
]
for
(
var
i
=
0
;
i
<
m
.
samples
.
order
.
length
;
i
++
)
csv
.
push
(
"
reads_
"
+
i
)
for
(
var
i
=
0
;
i
<
m
.
samples
.
order
.
length
;
i
++
)
csv
.
push
(
"
,ratio_
"
+
i
)
for
(
var
i
=
0
;
i
<
m
.
samples
.
order
.
length
;
i
++
)
csv
.
push
(
"
,ratios_
"
+
i
)
return
csv
},
toCSV
:
function
()
{
var
csv
=
this
.
getName
()
+
"
,
"
+
this
.
id
+
"
,
"
+
this
.
get
(
'
germline
'
)
+
"
,
"
+
this
.
getTagName
()
+
"
,
"
+
this
.
getGene
(
"
5
"
)
+
"
,
"
+
this
.
getGene
(
"
4
"
)
+
"
,
"
+
this
.
getGene
(
"
3
"
)
+
"
,
"
+
this
.
getSequence
()
for
(
var
i
=
0
;
i
<
this
.
m
.
samples
.
order
.
length
;
i
++
)
csv
+=
"
,
"
+
this
.
getReads
(
this
.
m
.
samples
.
order
[
i
])
for
(
var
i
=
0
;
i
<
this
.
m
.
samples
.
order
.
length
;
i
++
)
csv
+=
"
,
"
+
this
.
getSize
(
this
.
m
.
samples
.
order
[
i
])
for
(
var
i
=
0
;
i
<
this
.
m
.
samples
.
order
.
length
;
i
++
)
csv
+=
"
,
"
+
this
.
getPrintableSize
(
this
.
m
.
samples
.
order
[
i
]).
replace
(
/,/g
,
'
;
'
)
var
csv
=
[
this
.
getName
(),
this
.
id
,
this
.
get
(
'
germline
'
),
this
.
getTagName
(),
this
.
getGene
(
"
5
"
),
this
.
getGene
(
"
4
"
),
this
.
getGene
(
"
3
"
),
this
.
getSequence
()
]
for
(
var
i
=
0
;
i
<
this
.
m
.
samples
.
order
.
length
;
i
++
)
csv
.
push
(
this
.
getReads
(
this
.
m
.
samples
.
order
[
i
]))
for
(
var
i
=
0
;
i
<
this
.
m
.
samples
.
order
.
length
;
i
++
)
csv
.
push
(
this
.
getSize
(
this
.
m
.
samples
.
order
[
i
]))
for
(
var
i
=
0
;
i
<
this
.
m
.
samples
.
order
.
length
;
i
++
)
csv
.
push
(
this
.
getPrintableSize
(
this
.
m
.
samples
.
order
[
i
]).
replace
(
/,/g
,
'
;
'
))
return
csv
},
...
...
browser/js/model.js
View file @
eae010f2
...
...
@@ -1915,13 +1915,13 @@ changeCloneNotation: function(cloneNotationType) {
* */
toCSV
:
function
()
{
//header
var
csv
=
Clone
.
prototype
.
toCSVheader
(
this
)
var
csv
=
Clone
.
prototype
.
toCSVheader
(
this
)
.
join
(
'
,
'
)
csv
+=
"
\n
"
//only non-empty active clones and virtual clones
for
(
var
i
=
0
;
i
<
this
.
clusters
.
length
;
i
++
){
if
(
(
this
.
clusters
[
i
].
length
!=
0
&&
this
.
clone
(
i
).
isActive
())
||
this
.
clone
(
i
).
isVirtual
()
){
csv
+=
this
.
clone
(
i
).
toCSV
()
csv
+=
this
.
clone
(
i
).
toCSV
()
.
join
(
'
,
'
)
csv
+=
"
\n
"
}
}
...
...
Write
Preview
Markdown
is supported
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