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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Schulte
HOGVAX
Commits
5e17f211
Commit
5e17f211
authored
2 years ago
by
Sara Schulte
Browse files
Options
Downloads
Patches
Plain Diff
Remove output for debugging purpose and update ilp
parent
b291fa51
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
HOGVAX/hogvax_ilp.py
+9
-7
9 additions, 7 deletions
HOGVAX/hogvax_ilp.py
with
9 additions
and
7 deletions
HOGVAX/hogvax_ilp.py
+
9
−
7
View file @
5e17f211
...
@@ -116,9 +116,9 @@ def hogvax(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph, path, mi
...
@@ -116,9 +116,9 @@ def hogvax(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph, path, mi
log
(
'
Add allele hit constraint
'
)
log
(
'
Add allele hit constraint
'
)
for
allele
in
alleles
:
for
allele
in
alleles
:
# check for peptides (leaf nodes) with non-zero entry in B matrix for current allele
# check for peptides (leaf nodes) with non-zero entry in B matrix for current allele
hit_
leaves
=
list
(
filter
(
lambda
x
:
1.0
==
B_matrix
[
allele
][
x
],
leaves
.
keys
()))
hit_
pep
=
list
(
filter
(
lambda
x
:
1.0
==
B_matrix
[
allele
][
x
],
leaves
.
keys
()))
# only sum over such peptides instead of summing over all peptides -> only beneficial for ba threshold > 0.xx
# only sum over such peptides instead of summing over all peptides -> only beneficial for ba threshold > 0.xx
m
.
addConstr
(
hit
[
allele
]
*
min_hits
<=
gp
.
quicksum
(
x_
edges
.
sum
(
'
*
'
,
leaves
[
leaf
])
for
leaf
in
hit_
leaves
),
m
.
addConstr
(
hit
[
allele
]
*
min_hits
<=
gp
.
quicksum
(
x_
nodes
[
leaves
[
pep
]]
for
pep
in
hit_
pep
),
'
Peptide-hit for allele
'
+
'
_
'
.
join
(
allele
))
'
Peptide-hit for allele
'
+
'
_
'
.
join
(
allele
))
m
.
update
()
m
.
update
()
...
@@ -163,10 +163,11 @@ def hogvax(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph, path, mi
...
@@ -163,10 +163,11 @@ def hogvax(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph, path, mi
if
node_b
in
leaves
.
values
():
if
node_b
in
leaves
.
values
():
chosen_pep
.
append
(
graph
.
nodes
[
node_b
][
'
string
'
])
chosen_pep
.
append
(
graph
.
nodes
[
node_b
][
'
string
'
])
if
not
os
.
path
.
exists
(
path
+
'
lp_out/
'
):
# also only for more details and debugging
os
.
mkdir
(
path
+
'
lp_out/
'
)
# if not os.path.exists(path + 'lp_out/'):
m
.
write
(
path
+
'
lp_out/
'
+
pep_count
+
'
_vaccine_ilp_hog.sol
'
)
# os.mkdir(path + 'lp_out/')
m
.
write
(
path
+
'
lp_out/
'
+
pep_count
+
'
_vaccine_ilp_hog.json
'
)
# m.write(path + 'lp_out/' + pep_count + '_vaccine_ilp_hog.sol')
# m.write(path + 'lp_out/' + pep_count + '_vaccine_ilp_hog.json')
if
not
os
.
path
.
exists
(
path
+
'
pep_out/
'
):
if
not
os
.
path
.
exists
(
path
+
'
pep_out/
'
):
os
.
mkdir
(
path
+
'
pep_out/
'
)
os
.
mkdir
(
path
+
'
pep_out/
'
)
...
@@ -214,6 +215,7 @@ def hogvax(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph, path, mi
...
@@ -214,6 +215,7 @@ def hogvax(k, alleles, freq_vector, B_matrix, leaves, pep_count, graph, path, mi
if
node_inner
in
subtour
and
node_outer
not
in
subtour
),
if
node_inner
in
subtour
and
node_outer
not
in
subtour
),
'
At least one incoming edge to subtour
'
+
str
(
i
)
+
'
from the outside
'
)
'
At least one incoming edge to subtour
'
+
str
(
i
)
+
'
from the outside
'
)
m
.
write
(
path
+
'
lp_out/
'
+
pep_count
+
'
_vaccine_ilp_hog.lp
'
)
# only for debugging, lp file becomes quite large
# m.write(path + 'lp_out/' + pep_count + '_vaccine_ilp_hog.lp')
return
chosen_pep
return
chosen_pep
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