Fred2.EpitopeAssembly Module¶
EpitopeAssembly.EpitopeAssembly¶
-
class
Fred2.EpitopeAssembly.EpitopeAssembly.EpitopeAssembly(peptides, pred, solver='glpk', weight=0.0, matrix=None, verbosity=0)¶ Bases:
objectImplements the epitope assembly approach proposed by Toussaint et al. using proteasomal cleavage site prediction and formulating the problem as TSP.
Note
Toussaint, N.C., et al. Universal peptide vaccines - Optimal peptide vaccine design based on viral sequence conservation. Vaccine 2011;29(47):8745-8753.
Parameters: - peptides (list(
Peptide)) – A list ofPeptidewhich shell be arranged - pred (
ACleavageSitePredictor) – AACleavageSitePrediction - solver (str) – Specifies the solver to use (mused by callable by pyomo)
- weight (float) – Specifies how strong unwanted cleavage sites should be punished [0,1], where 0 means they will be ignored, and 1 the sum of all unwanted cleave sites is subtracted from the cleave site between two epitopes
- verbosity (int) – Specifies how verbos the class will be, 0 means normal, >0 debug mode
-
approximate()¶ Approximates the eptiope assembly problem by applying Lin-Kernighan traveling salesman heuristic
Note
LKH implementation must be downloaded, compiled, and globally executable. Source code can be found here: http://www.akira.ruc.dk/~keld/research/LKH/
Returns: An order list of the Peptide(based on the sting-of-beads ordering)Return type: list( Peptide)
-
solve(options=None)¶ Solves the Epitope Assembly problem and returns an ordered list of the peptides
Note
This can take quite long and should not be done for more and 30 epitopes max!
Parameters: options (str) – Solver specific options as string (will not be checked for correctness) Returns: An order list of the Peptide(based on the string-of-beads ordering)Return type: list( Peptide)
- peptides (list(
-
class
Fred2.EpitopeAssembly.EpitopeAssembly.EpitopeAssemblyWithSpacer(peptides, cleav_pred, epi_pred, alleles, k=5, en=9, threshold=None, solver='glpk', alpha=0.99, beta=0, verbosity=0)¶ Bases:
objectImplements the epitope assembly approach proposed by Toussaint et al. using proteasomal cleavage site prediction and formulating the problem as TSP.
It also extends it by optimal spacer design. (currently only allowed with PSSM cleavage site and epitope prediction)
The ILP model is implemented. So be reasonable with the size of epitope to be arranged.
-
approximate(start=0, threads=1, options=None)¶ Approximates the Eptiope Assembly problem by applying Lin-Kernighan traveling salesman heuristic
LKH implementation must be downloaded, compiled, and globally executable.
Source code can be found here: http://www.akira.ruc.dk/~keld/research/LKH/
Parameters: - start (int) – Start length for spacers (default 0).
- threads (int) – Number of threads used for spacer design. Be careful, if options contain solver threads it will allocate threads*solver_threads cores!
- options (dict(str,str)) – Solver specific options (threads for example)
Returns: A list of ordered
PeptideReturn type: list(
Peptide)
-
solve(start=0, threads=None, options=None)¶ Solve the epitope assembly problem with spacers optimally using integer linear programming.
Note
This can take quite long and should not be done for more and 30 epitopes max! Also, one has to disable pre-solving steps in order to use this model.
Parameters: - start (int) – Start length for spacers (default 0).
- threads (int) – Number of threads used for spacer design. Be careful, if options contain solver threads it will allocate threads*solver_threads cores!
- options (dict(str,str)) – Solver specific options as keys and parameters as values
Returns: A list of ordered
PeptideReturn type: list(
Peptide)
-
EpitopeAssembly.MosaicVaccine¶
The methods offers an exact solution for small till medium sized problems as well as heuristics based on a Matheuristic using Tabu Search and Branch-and-Bound for large problems.
The heuristic proceeds as follows:
I: initialize solution s_best via greedy construction
s_current = s_best WHILE convergence is not reached DO:
I: s<-Tabu Search(s_current)
- II: s<-Intensification via local MIP(s) solution (allow only alpha arcs to change)
- if s > s_best:
- s_best = s
III: Diversification(s) to escape local maxima
END
-
class
Fred2.EpitopeAssembly.MosaicVaccine.MosaicVaccineTS(_results, threshold=None, k=10, solver='glpk', verbosity=0)¶ -
approximate(phi=0.05, options=None, _greedyLP=True, _tabu=True, _intensify=True, _jump=True, max_iter=10000, delta_change=0.0001, max_delta=101, seed=23478234)¶ Matheueristic using Tabu Search
-
solve(options=None)¶ solves the model optimally
-
-
class
Fred2.EpitopeAssembly.MosaicVaccine.TabuList(iterable=None, size=None)¶ Bases:
_abcoll.MutableSet-
add(key)¶
-
clear()¶ This is slow (creates N new iterators!) but effective.
-
discard(key)¶
-
isdisjoint(other)¶ Return True if two sets have a null intersection.
-
pop(last=True)¶
-
remove(value)¶ Remove an element. If not a member, raise a KeyError.
-
-
Fred2.EpitopeAssembly.MosaicVaccine.suffixPrefixMatch(m)¶ Return length of longest suffix of x of length at least k that matches a prefix of y. Return 0 if there no suffix/prefix match has length at least k.