Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EpitopeAssembly fails for instances > 50 peptides #247

Open
matdoering opened this issue Jun 30, 2021 · 0 comments
Open

EpitopeAssembly fails for instances > 50 peptides #247

matdoering opened this issue Jun 30, 2021 · 0 comments

Comments

@matdoering
Copy link

Solving the EpitopeAssembly fails for larger instances with roughly more than 50 peptides. The error occurs while retrieving "immutable param values" for the peptide pairs

Minimal example:

from Fred2.CleavagePrediction import CleavageSitePredictorFactory
from Fred2.EpitopeAssembly import EpitopeAssembly
from Fred2.Core import Peptide

cleavage_predictor = CleavageSitePredictorFactory("PCM")
peptides = [
"YANRNRFLY",
"AGDSGFAAY",
"ATSRTLSYY",
"SSDNIALLV",
"VAGDSGFAAY",
"RVAGDSGFAAY",
"VATSRTLSY",
"FTSDYYQLY",
"ISEHDYQIGGY",
"TSDYYQLY",
"TTSPISEHDY",
"STDTGVEHVTF",
"HSYFTSDYY",
"STDTGVEHV",
"IVDEPEEHV",
"LSKSLTENKY",
"VVDDPCPIHFY",
"VDDPCPIHFY",
"VVDDPCPIHF",
"CSFYEDFLEY",
"YIDIGNYTV",
"SFYEDFLEY",
"NSSPDDQIGYY",
"SSPDDQIGYY",
"NSSPDDQIGY",
"VTPSGTWLTY",
"SSPDDQIGY",
"SPDDQIGYY",
"GTGPEAGLPY",
"LLNKHIDAY",
"EVTPSGTWLTY",
"DLSPRWYFY",
"ITLATCELY",
"RQEEVQELY",
"ATCELYHY",
"VSLVKPSFY",
"LTALRLCAY",
"LTDEMIAQY",
"STECSNLLLQY",
"LADAGFIKQY",
"LIDLQELGKY",
"TSNQVAVLY",
"NIDGYFKIY",
"NLDSKVGGNY",
"NTSNQVAVLY",
"YSSANNCTFEY",
"SANNCTFEY",
"YTNSFTRGVYY",
"VADYSVLY",
"MTKTSVDCTMY",
"YTNSFTRGVY",
"RVDFCGKGY",
"SSANNCTFEY"]

peptides = [Peptide(peptide) for peptide in peptides]

opti_result = EpitopeAssembly(
        peptides, cleavage_predictor, solver="cbc"
    ).solve()

Log:

ERROR: Rule failed when generating expression for objective obj: ValueError:
    Error retrieving immutable Param value (w_ab[('SSPDDQIGYY',
    'SSANNCTFEY')]):
        The Param value is undefined and no default value is specified.
ERROR: Constructing component 'obj' from data=None failed: ValueError: Error
    retrieving immutable Param value (w_ab[('SSPDDQIGYY', 'SSANNCTFEY')]):
        The Param value is undefined and no default value is specified.
Traceback (most recent call last):
  File "code_no_alleles.py", line 64, in <module>
    peptides, cleavage_predictor, solver="cbc"
  File "/usr/local/lib/python2.7/site-packages/Fred2/EpitopeAssembly/EpitopeAssembly.py", line 132, in __init__
    sense=minimize)
  File "/usr/local/lib/python2.7/site-packages/pyomo/core/base/block.py", line 544, in __setattr__
    self.add_component(name, val)
  File "/usr/local/lib/python2.7/site-packages/pyomo/core/base/block.py", line 1089, in add_component
    val.construct(data)
  File "/usr/local/lib/python2.7/site-packages/pyomo/core/base/objective.py", line 357, in construct
    tmp = _init_rule(_self_parent)
  File "/usr/local/lib/python2.7/site-packages/Fred2/EpitopeAssembly/EpitopeAssembly.py", line 130, in <lambda>
    rule=lambda mode: sum( model.w_ab[a,b]*model.x[a,b] for a in model.E_prime
  File "/usr/local/lib/python2.7/site-packages/Fred2/EpitopeAssembly/EpitopeAssembly.py", line 131, in <genexpr>
    for b in model.E_prime if a != b),
  File "/usr/local/lib/python2.7/site-packages/pyomo/core/base/indexed_component.py", line 426, in __getitem__
    return self._getitem_when_not_present(index)
  File "/usr/local/lib/python2.7/site-packages/pyomo/core/base/param.py", line 518, in _getitem_when_not_present
    % ( idx_str,) )
ValueError: Error retrieving immutable Param value (w_ab[('SSPDDQIGYY', 'SSANNCTFEY')]):
        The Param value is undefined and no default value is specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant