Skip to content

Commit

Permalink
Merge pull request #98 from KohlbacherLab/develop
Browse files Browse the repository at this point in the history
Release 3.4.0
  • Loading branch information
jonasscheid authored Jan 10, 2024
2 parents 28d70d4 + a262a50 commit c03599e
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install utilities
run: sudo apt-get install -y mmv
- name: Set up Python 3.7
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install pypa/build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-test-conda-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: epytope
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
repository: kohlbacherlab/fred-tools
token: ${{ secrets.FRED_CI_PAT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set conda package directory
run: |
mkdir /tmp/condapkgs
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v3.4.0 - 2024-01-10

### `Added`

- [#93](https://github.com/KohlbacherLab/epytope/pull/93) Added NetMHCIIpan version 4.2 interface [#92](https://github.com/KohlbacherLab/epytope/issues/92)
- [#96](https://github.com/KohlbacherLab/epytope/pull/96) Added NetMHCIIpan version 4.3 interface [#95](https://github.com/KohlbacherLab/epytope/issues/95)

### `Changed`

### `Fixed`

- [#93](https://github.com/KohlbacherLab/epytope/pull/93) Fixed length restriction of NetMHCIIpan interfaces [#91](https://github.com/KohlbacherLab/epytope/issues/91)

## v3.3.1 - 2023-04-25

### `Added`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Currently **epytope** provides implementations of several prediction methods or
- [NetMHC](https://pubmed.ncbi.nlm.nih.gov/26515819/) 3.0, 3.4, 4.0
- [NetMHCII](https://pubmed.ncbi.nlm.nih.gov/29315598/) 2.2, 2.3
- [NetMHCpan](https://pubmed.ncbi.nlm.nih.gov/28978689/) 2.4, 2.8, 3.0, 4.0, 4.1
- [NetMHCIIpan](https://pubmed.ncbi.nlm.nih.gov/32406916/) 3.0, 3.1, 4.0, 4.1
- [NetMHCIIpan](https://pubmed.ncbi.nlm.nih.gov/38000035/) 3.0, 3.1, 4.0, 4.1, 4.2, 4.3
- [PickPocket](https://pubmed.ncbi.nlm.nih.gov/19297351/) 1.1
- [NetCTLpan](https://pubmed.ncbi.nlm.nih.gov/20379710/) 1.1
- Epitope Selection
Expand Down
2 changes: 2 additions & 0 deletions epytope/Data/supportedAlleles/external/netmhcIIpan_4_2.py

Large diffs are not rendered by default.

81 changes: 80 additions & 1 deletion epytope/EpitopePrediction/External.py
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ class NetMHCIIpan_4_0(NetMHCIIpan_3_1):
"""
__name = "netmhcIIpan"
__version = "4.0"
__supported_length = frozenset([9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
__supported_length = frozenset(list(range(9,57)))
__allele_import_name = f"{__name}_{__version}".replace('.', '_')
__alleles = getattr(__import__("epytope.Data.supportedAlleles.external." + __allele_import_name,
fromlist=[__allele_import_name])
Expand Down Expand Up @@ -1597,6 +1597,81 @@ def parse_external_result(self, file):

return result

class NetMHCIIpan_4_2(NetMHCIIpan_4_1):
"""
Implementation of NetMHCIIpan 4.2 adapter.
"""
__name = "netmhcIIpan"
__version = "4.2"
__supported_length = frozenset(list(range(9,57)))
__allele_import_name = f"{__name}_{__version}".replace('.', '_')
__alleles = getattr(__import__("epytope.Data.supportedAlleles.external." + __allele_import_name,
fromlist=[__allele_import_name])
, __allele_import_name)

__command = "netMHCIIpan -f {peptides} -inptype 1 -a {alleles} {options} -xls -xlsfile {out}"


@property
def version(self):
"""The version of the predictor"""
return self.__version

@property
def command(self):
"""
Defines the commandline call for external tool
"""
return self.__command


class NetMHCIIpan_4_3(NetMHCIIpan_4_2):
"""
Implementation of NetMHCIIpan 4.3 adapter.
"""
__name = "netmhcIIpan"
__version = "4.3"
__supported_length = frozenset(list(range(9,57)))

__command = "netMHCIIpan -f {peptides} -inptype 1 -a {alleles} {options} -xls -xlsfile {out}"

@property
def version(self):
"""The version of the predictor"""
return self.__version

@property
def command(self):
"""
Defines the commandline call for external tool
"""
return self.__command

def parse_external_result(self, file):
"""
Parses external results and returns the result containing the predictors string representation
of alleles and peptides.
:param str file: The file path or the external prediction results
:return: A dictionary containing the prediction results
:rtype: dict
"""
f = csv.reader(open(file, "r"), delimiter='\t')
scores = defaultdict(defaultdict)
ranks = defaultdict(defaultdict)
alleles = [x for x in set([x for x in next(f) if x != ""])]
next(f)
for row in f:
pep_seq = row[PeptideIndex.NETMHCIIPAN_4_3]
for i, a in enumerate(alleles):
scores[a][pep_seq] = float(row[ScoreIndex.NETMHCIIPAN_4_3 + i * Offset.NETMHCIIPAN_4_3])
ranks[a][pep_seq] = float(row[RankIndex.NETMHCIIPAN_4_3 + i * Offset.NETMHCIIPAN_4_3])
# Create dictionary with hierarchy: {'Allele1': {'Score': {'Pep1': Score1, 'Pep2': Score2,..}, 'Rank': {'Pep1': RankScore1, 'Pep2': RankScore2,..}}, 'Allele2':...}
result = {allele: {metric:(list(scores.values())[j] if metric == "Score" else list(ranks.values())[j]) for metric in ["Score", "Rank"]} for j, allele in enumerate(alleles)}

return result


class PickPocket_1_1(AExternalEpitopePrediction):
"""
Implementation of PickPocket adapter.
Expand Down Expand Up @@ -1886,6 +1961,7 @@ class PeptideIndex(IntEnum):
NETMHCIIPAN_3_1 = 1
NETMHCIIPAN_4_0 = 1
NETMHCIIPAN_4_1 = 1
NETMHCIIPAN_4_3 = 1
PICKPOCKET_1_1 = 2
NETCTLPAN_1_1 = 3

Expand All @@ -1907,6 +1983,7 @@ class ScoreIndex(IntEnum):
NETMHCIIPAN_3_1 = 3
NETMHCIIPAN_4_0 = 4
NETMHCIIPAN_4_1 = 5
NETMHCIIPAN_4_3 = 6
PICKPOCKET_1_1 = 4
NETCTLPAN_1_1 = 7

Expand All @@ -1924,6 +2001,7 @@ class RankIndex(IntEnum):
NETMHCIIPAN_3_1 = 5
NETMHCIIPAN_4_0 = 5
NETMHCIIPAN_4_1 = 6
NETMHCIIPAN_4_3 = 7

class Offset(IntEnum):
"""
Expand All @@ -1941,6 +2019,7 @@ class Offset(IntEnum):
NETMHCIIPAN_3_1 = 3
NETMHCIIPAN_4_0 = 2
NETMHCIIPAN_4_1 = 3
NETMHCIIPAN_4_3 = 3

class HLAIndex(IntEnum):
"""
Expand Down
5 changes: 4 additions & 1 deletion epytope/test/TestSpacerDesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def test_standart_functions(self):
sbws = EpitopeAssemblyWithSpacer(self.epis, cl_pred, epi_pred, self.alleles, solver="glpk")
sol = sbws.solve()
print(sol)
assert all(i == str(j) for i, j in zip(["GHRMAWDM", "WWQW", "VYEADDVI"], sol))
test1 = all(i == str(j) for i, j in zip(["GHRMAWDM", "WWQW", "VYEADDVI"], sol))
test2 = all(i == str(j) for i, j in zip(["GHRMAWDM", "WWRW", "VYEADDVI"], sol))

assert (test1 or test2)

def test_unsupported_allele_length_combination(self):
"""
Expand Down
6 changes: 3 additions & 3 deletions epytope/tutorials/EpitopePrediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@
"output_type": "stream",
"text": [
"netmhc 3.0a,3.4,4.0\n",
"netmhcpan 2.4,2.8,3.0,4.0\n",
"netmhcpan 2.4,2.8,3.0,4.0,4.1\n",
"netmhcstabpan 1.0\n",
"netmhcii 2.2\n",
"netmhciipan 3.0,3.1\n",
"netmhciipan 3.0,3.1,4.0,4.1,4.2,4.3\n",
"pickpocket 1.1\n",
"netctlpan 1.1\n",
"syfpeithi 1.0\n",
Expand Down Expand Up @@ -1085,7 +1085,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.13"
"version": "3.7.12"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
name='epytope',

# Version:
version='3.3.1',
version='3.4.0',

description='A Framework for Epitope Detection and Vaccine Design',
long_description=long_description,
Expand All @@ -32,11 +32,11 @@

# Author details
author='Benjamin Schubert, Mathias Walzer, Christopher Mohr, Leon Kuchenbecker',
author_email='benjamin.schubert@helmholtz-muenchen.de, walzer@ebi.ac.uk, christopher.mohr@uni-tuebingen.de, leon.kuchenbecker@uni-tuebingen.de ',
author_email='benjamin.schubert@helmholtz-muenchen.de, walzer@ebi.ac.uk, contact.cmohr@gmail.com, leon.kuchenbecker@uni-tuebingen.de ',

# maintainer details
maintainer='Christopher Mohr',
maintainer_email='christopher.mohr@uni-tuebingen.de',
maintainer='Christopher Mohr, Jonas Scheid',
maintainer_email='contact.cmohr@gmail.com, jonas.scheid@uni-tuebingen.de',

# Choose your license
license='BSD',
Expand Down

0 comments on commit c03599e

Please sign in to comment.