Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
HOGVAX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Schulte
HOGVAX
Commits
e58bb6a1
Commit
e58bb6a1
authored
2 years ago
by
Sara Schulte
Browse files
Options
Downloads
Patches
Plain Diff
Add changes to snakemake pipeline
parent
2fabd904
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Pipeline/scripts/create_vac_seq_from_sol.py
+1
-1
1 addition, 1 deletion
Pipeline/scripts/create_vac_seq_from_sol.py
Pipeline/scripts/vaccine_ilp_hog.py
+5
-4
5 additions, 4 deletions
Pipeline/scripts/vaccine_ilp_hog.py
with
6 additions
and
5 deletions
Pipeline/scripts/create_vac_seq_from_sol.py
+
1
−
1
View file @
e58bb6a1
...
@@ -31,7 +31,7 @@ for edge in hog.edges():
...
@@ -31,7 +31,7 @@ for edge in hog.edges():
edge_dict
[
key
]
=
edge
edge_dict
[
key
]
=
edge
# create subgraph from edges chosen by ILP in order to find eulerian path to construct vaccine sequence
# create subgraph from edges chosen by ILP in order to find eulerian path to construct vaccine sequence
sub_hog
=
nx
.
DiGraph
()
sub_hog
=
nx
.
Multi
DiGraph
()
sub_hog
.
add_edges_from
([
edge_dict
[
e
]
for
e
in
edge_dict
if
e
in
edges
])
sub_hog
.
add_edges_from
([
edge_dict
[
e
]
for
e
in
edge_dict
if
e
in
edges
])
print
(
sub_hog
)
print
(
sub_hog
)
print
(
nx
.
is_eulerian
(
sub_hog
))
print
(
nx
.
is_eulerian
(
sub_hog
))
...
...
This diff is collapsed.
Click to expand it.
Pipeline/scripts/vaccine_ilp_hog.py
+
5
−
4
View file @
e58bb6a1
...
@@ -61,8 +61,8 @@ def solve_msks_hog(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph,
...
@@ -61,8 +61,8 @@ def solve_msks_hog(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph,
# create new model
# create new model
m
=
gp
.
Model
(
'
ivp_on_hog
'
)
m
=
gp
.
Model
(
'
ivp_on_hog
'
)
# set time limit to
10
hours
# set time limit to
48
hours
m
.
setParam
(
'
TimeLimit
'
,
360
00
)
m
.
setParam
(
'
TimeLimit
'
,
1728
00
)
m
.
setParam
(
'
Seed
'
,
42
)
m
.
setParam
(
'
Seed
'
,
42
)
# m.setParam('PoolSearchMode', 2)
# m.setParam('PoolSearchMode', 2)
# m.setParam('PoolSolutions', 5)
# m.setParam('PoolSolutions', 5)
...
@@ -78,7 +78,7 @@ def solve_msks_hog(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph,
...
@@ -78,7 +78,7 @@ def solve_msks_hog(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph,
log
(
'
Create edge variables
'
)
log
(
'
Create edge variables
'
)
x_edges
=
gp
.
tupledict
()
x_edges
=
gp
.
tupledict
()
for
node_a
,
node_b
in
sorted
(
graph
.
edges
):
for
node_a
,
node_b
in
sorted
(
graph
.
edges
):
x_edges
[
node_a
,
node_b
]
=
m
.
addVar
(
vtype
=
GRB
.
B
IN
ARY
,
x_edges
[
node_a
,
node_b
]
=
m
.
addVar
(
vtype
=
GRB
.
IN
TEGER
,
name
=
graph
.
nodes
[
node_a
][
'
string
'
]
+
'
_
'
+
graph
.
nodes
[
node_b
][
'
string
'
])
name
=
graph
.
nodes
[
node_a
][
'
string
'
]
+
'
_
'
+
graph
.
nodes
[
node_b
][
'
string
'
])
# the objective function is to maximize population coverage
# the objective function is to maximize population coverage
...
@@ -130,7 +130,8 @@ def solve_msks_hog(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph,
...
@@ -130,7 +130,8 @@ def solve_msks_hog(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph,
sol
=
m
.
getAttr
(
'
X
'
,
x_edges
)
sol
=
m
.
getAttr
(
'
X
'
,
x_edges
)
for
node_a
,
node_b
in
x_edges
:
for
node_a
,
node_b
in
x_edges
:
# print('%s -> %s: %g' % (node_a, node_b, sol[node_a, node_b]))
# print('%s -> %s: %g' % (node_a, node_b, sol[node_a, node_b]))
if
sol
[
node_a
,
node_b
]
>=
0.5
:
traversals
=
round
(
sol
[
node_a
,
node_b
])
for
i
in
range
(
traversals
):
if
node_a
in
leaves
.
values
():
if
node_a
in
leaves
.
values
():
chosen_pep
.
append
(
graph
.
nodes
[
node_a
][
'
string
'
])
chosen_pep
.
append
(
graph
.
nodes
[
node_a
][
'
string
'
])
if
node_b
in
leaves
.
values
():
if
node_b
in
leaves
.
values
():
...
...
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