epytope.Core Module

Core.Allele

class epytope.Core.Allele.AlleleFactory[source]

Bases: type

mro()

Return a type’s method resolution order.

class epytope.Core.Allele.Allele(name, prob=None)[source]

Bases: MetadataLogger

This class represents an HLA Allele and stores additional information

get_metadata(label, only_first=False)

Getter for the saved metadata with the key label

Parameters:
  • label (str) – key for the metadata that is inferred

  • only_first (bool) – true if only the the first element of the matadata list is to be returned

log_metadata(label, value)

Inserts a new metadata

Parameters:
  • label (str) – key for the metadata that will be added

  • value (list(object)) – any kindy of additional value that should be kept

class epytope.Core.Allele.CombinedAllele(name, prob=None)[source]

Bases: Allele

This class represents combined HLA class II Alleles with an alpha and beta chain

property locus
property supertype
property subtype
get_metadata(label, only_first=False)

Getter for the saved metadata with the key label

Parameters:
  • label (str) – key for the metadata that is inferred

  • only_first (bool) – true if only the the first element of the matadata list is to be returned

log_metadata(label, value)

Inserts a new metadata

Parameters:
  • label (str) – key for the metadata that will be added

  • value (list(object)) – any kindy of additional value that should be kept

class epytope.Core.Allele.MouseAllele(name, prob=None)[source]

Bases: Allele

This class represents a mouse MHC allele with the following nomenclature: H2-Xxx

http://www.imgt.org/IMGTrepertoireMHC/LocusGenes/index.php?repertoire=listIG_TR&species=mouse&group=MHC

property locus
property supertype
property subtype
get_metadata(label, only_first=False)

Getter for the saved metadata with the key label

Parameters:
  • label (str) – key for the metadata that is inferred

  • only_first (bool) – true if only the the first element of the matadata list is to be returned

log_metadata(label, value)

Inserts a new metadata

Parameters:
  • label (str) – key for the metadata that will be added

  • value (list(object)) – any kindy of additional value that should be kept

Core.Base

https://docs.python.org/3/library/abc.html

class epytope.Core.Base.MetadataLogger[source]

Bases: object

This class provides a simple interface for assigning additional metadata to any object in our data model. Examples: storing ANNOVAR columns like depth, base count, dbSNP id, quality information for variants, additional prediction information for peptides etc. This functionality is not used from core methods of epytope.

The saved values are accessed via log_metadata() and get_metadata()

log_metadata(label, value)[source]

Inserts a new metadata

Parameters:
  • label (str) – key for the metadata that will be added

  • value (list(object)) – any kindy of additional value that should be kept

get_metadata(label, only_first=False)[source]

Getter for the saved metadata with the key label

Parameters:
  • label (str) – key for the metadata that is inferred

  • only_first (bool) – true if only the the first element of the matadata list is to be returned

class epytope.Core.Base.APluginRegister(name, bases, namespace, **kwargs)[source]

Bases: ABCMeta

This class allows automatic registration of new plugins.

mro()

Return a type’s method resolution order.

register(subclass)

Register a virtual subclass of an ABC.

Returns the subclass, to allow usage as a class decorator.

class epytope.Core.Base.ACleavageSitePrediction[source]

Bases: object

abstract property name

The name of the predictor

abstract property version

Parameter specifying the version of the prediction method

abstract property supportedLength

The supported lengths of the predictor

abstract property cleavagePos

Parameter specifying the position of aa (within the prediction window) after which the sequence is cleaved (starting from 1)

abstract predict(aa_seq, **kwargs)[source]

Predicts the proteasomal cleavage site of the given sequences

Parameters:

aa_seq (Peptide or Protein) – The sequence to be cleaved

Returns:

Returns a AResult object for the specified Bio.Seq

Return type:

AResult

class epytope.Core.Base.ACleavageFragmentPrediction[source]

Bases: object

abstract property name

The name of the predictor

abstract property version

Parameter specifying the version of the prediction method

abstract property supportedLength

The supported lengths of the predictor

abstract property cleavagePos

Parameter specifying the position of aa (within the prediction window) after which the sequence is cleaved

abstract predict(aa_seq, **kwargs)[source]

Predicts the probability that the fragment can be produced by the proteasom

Parameters:

aa_seq (Peptide) – The sequence to be cleaved

Returns:

Returns a AResult object for the specified Bio.Seq

Return type:

AResult

class epytope.Core.Base.AEpitopePrediction[source]

Bases: object

abstract property name

The name of the predictor

abstract property version

The version of the predictor

abstract property supportedAlleles

A list of valid allele models

abstract property supportedLength

A list of supported peptide lengths

abstract convert_alleles(alleles)[source]

Converts alleles into the internal allele representation of the predictor and returns a string representation

Parameters:

alleles (list(Allele)) – The alleles for which the internal predictor representation is needed

Returns:

Returns a string representation of the input alleles

Return type:

list(str)

abstract predict(peptides, alleles=None, **kwargs)[source]

Predicts the binding affinity for a given peptide or peptide lists for a given list of alleles. If alleles is not given, predictions for all valid alleles of the predictor is performed. If, however, a list of alleles is given, predictions for the valid allele subset is performed.

Parameters:
  • peptides (Peptide or list(Peptide)) – The peptide objects for which predictions should be performed

  • alleles (Allele/list(Allele)) – An Allele or list of Allele for which prediction models should be used

Returns:

Returns a AResult object for the specified Peptide and Allele

Return type:

AResult

class epytope.Core.Base.ASVM[source]

Bases: object

Base class for SVM prediction tools

abstract encode(peptides)[source]

Returns the feature encoding for peptides

Parameters:

peptides (list(Peptide)/Peptide) – List of or a single Peptide object

Returns:

Feature encoding of the Peptide objects

Return type:

list(Object)

class epytope.Core.Base.AExternal[source]

Bases: object

Base class for external tools

abstract property command

Defines the commandline call for external tool

abstract parse_external_result(file)[source]

Parses external results and returns the result

Parameters:

file (str) – The file path or the external prediction results

Returns:

A dictionary containing the prediction results

Return type:

dict

is_in_path()[source]

Checks whether the specified execution command can be found in PATH

Returns:

Whether or not command could be found in PATH

Return type:

bool

abstract get_external_version(path=None)[source]

Returns the external version of the tool by executing >{command} –version

might be dependent on the method and has to be overwritten therefore it is declared abstract to enforce the user to overwrite the method. The function in the base class can be called with super()

Parameters:

path (str) –

  • Optional specification of executable path if deviant from self.__command

Returns:

The external version of the tool or None if tool does not support versioning

Return type:

str

class epytope.Core.Base.ATAPPrediction[source]

Bases: object

abstract property name

The name of the predictor

abstract property version

Parameter specifying the version of the prediction method

abstract property supportedLength

The supported lengths of the predictor

abstract predict(peptides, **kwargs)[source]

Predicts the TAP affinity for the given sequences

Parameters:

peptides (list(Peptide)/Peptide) – Peptide for which TAP affinity should be predicted

Returns:

Returns a TAPResult object

Return type:

TAPResult

class epytope.Core.Base.AHLATyping[source]

Bases: object

abstract property name

The name of the predictor

abstract property version

Parameter specifying the version of the prediction method

abstract predict(ngsFile, output, **kwargs)[source]

Prediction method for inferring the HLA typing

Parameters:
  • ngsFile (str) – The path to the input file containing the NGS reads

  • output (str) – The path to the output file or directory

Returns:

A list of HLA alleles representing the genotype predicted by the algorithm

Return type:

list(Allele)

epytope.Core.Base.deprecated(func)[source]

This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.

Core.Generator

Core.Peptide

Core.Protein

Core.Result

Core.Transcript

Core.Variant