Skip to main content


Unit Tests

Author: Daniel Marrama

Peptide search against a reference proteome, or sets of proteins, with residue subtitutions.

Two step process: preprocessing and matching.

Preprocessed data is stored in a SQLite or pickle format and only has to be performed once.

As a competition to improve tool performance, we created a benchmarking framework with instructions here.

Requirements

Installation

pip install pepmatch

Inputs

Preprocessor

proteome - Path to proteome file to search against.
k - k-mer size to break up proteome into.
preprocessed_format - SQLite ("sqlite") or "pickle".
preprocessed_files_path - (optional) Directory where you want preprocessed files to go. Default is current directory.
gene_priority_proteome - (optional) Subset of proteome with prioritized protein IDs.\

Matcher

query - Query of peptides to search either in .fasta file or as a Python list.
proteome_file - Name of preprocessed proteome to search against.
max_mismatches - Maximum number of mismatches (substitutions) for query.
k - (optional) k-mer size of the preprocessed proteome. If no k is selected, then a best k will be calculated and the proteome will be preprocessed
preprocessed_files_path - (optional) Directory where preprocessed files are. Default is current directory.
best_match - (optional) Returns only one match per query peptide. It will output the best match.
output_format - (optional) Outputs results into a file (CSV, XLSX, JSON, HTML) or just as a dataframe.
output_name - (optional) Specify name of file for output. Leaving blank will generate a name.

Note: For now, due to performance, SQLite is used for exact matching and pickle is used for mismatching.

Note: PEPMatch can also search for discontinuous epitopes in the residue:index format. Example:

"R377, Q408, Q432, H433, F436, V441, S442, S464, K467, K489, I491, S492, N497"

Command Line Example

pepmatch-preprocess -p human.fasta -k 5 -f sql
pepmatch-match -q peptides.fasta -p human.fasta -m 0 -k 5

Exact Matching Example

from pepmatch import Preprocessor, Matcher

# proteome, k, preprocessed_format, target directory, gene_priority_proteome
Preprocessor(
  'proteomes/human.fasta', '.', 'proteomes/human_gp.fasta'
).sql_proteome(k = 5) # preprocessing only needs to be done once!

# query, proteome, max_mismatches, k, preprocessed files directory
Matcher(
  'queries/mhc_ligands_test.fasta', 'proteomes/human.fasta', 0, 5, '.'
).match()

Mismatching Example

from pepmatch import Preprocessor, Matcher

# proteome, k, preprocessed_format, target directory
Preprocessor('proteomes/human.fasta').pickle_proteome(k = 3)

# query, proteome, max_mismatches, k, preprocessed files directory
Matcher(
  'queries/neoepitopes_test.fasta', 'proteomes/human.fasta', 3, 3
).match()

Best Match Example

from pepmatch import Preprocessor, Matcher
Matcher(
  'queries/milk_peptides.fasta', 'proteomes/human.fasta', best_match=True
).match()

The best match parameter without k or mismatch inputs will produce the best match for each peptide in the query, meaning the match with the least number of mismatches, the best protein existence level, and if the match exists in the gene priority proteome. No preprocessing beforehand is required, as the Matcher class will do this for you to find the best match.

Outputs

As mentioned above, outputs can be specified with the output_format parameter in the Matcher class. The following formats are allowed: dataframe, csv, xlsx, json, and html.

If specifying dataframe, the match() method will return a pandas dataframe which can be stored as a variable:

df = Matcher('queries/neoepitopes_test.fasta', 'human.fasta', 3, 3, output_format='dataframe').match()

TODO

  • Test other key-value stores (Redis, Memcached, LMDB, etc.)
  • Remove dependency on Levenshtein (this is not maintained very well)

Release files for pepmatch 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pepmatch 0.9.3
File Size Uploaded
pepmatch-0.9.3.tar.gz 21.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pepmatch 0.9.3
File Interpreter ABI Platform
pepmatch-0.9.3-py3-none-any.whl Python 3 none any Details

Total release size: 45.2 kB

Release files / pepmatch-0.9.3.tar.gz

Download URL pepmatch-0.9.3.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5bccc99a89e5d3298589492bc683f94fdf3f21fdbe8c952bbb23828b815ad52c
BLAKE2b-256 checksum
How to use checksums
f0a5d693fc5f0dba2cbd92a4b5e48ebc95e14196dbf3499387fa68841dc159eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.16

Release files / pepmatch-0.9.3-py3-none-any.whl

Download URL pepmatch-0.9.3-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11809eb47d2a88f206bbe291433cba209442e475e5a1845271570f959c056409
BLAKE2b-256 checksum
How to use checksums
3d8eb93d9d85de970befe31f386be0e14a2b067bcb832d0e9b0b0ba0a601f8fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.16

Release history Release notifications | RSS feed

1.5.0

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

2 release files

This release

0.9.3 This release

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8

2 release files

0.7.13

2 release files

0.7.12

2 release files

0.7.9

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3

2 release files

0.1.0

13 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page