Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linked reads molecule ordering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann DUFRESNE
linked reads molecule ordering
Commits
aba36815
Commit
aba36815
authored
5 years ago
by
Yoann Dufresne
Browse files
Options
Downloads
Patches
Plain Diff
simplify d2 snakemake interface and remove parasit prints
parent
aedced90
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+8
-0
8 additions, 0 deletions
README.md
Snakefile_d2
+4
-3
4 additions, 3 deletions
Snakefile_d2
deconvolution/d_graph.py
+5
-5
5 additions, 5 deletions
deconvolution/d_graph.py
with
17 additions
and
8 deletions
README.md
+
8
−
0
View file @
aba36815
...
...
@@ -42,3 +42,11 @@ Config parameters:
export PYTHONPATH=deconvolution/
pytest tests
export PYTHONPATH=
## Tests for Cedric
```
bash
snakemake
-s
Snakefile_data_simu
--config
n
=
10000
m
=[
4,6,8,10,12]
m_dev
=[
0,0.5,1,2,3]
snakemake
-s
Snakefile_d2
--config
input
=[
snakemake
-s
Snakefile_d2
--config
input
=[
snake_exec/simu_bar_n10000_d5_m10-dev0.5.gexf,snake_exec/simu_bar_n10000_d5_m10-dev0.gexf,snake_exec/simu_bar_n10000_d5_m10-dev1.gexf,snake_exec/simu_bar_n10000_d5_m10-dev2.gexf,snake_exec/simu_bar_n10000_d5_m10-dev3.gexf,snake_exec/simu_bar_n10000_d5_m12-dev0.5.gexf,snake_exec/simu_bar_n10000_d5_m12-dev0.gexf,snake_exec/simu_bar_n10000_d5_m12-dev1.gexf,snake_exec/simu_bar_n10000_d5_m12-dev2.gexf,snake_exec/simu_bar_n10000_d5_m12-dev3.gexf,snake_exec/simu_bar_n10000_d5_m4-dev0.5.gexf,snake_exec/simu_bar_n10000_d5_m4-dev0.gexf,snake_exec/simu_bar_n10000_d5_m4-dev1.gexf,snake_exec/simu_bar_n10000_d5_m4-dev2.gexf,snake_exec/simu_bar_n10000_d5_m4-dev3.gexf,snake_exec/simu_bar_n10000_d5_m6-dev0.5.gexf,snake_exec/simu_bar_n10000_d5_m6-dev0.gexf,snake_exec/simu_bar_n10000_d5_m6-dev1.gexf,snake_exec/simu_bar_n10000_d5_m6-dev2.gexf,snake_exec/simu_bar_n10000_d5_m6-dev3.gexf,snake_exec/simu_bar_n10000_d5_m8-dev0.5.gexf,snake_exec/simu_bar_n10000_d5_m8-dev0.gexf,snake_exec/simu_bar_n10000_d5_m8-dev1.gexf,snake_exec/simu_bar_n10000_d5_m8-dev2.gexf,snake_exec/simu_bar_n10000_d5_m8-dev3.gexf]]
```
This diff is collapsed.
Click to expand it.
Snakefile_d2
+
4
−
3
View file @
aba36815
import glob
WORKDIR = "snake_exec" if "workdir" not in config else config["workdir"]
INPUT = "snake_tests/simu_bar_n1000_d5_m2-dev0.gexf" if "input" not in config else config["input"]
SAMPLE_NAME = INPUT[INPUT.rfind('/')+1:INPUT.rfind('.')]
INPUT = ["snake_tests/simu_bar_n1000_d5_m2-dev0.gexf"] if "input" not in config else config["input"]
INPUT = INPUT if isinstance(INPUT, list) else [INPUT]
SAMPLE_NAME = [name[name.rfind('/')+1:name.rfind('.')] for name in INPUT]
rule all:
input:
f"{WORKDIR}/{SAMPLE_NAME
}.tar.gz"
expand(
f"{WORKDIR}/{
{name}}.tar.gz", name=
SAMPLE_NAME
)
rule compress_data:
input:
...
...
This diff is collapsed.
Click to expand it.
deconvolution/d_graph.py
+
5
−
5
View file @
aba36815
...
...
@@ -237,7 +237,7 @@ def compute_all_max_d_graphs(graph, debug=False, clique_mode=None):
for
idx
,
node
in
enumerate
(
list
(
graph
.
nodes
())):
#if "MI" not in str(node): continue # for debugging; only look at deconvolved nodes
print
(
f
"
\r
{
idx
+
1
}
/
{
len
(
graph
.
nodes
())
}
"
)
#
print(f"\r{idx+1}/{len(graph.nodes())}")
neighbors
=
list
(
graph
.
neighbors
(
node
))
neighbors_graph
=
nx
.
Graph
(
graph
.
subgraph
(
neighbors
))
...
...
@@ -278,7 +278,7 @@ def compute_all_max_d_graphs(graph, debug=False, clique_mode=None):
cliques
=
list
(
cliques_dict2
.
values
())
mode_str
+=
"
(testing)
"
print
(
"
cliques
"
,
len
(
cliques
))
#
print("cliques", len(cliques))
if
debug
:
print
(
"
node
"
,
node
,
"
has
"
,
len
(
cliques
),
"
cliques in neighborhood (of size
"
,
len
(
neighbors
),
"
)
"
)
cliques_debugging
=
True
...
...
@@ -289,7 +289,7 @@ def compute_all_max_d_graphs(graph, debug=False, clique_mode=None):
from
collections
import
Counter
len_cliques
=
Counter
(
map
(
len
,
cliques
))
print
(
"
sizes of found cliques%s:
"
%
mode_str
,
len_cliques
)
#
print("sizes of found cliques%s:" % mode_str, len_cliques)
# Pair halves to create d-graphes
for
idx
,
clq1
in
enumerate
(
cliques
):
...
...
@@ -306,9 +306,9 @@ def compute_all_max_d_graphs(graph, debug=False, clique_mode=None):
if
d_graph
.
get_link_divergence
()
<=
d_graph
.
get_optimal_score
()
*
factor
:
node_d_graphs
.
add
(
d_graph
)
print
(
"
d-graphs
"
,
len
(
node_d_graphs
))
#
print("d-graphs", len(node_d_graphs))
d_graphs
[
node
]
=
brutal_list_domination_filter
(
sorted
(
node_d_graphs
))
print
(
"
filtered
"
,
len
(
d_graphs
[
node
]))
#
print("filtered", len(d_graphs[node]))
return
d_graphs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment