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
Yoann DUFRESNE
linked reads molecule ordering
Commits
aa092fa2
Commit
aa092fa2
authored
May 16, 2020
by
Yoann Dufresne
Browse files
path simple
parent
93af6c95
Changes
1
Hide whitespace changes
Inline
Side-by-side
deconvolution/main/d2_to_path_simple.py
View file @
aa092fa2
...
...
@@ -5,6 +5,7 @@ import argparse
import
sys
from
deconvolution.d2graph
import
d2_graph
as
d2
,
path_optimization
as
po
from
deconvolution.d2graph.d2_path
import
Path
def
parse_arguments
():
...
...
@@ -50,22 +51,17 @@ def main():
spl2
=
nx
.
shortest_path_length
(
largest_component
,
one_extremity
)
other_extremity
=
max
(
spl2
.
items
(),
key
=
lambda
x
:
x
[
1
])[
0
]
path
=
nx
.
shortest_path
(
largest_component
,
one_extremity
,
other_extremity
)
node_path
=
nx
.
shortest_path
(
largest_component
,
one_extremity
,
other_extremity
)
nodes
=
[
largest_component
.
node_by_idx
[
int
(
x
)]
for
x
in
node_path
]
path
=
Path
(
d2g
)
path
.
add_path
(
nodes
)
solution
=
po
.
Solution
(
largest_component
)
nodes
=
[
largest_component
.
node_by_idx
[
int
(
x
)]
for
x
in
path
]
solution
.
add_path
(
nodes
)
print
(
f
"covering score:
{
solution
.
covering_score
()
}
"
)
print
(
f
"covering score:
{
path
.
covering_score
()
}
"
)
# solution.save_path_in_graph(f"{args.out_prefix}_d2_path.gexf")
solution
.
save_path
(
f
"
{
args
.
out_prefix
}
_path.gexf"
)
solution
.
save_barcode_path
(
f
"
{
args
.
out_prefix
}
_barcode_count.gexf"
)
path
.
save_gexf
(
f
"
{
args
.
out_prefix
}
_path.gexf"
)
print
(
"Solution saved"
)
# from d2_path import d2_path_to_barcode_path
# d2_path_to_barcode_path(solution)
if
__name__
==
"__main__"
:
main
()
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