pepdata 1.2.2__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. {pepdata-1.2.2 → pepdata-1.2.4}/MANIFEST.in +0 -1
  2. pepdata-1.2.4/PKG-INFO +86 -0
  3. pepdata-1.2.4/README.md +55 -0
  4. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/columns.py +3 -2
  5. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/tcell.py +14 -9
  6. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/version.py +2 -2
  7. pepdata-1.2.4/pepdata.egg-info/PKG-INFO +86 -0
  8. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata.egg-info/SOURCES.txt +3 -0
  9. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata.egg-info/top_level.txt +2 -0
  10. {pepdata-1.2.2 → pepdata-1.2.4}/pyproject.toml +5 -1
  11. pepdata-1.2.4/scripts/check_docs_examples.py +33 -0
  12. pepdata-1.2.4/scripts/check_docs_links.py +54 -0
  13. pepdata-1.2.4/tests/conftest.py +23 -0
  14. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_iedb_tcell.py +8 -15
  15. pepdata-1.2.2/PKG-INFO +0 -78
  16. pepdata-1.2.2/README.md +0 -51
  17. pepdata-1.2.2/pepdata.egg-info/PKG-INFO +0 -78
  18. {pepdata-1.2.2 → pepdata-1.2.4}/LICENSE.txt +0 -0
  19. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/__init__.py +0 -0
  20. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/amino_acid.py +0 -0
  21. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/amino_acid_alphabet.py +0 -0
  22. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/amino_acid_properties.py +0 -0
  23. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/blosum.py +0 -0
  24. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/chou_fasman.py +0 -0
  25. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/common.py +0 -0
  26. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/__init__.py +0 -0
  27. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/alleles.py +0 -0
  28. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/common.py +0 -0
  29. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/memoize.py +0 -0
  30. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/iedb/mhc.py +0 -0
  31. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/BLOSUM30 +0 -0
  32. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/BLOSUM50 +0 -0
  33. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/BLOSUM62 +0 -0
  34. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/__init__.py +0 -0
  35. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/amino_acid_properties.txt +0 -0
  36. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/helix_vs_coil.txt +0 -0
  37. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/helix_vs_strand.txt +0 -0
  38. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/pmbec.mat +0 -0
  39. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/matrices/strand_vs_coil.txt +0 -0
  40. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/peptide_vectorizer.py +0 -0
  41. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/pmbec.py +0 -0
  42. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/reduced_alphabet.py +0 -0
  43. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/residue_contact_energies.py +0 -0
  44. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata/static_data.py +0 -0
  45. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata.egg-info/dependency_links.txt +0 -0
  46. {pepdata-1.2.2 → pepdata-1.2.4}/pepdata.egg-info/requires.txt +0 -0
  47. {pepdata-1.2.2 → pepdata-1.2.4}/requirements.txt +0 -0
  48. {pepdata-1.2.2 → pepdata-1.2.4}/setup.cfg +0 -0
  49. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_amino_acids.py +0 -0
  50. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_blosum.py +0 -0
  51. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_iedb_alleles.py +0 -0
  52. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_iedb_mhc.py +0 -0
  53. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_ngram.py +0 -0
  54. {pepdata-1.2.2 → pepdata-1.2.4}/tests/test_pmbec.py +0 -0
@@ -1,2 +1 @@
1
1
  recursive-include pepdata/matrices *
2
- recursive-include pepdata/data *csv
pepdata-1.2.4/PKG-INFO ADDED
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: pepdata
3
+ Version: 1.2.4
4
+ Summary: Immunological peptide datasets and amino acid properties
5
+ Author-email: Alex Rubinsteyn <alex.rubinsteyn@mssm.edu>
6
+ Project-URL: Homepage, https://github.com/openvax/pepdata
7
+ Project-URL: Bug Tracker, https://github.com/openvax/pepdata/issues
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE.txt
22
+ Requires-Dist: numpy<3.0.0,>=2.0.0
23
+ Requires-Dist: scipy>=0.9
24
+ Requires-Dist: pandas>=0.17
25
+ Requires-Dist: scikit-learn>=0.14.1
26
+ Requires-Dist: progressbar33
27
+ Requires-Dist: biopython>=1.65
28
+ Requires-Dist: datacache>=0.4.4
29
+ Requires-Dist: lxml
30
+ Dynamic: license-file
31
+
32
+ # PepData
33
+
34
+ Look up shipped amino-acid properties and pairwise matrices, encode peptide
35
+ sequences, or load peptide assay tables from IEDB. Property lookups work offline;
36
+ IEDB tables require a download.
37
+
38
+ ## Install
39
+
40
+ ```sh
41
+ python -m pip install pepdata
42
+ ```
43
+
44
+ Python 3.11 or later is required.
45
+
46
+ ## Look up a peptide's residue properties
47
+
48
+ ```python
49
+ from pepdata.amino_acid_properties import hydropathy
50
+
51
+ peptide = "ACD"
52
+ print([hydropathy[residue] for residue in peptide])
53
+ ```
54
+
55
+ ```text
56
+ [1.8, 2.5, -3.5]
57
+ ```
58
+
59
+ The values come from the shipped residue-property table. The dictionary maps
60
+ single-letter residues to numeric values; it does not predict MHC binding or
61
+ clinical immunogenicity. Use uppercase canonical residue letters. A missing
62
+ letter raises `KeyError`.
63
+
64
+ ## Find the interface you need
65
+
66
+ | Task | Module or object |
67
+ | --- | --- |
68
+ | Single-residue properties | `pepdata.amino_acid_properties` |
69
+ | BLOSUM substitution matrices | `pepdata.blosum` |
70
+ | PMBEC and contact tables | `pepdata.pmbec`, `pepdata.residue_contact_energies` |
71
+ | Residue alphabets | `pepdata.amino_acid_alphabet`, `pepdata.reduced_alphabet` |
72
+ | N-gram features | `pepdata.PeptideVectorizer` |
73
+ | MHC-binding assay tables | `pepdata.iedb.mhc` |
74
+ | T-cell assay tables | `pepdata.iedb.tcell` |
75
+
76
+ See [residue and pairwise tables](docs/guides/properties.md), then
77
+ [peptide features and IEDB tables](docs/guides/datasets.md). The
78
+ [API reference](docs/reference.md) follows those same tasks.
79
+
80
+ Older pepdata documentation placed the property tables in `amino_acid` and
81
+ described a `StringTransformer` interface. The property dictionaries are
82
+ in `amino_acid_properties`, and there is no `StringTransformer` class.
83
+
84
+ ## Documentation development
85
+
86
+ Install `requirements-docs.txt`, run `./docs.sh`, then `python scripts/check_docs_examples.py`.
@@ -0,0 +1,55 @@
1
+ # PepData
2
+
3
+ Look up shipped amino-acid properties and pairwise matrices, encode peptide
4
+ sequences, or load peptide assay tables from IEDB. Property lookups work offline;
5
+ IEDB tables require a download.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ python -m pip install pepdata
11
+ ```
12
+
13
+ Python 3.11 or later is required.
14
+
15
+ ## Look up a peptide's residue properties
16
+
17
+ ```python
18
+ from pepdata.amino_acid_properties import hydropathy
19
+
20
+ peptide = "ACD"
21
+ print([hydropathy[residue] for residue in peptide])
22
+ ```
23
+
24
+ ```text
25
+ [1.8, 2.5, -3.5]
26
+ ```
27
+
28
+ The values come from the shipped residue-property table. The dictionary maps
29
+ single-letter residues to numeric values; it does not predict MHC binding or
30
+ clinical immunogenicity. Use uppercase canonical residue letters. A missing
31
+ letter raises `KeyError`.
32
+
33
+ ## Find the interface you need
34
+
35
+ | Task | Module or object |
36
+ | --- | --- |
37
+ | Single-residue properties | `pepdata.amino_acid_properties` |
38
+ | BLOSUM substitution matrices | `pepdata.blosum` |
39
+ | PMBEC and contact tables | `pepdata.pmbec`, `pepdata.residue_contact_energies` |
40
+ | Residue alphabets | `pepdata.amino_acid_alphabet`, `pepdata.reduced_alphabet` |
41
+ | N-gram features | `pepdata.PeptideVectorizer` |
42
+ | MHC-binding assay tables | `pepdata.iedb.mhc` |
43
+ | T-cell assay tables | `pepdata.iedb.tcell` |
44
+
45
+ See [residue and pairwise tables](docs/guides/properties.md), then
46
+ [peptide features and IEDB tables](docs/guides/datasets.md). The
47
+ [API reference](docs/reference.md) follows those same tasks.
48
+
49
+ Older pepdata documentation placed the property tables in `amino_acid` and
50
+ described a `StringTransformer` interface. The property dictionaries are
51
+ in `amino_acid_properties`, and there is no `StringTransformer` class.
52
+
53
+ ## Documentation development
54
+
55
+ Install `requirements-docs.txt`, run `./docs.sh`, then `python scripts/check_docs_examples.py`.
@@ -47,8 +47,9 @@ def find(df : pd.DataFrame, group_candidates : list[str], column_candidates : li
47
47
 
48
48
  if len(possible_matches) == 0:
49
49
  return None
50
- # get the shortest matches
51
-
50
+ # get the shortest match
51
+ best = min(possible_matches, key=lambda p: len(p[0]) + len(p[1]))
52
+ return df[best]
52
53
 
53
54
 
54
55
  MHC_GROUP_CANDIDATES : list[str] = ["MHC", "MHC Restriction"]
@@ -62,8 +62,8 @@ def delete():
62
62
  @memoize
63
63
  def load_dataframe(
64
64
  mhc_class : str | None = None, # 1, 2, or None for neither
65
- mhc_pattern : str | None = None,
66
- exclude_mhc : str | None = None,
65
+ hla : str | None = None,
66
+ exclude_hla : str | None = None,
67
67
  human_only : bool =False,
68
68
  peptide_length : int | None = None,
69
69
  assay_method : str | None = None,
@@ -78,10 +78,10 @@ def load_dataframe(
78
78
  mhc_class: {None, 1, 2}
79
79
  Restrict to MHC Class I or Class II (or None for neither)
80
80
 
81
- mhc_pattern: regex pattern, optional
81
+ hla: regex pattern, optional
82
82
  Restrict results to specific MHC used in assay
83
83
 
84
- exclude_mhc: regex pattern, optional
84
+ exclude_hla: regex pattern, optional
85
85
  Exclude certain MHC allele patterns
86
86
 
87
87
  human_only: bool
@@ -119,6 +119,11 @@ def load_dataframe(
119
119
  organism = get_host_name(df)
120
120
  assay_method_series = get_assay_method(df)
121
121
 
122
+ if epitopes is None:
123
+ raise ValueError(
124
+ "Could not find epitope name column in IEDB T-cell data. "
125
+ f"Available columns: {list(df.columns)}"
126
+ )
122
127
 
123
128
  # Sometimes the IEDB seems to put in an extra comma in the
124
129
  # header line, which creates an unnamed column of NaNs.
@@ -126,7 +131,7 @@ def load_dataframe(
126
131
  df = df.dropna(axis=1, how="all")
127
132
 
128
133
  n = len(df)
129
-
134
+
130
135
  null_epitope_seq = epitopes.isnull()
131
136
  n_null = null_epitope_seq.sum()
132
137
 
@@ -173,11 +178,11 @@ def load_dataframe(
173
178
  # or
174
179
  # "Class I,allele undetermined"
175
180
 
176
- if mhc_pattern:
177
- mask &= mhc.str.contains(mhc_pattern, na=False)
181
+ if hla:
182
+ mask &= mhc.str.contains(hla, na=False)
178
183
 
179
- if exclude_mhc:
180
- mask &= ~(mhc.str.contains(exclude_mhc, na=False))
184
+ if exclude_hla:
185
+ mask &= ~(mhc.str.contains(exclude_hla, na=False))
181
186
 
182
187
  if assay_method is not None and assay_method_series is not None:
183
188
  mask &= assay_method_series.str.contains(assay_method, na=False)
@@ -1,8 +1,8 @@
1
- __version__ = "1.2.2"
1
+ __version__ = "1.2.4"
2
2
 
3
3
 
4
4
  def print_version():
5
5
  print(f"v{__version__}")
6
6
 
7
7
  if __name__ == "__main__":
8
- print_version()
8
+ print_version()
@@ -0,0 +1,86 @@
1
+ Metadata-Version: 2.4
2
+ Name: pepdata
3
+ Version: 1.2.4
4
+ Summary: Immunological peptide datasets and amino acid properties
5
+ Author-email: Alex Rubinsteyn <alex.rubinsteyn@mssm.edu>
6
+ Project-URL: Homepage, https://github.com/openvax/pepdata
7
+ Project-URL: Bug Tracker, https://github.com/openvax/pepdata/issues
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE.txt
22
+ Requires-Dist: numpy<3.0.0,>=2.0.0
23
+ Requires-Dist: scipy>=0.9
24
+ Requires-Dist: pandas>=0.17
25
+ Requires-Dist: scikit-learn>=0.14.1
26
+ Requires-Dist: progressbar33
27
+ Requires-Dist: biopython>=1.65
28
+ Requires-Dist: datacache>=0.4.4
29
+ Requires-Dist: lxml
30
+ Dynamic: license-file
31
+
32
+ # PepData
33
+
34
+ Look up shipped amino-acid properties and pairwise matrices, encode peptide
35
+ sequences, or load peptide assay tables from IEDB. Property lookups work offline;
36
+ IEDB tables require a download.
37
+
38
+ ## Install
39
+
40
+ ```sh
41
+ python -m pip install pepdata
42
+ ```
43
+
44
+ Python 3.11 or later is required.
45
+
46
+ ## Look up a peptide's residue properties
47
+
48
+ ```python
49
+ from pepdata.amino_acid_properties import hydropathy
50
+
51
+ peptide = "ACD"
52
+ print([hydropathy[residue] for residue in peptide])
53
+ ```
54
+
55
+ ```text
56
+ [1.8, 2.5, -3.5]
57
+ ```
58
+
59
+ The values come from the shipped residue-property table. The dictionary maps
60
+ single-letter residues to numeric values; it does not predict MHC binding or
61
+ clinical immunogenicity. Use uppercase canonical residue letters. A missing
62
+ letter raises `KeyError`.
63
+
64
+ ## Find the interface you need
65
+
66
+ | Task | Module or object |
67
+ | --- | --- |
68
+ | Single-residue properties | `pepdata.amino_acid_properties` |
69
+ | BLOSUM substitution matrices | `pepdata.blosum` |
70
+ | PMBEC and contact tables | `pepdata.pmbec`, `pepdata.residue_contact_energies` |
71
+ | Residue alphabets | `pepdata.amino_acid_alphabet`, `pepdata.reduced_alphabet` |
72
+ | N-gram features | `pepdata.PeptideVectorizer` |
73
+ | MHC-binding assay tables | `pepdata.iedb.mhc` |
74
+ | T-cell assay tables | `pepdata.iedb.tcell` |
75
+
76
+ See [residue and pairwise tables](docs/guides/properties.md), then
77
+ [peptide features and IEDB tables](docs/guides/datasets.md). The
78
+ [API reference](docs/reference.md) follows those same tasks.
79
+
80
+ Older pepdata documentation placed the property tables in `amino_acid` and
81
+ described a `StringTransformer` interface. The property dictionaries are
82
+ in `amino_acid_properties`, and there is no `StringTransformer` class.
83
+
84
+ ## Documentation development
85
+
86
+ Install `requirements-docs.txt`, run `./docs.sh`, then `python scripts/check_docs_examples.py`.
@@ -37,6 +37,9 @@ pepdata/matrices/helix_vs_coil.txt
37
37
  pepdata/matrices/helix_vs_strand.txt
38
38
  pepdata/matrices/pmbec.mat
39
39
  pepdata/matrices/strand_vs_coil.txt
40
+ scripts/check_docs_examples.py
41
+ scripts/check_docs_links.py
42
+ tests/conftest.py
40
43
  tests/test_amino_acids.py
41
44
  tests/test_blosum.py
42
45
  tests/test_iedb_alleles.py
@@ -1,3 +1,5 @@
1
1
  dist
2
+ docs
2
3
  pepdata
4
+ scripts
3
5
  tests
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pepdata"
7
- requires-python = ">=3.9"
7
+ requires-python = ">=3.11"
8
8
  authors = [{name="Alex Rubinsteyn", email="alex.rubinsteyn@mssm.edu"}]
9
9
  description = "Immunological peptide datasets and amino acid properties"
10
10
  classifiers = [
@@ -14,6 +14,10 @@ classifiers = [
14
14
  "Intended Audience :: Science/Research",
15
15
  "License :: OSI Approved :: Apache Software License",
16
16
  "Programming Language :: Python",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
17
21
  "Topic :: Scientific/Engineering :: Bio-Informatics",
18
22
  ]
19
23
  readme = "README.md"
@@ -0,0 +1,33 @@
1
+ """Execute documentation examples and compare the printed output."""
2
+
3
+ import contextlib
4
+ import io
5
+ import re
6
+ import sys
7
+ import types
8
+ from pathlib import Path
9
+
10
+
11
+ def main():
12
+ count = 0
13
+ for path in sorted(Path("docs").rglob("*.md")):
14
+ module = types.ModuleType("docs_example_" + path.stem.replace("-", "_"))
15
+ sys.modules[module.__name__] = module
16
+ blocks = list(re.finditer(r"```(python|text)\n(.*?)\n```", path.read_text(), re.S))
17
+ for index, match in enumerate(blocks):
18
+ if match[1] != "python" or index + 1 == len(blocks) or blocks[index + 1][1] != "text":
19
+ continue
20
+ output = io.StringIO()
21
+ with contextlib.redirect_stdout(output):
22
+ exec(compile(match[2], str(path), "exec"), module.__dict__)
23
+ if index + 1 < len(blocks) and blocks[index + 1][1] == "text":
24
+ expected = blocks[index + 1][2].rstrip()
25
+ actual = output.getvalue().rstrip()
26
+ if actual != expected:
27
+ raise AssertionError(f"{path}: {actual!r} != {expected!r}")
28
+ count += 1
29
+ print(f"Executed {count} documentation examples.")
30
+
31
+
32
+ if __name__ == "__main__":
33
+ main()
@@ -0,0 +1,54 @@
1
+ """Check rendered internal links and fragment targets."""
2
+ from html.parser import HTMLParser
3
+ from pathlib import Path
4
+ from urllib.parse import unquote, urlsplit
5
+ import yaml
6
+
7
+
8
+ class Page(HTMLParser):
9
+ def __init__(self, text):
10
+ super().__init__()
11
+ self.ids = set()
12
+ self.links = []
13
+ self.feed(text)
14
+
15
+ def handle_starttag(self, tag, attrs):
16
+ attrs = dict(attrs)
17
+ if attrs.get("id"):
18
+ self.ids.add(attrs["id"])
19
+ if tag == "a" and attrs.get("href"):
20
+ self.links.append(attrs["href"])
21
+
22
+
23
+ def main():
24
+ root = Path("site").resolve()
25
+ base = urlsplit(yaml.safe_load(Path("mkdocs.yml").read_text())["site_url"]).path.rstrip("/")
26
+ pages = {p.resolve(): Page(p.read_text()) for p in root.rglob("*.html")}
27
+ failures = []
28
+ count = 0
29
+ for source, page in pages.items():
30
+ for href in page.links:
31
+ url = urlsplit(href)
32
+ if url.scheme or url.netloc:
33
+ continue
34
+ path = unquote(url.path)
35
+ if path.startswith("/"):
36
+ if not (path == base or path.startswith(base + "/")):
37
+ continue
38
+ target = (root / path[len(base):].lstrip("/")).resolve()
39
+ else:
40
+ target = (source.parent / path).resolve() if path else source
41
+ if target.is_dir():
42
+ target /= "index.html"
43
+ count += 1
44
+ if not target.is_relative_to(root) or not target.exists():
45
+ failures.append(f"{source.relative_to(root)}: missing {href}")
46
+ elif url.fragment and target in pages and unquote(url.fragment) not in pages[target].ids:
47
+ failures.append(f"{source.relative_to(root)}: missing fragment {href}")
48
+ if failures:
49
+ raise SystemExit("\n".join(failures))
50
+ print(f"Checked {len(pages)} pages and {count} internal links.")
51
+
52
+
53
+ if __name__ == "__main__":
54
+ main()
@@ -0,0 +1,23 @@
1
+ """Use synthetic IEDB-format fixtures instead of live downloads in unit tests."""
2
+
3
+ import os
4
+ import pytest
5
+
6
+ FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "data")
7
+
8
+
9
+ @pytest.fixture(autouse=True)
10
+ def patch_iedb_paths(monkeypatch):
11
+ """Redirect assay tables and the allele catalogue to bundled fixtures."""
12
+ monkeypatch.setattr(
13
+ "pepdata.iedb.alleles.local_path",
14
+ lambda force_download=False: os.path.join(FIXTURES_DIR, "alleles_test_fixture.xml"),
15
+ )
16
+ monkeypatch.setattr(
17
+ "pepdata.iedb.tcell.local_path",
18
+ lambda auto_download=True: os.path.join(FIXTURES_DIR, "tcell_test_fixture.csv"),
19
+ )
20
+ monkeypatch.setattr(
21
+ "pepdata.iedb.mhc.local_path",
22
+ lambda auto_download=True: os.path.join(FIXTURES_DIR, "mhc_test_fixture.csv"),
23
+ )
@@ -1,16 +1,5 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License");
2
- # you may not use this file except in compliance with the License.
3
- # You may obtain a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS,
9
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- # See the License for the specific language governing permissions and
11
- # limitations under the License.
12
-
13
1
  from pepdata import iedb
2
+ from pepdata.iedb.columns import get_mhc_allele
14
3
 
15
4
  def test_tcell_hla_restrict_a24():
16
5
  """
@@ -37,13 +26,17 @@ def test_tcell_hla_exclude_a0201():
37
26
  that allele
38
27
  """
39
28
  df_all = iedb.tcell.load_dataframe(nrows=1000)
40
- assert (df_all['MHC']['Allele Name'] == "HLA-A*02:01").any()
29
+ mhc_alleles = get_mhc_allele(df_all)
30
+ assert mhc_alleles is not None, "Could not find MHC allele column"
31
+ assert (mhc_alleles == "HLA-A*02:01").any()
41
32
 
42
33
  df_exclude = iedb.tcell.load_dataframe(
43
34
  nrows=1000,
44
- exclude_hla="HLA-A\*02:01")
35
+ exclude_hla=r"HLA-A\*02:01")
45
36
 
46
- n_A0201_entries = (df_exclude['MHC']['Allele Name'] == "HLA-A*02:01").sum()
37
+ mhc_alleles_filtered = get_mhc_allele(df_exclude)
38
+ assert mhc_alleles_filtered is not None
39
+ n_A0201_entries = (mhc_alleles_filtered == "HLA-A*02:01").sum()
47
40
  assert n_A0201_entries == 0, \
48
41
  ("Not supposed to contain HLA-A*02:01, "
49
42
  " but found %d rows of that allele") % n_A0201_entries
pepdata-1.2.2/PKG-INFO DELETED
@@ -1,78 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pepdata
3
- Version: 1.2.2
4
- Summary: Immunological peptide datasets and amino acid properties
5
- Author-email: Alex Rubinsteyn <alex.rubinsteyn@mssm.edu>
6
- Project-URL: Homepage, https://github.com/openvax/pepdata
7
- Project-URL: Bug Tracker, https://github.com/openvax/pepdata/issues
8
- Classifier: Development Status :: 4 - Beta
9
- Classifier: Environment :: Console
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python
14
- Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
15
- Requires-Python: >=3.9
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE.txt
18
- Requires-Dist: numpy<3.0.0,>=2.0.0
19
- Requires-Dist: scipy>=0.9
20
- Requires-Dist: pandas>=0.17
21
- Requires-Dist: scikit-learn>=0.14.1
22
- Requires-Dist: progressbar33
23
- Requires-Dist: biopython>=1.65
24
- Requires-Dist: datacache>=0.4.4
25
- Requires-Dist: lxml
26
- Dynamic: license-file
27
-
28
- <a href="https://travis-ci.org/openvax/pepdata">
29
- <img src="https://travis-ci.org/openvax/pepdata.svg?branch=master" alt="Build Status" />
30
- </a>
31
- <a href="https://coveralls.io/github/openvax/pepdata?branch=master">
32
- <img src="https://coveralls.io/repos/openvax/pepdata/badge.svg?branch=master&service=github" alt="Coverage Status" />
33
- </a>
34
- <a href="https://pypi.python.org/pypi/pepdata/">
35
- <img src="https://img.shields.io/pypi/v/pepdata.svg?maxAge=1000" alt="PyPI" />
36
- </a>
37
-
38
- PepData
39
- =======
40
-
41
- Formerly a repository for diverse peptide datasets, now only contains the [Immune Epitope Database](http://www.iedb.org) and a variety of amino acid property matrices. This package
42
- will probably be eventually split and the IEDB portions placed into something
43
- named `pyiedb`.
44
-
45
- **Amino Acid Properties**
46
-
47
- The `amino_acid` module contains a variety of physical/chemical properties for both single amino residues and interactions between pairs of residues.
48
-
49
- Single residue feature tables are parsed into `StringTransformer` objects, which can be treated as dictionaries or will vectorize a string when you call their method `transform_string`.
50
-
51
- Examples of single residue features:
52
- - `hydropathy`
53
- - `volume`
54
- - `polarity`
55
- - `pK_side_chain`
56
- - `prct_exposed_residues`
57
- - `hydrophilicity`
58
- - `accessible_surface_area`
59
- - `refractivity`
60
- - `local_flexibility`
61
- - `accessible_surface_area_folded`
62
- - `alpha_helix_score` (Chou-Fasman)
63
- - `beta_sheet_score` (Chou-Fasman)
64
- - `turn_score` (Chou-Fasman)
65
-
66
- Pairwise interaction tables are parsed into nested dictionaries, so that the interaction between amino acids `x` and `y` can be determined from `d[x][y]`.
67
-
68
- Pairwise interaction dictionaries:
69
- - `strand_vs_coil` (and its transpose `coil_vs_strand`)
70
- - `helix_vs_strand` (and its transpose `strand_vs_helix`)
71
- - `helix_vs_coil` (and its transpose `coil_vs_helix`)
72
- - `blosum30`
73
- - `blosum50`
74
- - `blosum62`
75
-
76
- There is also a function to parse the coefficients of the [PMBEC similarity matrix](http://www.biomedcentral.com/1471-2105/10/394), though this currently lives in the separate `pmbec` module.
77
-
78
-
pepdata-1.2.2/README.md DELETED
@@ -1,51 +0,0 @@
1
- <a href="https://travis-ci.org/openvax/pepdata">
2
- <img src="https://travis-ci.org/openvax/pepdata.svg?branch=master" alt="Build Status" />
3
- </a>
4
- <a href="https://coveralls.io/github/openvax/pepdata?branch=master">
5
- <img src="https://coveralls.io/repos/openvax/pepdata/badge.svg?branch=master&service=github" alt="Coverage Status" />
6
- </a>
7
- <a href="https://pypi.python.org/pypi/pepdata/">
8
- <img src="https://img.shields.io/pypi/v/pepdata.svg?maxAge=1000" alt="PyPI" />
9
- </a>
10
-
11
- PepData
12
- =======
13
-
14
- Formerly a repository for diverse peptide datasets, now only contains the [Immune Epitope Database](http://www.iedb.org) and a variety of amino acid property matrices. This package
15
- will probably be eventually split and the IEDB portions placed into something
16
- named `pyiedb`.
17
-
18
- **Amino Acid Properties**
19
-
20
- The `amino_acid` module contains a variety of physical/chemical properties for both single amino residues and interactions between pairs of residues.
21
-
22
- Single residue feature tables are parsed into `StringTransformer` objects, which can be treated as dictionaries or will vectorize a string when you call their method `transform_string`.
23
-
24
- Examples of single residue features:
25
- - `hydropathy`
26
- - `volume`
27
- - `polarity`
28
- - `pK_side_chain`
29
- - `prct_exposed_residues`
30
- - `hydrophilicity`
31
- - `accessible_surface_area`
32
- - `refractivity`
33
- - `local_flexibility`
34
- - `accessible_surface_area_folded`
35
- - `alpha_helix_score` (Chou-Fasman)
36
- - `beta_sheet_score` (Chou-Fasman)
37
- - `turn_score` (Chou-Fasman)
38
-
39
- Pairwise interaction tables are parsed into nested dictionaries, so that the interaction between amino acids `x` and `y` can be determined from `d[x][y]`.
40
-
41
- Pairwise interaction dictionaries:
42
- - `strand_vs_coil` (and its transpose `coil_vs_strand`)
43
- - `helix_vs_strand` (and its transpose `strand_vs_helix`)
44
- - `helix_vs_coil` (and its transpose `coil_vs_helix`)
45
- - `blosum30`
46
- - `blosum50`
47
- - `blosum62`
48
-
49
- There is also a function to parse the coefficients of the [PMBEC similarity matrix](http://www.biomedcentral.com/1471-2105/10/394), though this currently lives in the separate `pmbec` module.
50
-
51
-
@@ -1,78 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: pepdata
3
- Version: 1.2.2
4
- Summary: Immunological peptide datasets and amino acid properties
5
- Author-email: Alex Rubinsteyn <alex.rubinsteyn@mssm.edu>
6
- Project-URL: Homepage, https://github.com/openvax/pepdata
7
- Project-URL: Bug Tracker, https://github.com/openvax/pepdata/issues
8
- Classifier: Development Status :: 4 - Beta
9
- Classifier: Environment :: Console
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python
14
- Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
15
- Requires-Python: >=3.9
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE.txt
18
- Requires-Dist: numpy<3.0.0,>=2.0.0
19
- Requires-Dist: scipy>=0.9
20
- Requires-Dist: pandas>=0.17
21
- Requires-Dist: scikit-learn>=0.14.1
22
- Requires-Dist: progressbar33
23
- Requires-Dist: biopython>=1.65
24
- Requires-Dist: datacache>=0.4.4
25
- Requires-Dist: lxml
26
- Dynamic: license-file
27
-
28
- <a href="https://travis-ci.org/openvax/pepdata">
29
- <img src="https://travis-ci.org/openvax/pepdata.svg?branch=master" alt="Build Status" />
30
- </a>
31
- <a href="https://coveralls.io/github/openvax/pepdata?branch=master">
32
- <img src="https://coveralls.io/repos/openvax/pepdata/badge.svg?branch=master&service=github" alt="Coverage Status" />
33
- </a>
34
- <a href="https://pypi.python.org/pypi/pepdata/">
35
- <img src="https://img.shields.io/pypi/v/pepdata.svg?maxAge=1000" alt="PyPI" />
36
- </a>
37
-
38
- PepData
39
- =======
40
-
41
- Formerly a repository for diverse peptide datasets, now only contains the [Immune Epitope Database](http://www.iedb.org) and a variety of amino acid property matrices. This package
42
- will probably be eventually split and the IEDB portions placed into something
43
- named `pyiedb`.
44
-
45
- **Amino Acid Properties**
46
-
47
- The `amino_acid` module contains a variety of physical/chemical properties for both single amino residues and interactions between pairs of residues.
48
-
49
- Single residue feature tables are parsed into `StringTransformer` objects, which can be treated as dictionaries or will vectorize a string when you call their method `transform_string`.
50
-
51
- Examples of single residue features:
52
- - `hydropathy`
53
- - `volume`
54
- - `polarity`
55
- - `pK_side_chain`
56
- - `prct_exposed_residues`
57
- - `hydrophilicity`
58
- - `accessible_surface_area`
59
- - `refractivity`
60
- - `local_flexibility`
61
- - `accessible_surface_area_folded`
62
- - `alpha_helix_score` (Chou-Fasman)
63
- - `beta_sheet_score` (Chou-Fasman)
64
- - `turn_score` (Chou-Fasman)
65
-
66
- Pairwise interaction tables are parsed into nested dictionaries, so that the interaction between amino acids `x` and `y` can be determined from `d[x][y]`.
67
-
68
- Pairwise interaction dictionaries:
69
- - `strand_vs_coil` (and its transpose `coil_vs_strand`)
70
- - `helix_vs_strand` (and its transpose `strand_vs_helix`)
71
- - `helix_vs_coil` (and its transpose `coil_vs_helix`)
72
- - `blosum30`
73
- - `blosum50`
74
- - `blosum62`
75
-
76
- There is also a function to parse the coefficients of the [PMBEC similarity matrix](http://www.biomedcentral.com/1471-2105/10/394), though this currently lives in the separate `pmbec` module.
77
-
78
-
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes