Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
D-GENIES
Commits
5c7c754f
Commit
5c7c754f
authored
Jan 05, 2018
by
Floreal Cabanettes
Browse files
Add export no match targets to query
parent
d843bcb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
js/dgenies.result.export.js
View file @
5c7c754f
...
...
@@ -126,16 +126,17 @@ dgenies.result.export.export_association_table = function () {
document
.
getElementById
(
'
my-download
'
).
click
();
};
dgenies
.
result
.
export
.
export_no_association_file
=
function
()
{
dgenies
.
result
.
export
.
export_no_association_file
=
function
(
to
)
{
let
on
=
to
===
"
query
"
?
"
target
"
:
"
query
"
;
dgenies
.
post
(
"
/no-assoc/
"
+
dgenies
.
result
.
id_res
,
{},
{
"
to
"
:
to
},
function
(
data
,
success
)
{
if
(
!
data
[
"
empty
"
])
{
let
blob
=
new
Blob
([
data
[
"
file_content
"
]],
{
type
:
"
text/plain
"
});
saveAs
(
blob
,
`nomatches_
${
d3
.
boxplot
.
name_y
}
_to_
${
d3
.
boxplot
.
name_x
}
.txt`
);
saveAs
(
blob
,
`no
_
${
to
}
_
matches_
${
d3
.
boxplot
.
name_y
}
_to_
${
d3
.
boxplot
.
name_x
}
.txt`
);
}
else
{
dgenies
.
notify
(
"
No contigs in
query
have None match with any
target!
"
,
"
success
"
)
dgenies
.
notify
(
`
No contigs in
${
to
}
have None match with any
${
on
}
!`
,
"
success
"
)
}
})
};
...
...
@@ -160,7 +161,10 @@ dgenies.result.export.export = function () {
dgenies
.
result
.
export
.
export_association_table
();
}
else
if
(
selection
===
6
)
{
dgenies
.
result
.
export
.
export_no_association_file
();
dgenies
.
result
.
export
.
export_no_association_file
(
"
query
"
);
}
else
if
(
selection
===
7
)
{
dgenies
.
result
.
export
.
export_no_association_file
(
"
target
"
);
}
else
dgenies
.
notify
(
"
Not supported yet!
"
,
"
danger
"
,
2000
);
...
...
lib/paf.py
View file @
5c7c754f
...
...
@@ -488,15 +488,17 @@ class Paf:
content
+=
"%s
\t
%s
\t
%s
\n
"
%
(
contig
,
"None"
,
strand
)
return
content
def
build_list_no_assoc
(
self
):
def
build_list_no_assoc
(
self
,
to
):
"""
Build list of queries that match with None target
Build list of queries that match with None target, or the opposite
:param to: query or target
:return: content of the file
"""
name
,
contigs_list
,
contigs
,
reversed
,
abs_start
,
abs_current_start
,
c_len
=
self
.
load_index
(
self
.
idx_q
)
index
=
self
.
idx_q
if
to
==
"query"
else
self
.
idx_t
name
,
contigs_list
,
contigs
,
reversed
,
abs_start
,
abs_current_start
,
c_len
=
self
.
load_index
(
self
.
idx_t
)
with
open
(
self
.
paf
,
"r"
)
as
paf
:
for
line
in
paf
:
query
_name
=
line
.
strip
(
"
\n
"
).
split
(
"
\t
"
)[
0
]
if
query
_name
in
contigs_list
:
contigs_list
.
remove
(
query
_name
)
c
_name
=
line
.
strip
(
"
\n
"
).
split
(
"
\t
"
)[
0
if
to
==
"query"
else
5
]
if
c
_name
in
contigs_list
:
contigs_list
.
remove
(
c
_name
)
return
"
\n
"
.
join
(
contigs_list
)
+
"
\n
"
srv/main.py
View file @
5c7c754f
...
...
@@ -405,7 +405,7 @@ def no_assoc(id_res):
print
(
"Unable to load data!"
)
abort
(
404
)
return
False
file_content
=
paf
.
build_list_no_assoc
()
file_content
=
paf
.
build_list_no_assoc
(
request
.
form
[
"to"
]
)
empty
=
file_content
==
"
\n
"
return
jsonify
({
"file_content"
:
file_content
,
...
...
srv/templates/results.html
View file @
5c7c754f
...
...
@@ -43,6 +43,7 @@
<option
value=
"4"
>
Query Fasta
</option>
<option
value=
"5"
>
Association table
</option>
<option
value=
"6"
>
No match queries
</option>
<option
value=
"7"
>
No match targets
</option>
</select>
</form>
</div>
...
...
Floreal Cabanettes
@floreal.cabanettes
mentioned in issue
#18 (closed)
·
Jan 05, 2018
mentioned in issue
#18 (closed)
mentioned in issue #18
Toggle commit list
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment